-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make help in lbm_lib describes wrong way to select radio #103
Comments
On a follow-up note: adding disable_irq() and enable_irq() to my code matches the behavior with what is in the example, but sx126x_hal is still not called
|
Oh, it was actually wrong make command. According to
So my make command was following: |
Update:
This appears to be an issue with makefile of lbm_lib.
make help
provides wrong instruction for specifying radio chip. Possible correct way is described in third comment in this issue.Description:
I'm working on integrating the LoRa Basics Modem (LBM) with an LLCC68 (can be threatend as SX1262) chip on an STM32L071 platform via STM32CubeIDE. My implementation of
sx126x_hal.c
,ral_sx126x_bsp.c
andsmtc_modem_hal.c
are basically identical to such provided ine example, but written with HAL instead of LL. Initially i patched example to run with my board, this boils down to just different pinout and using software random instead of TRNG. And it works fine, it sends packets, sucsessfully joins network and sends counter. However my attempt to recreate the same in CubeIDE fails at sending join request for unknown reason. In order to debug this I added some trace prints:main_periodical_uplink()
:sx126x_hal_write
andsx126x_hal_read
:smtc_modem_hal_start_timer
with ms and calculated ticks and timer IRQ callback with textTCB!
Log form patched example:
Log from my example:
Expected behavior:
After initialization modem should send join packed to transceiver over SPI
Investigation:
hal_mcu_set_sleep_for_ms
behaves differently than intuitively expected. AfterSend Payload
message you can seeModem engine sleep time: 20000 ms
. However, in example the mcu wakes up almost instantly and right after that timer callback fires. In my implementation mcu also doesn't stays in sleep for 20 seconds, but calback fires during sleep and does nothing exept for sending info trace about that.TCB!
only afterSleep ended normaly!
TCB!
is being sent. However whysx126x_hal
write and read functions aren't called remains unclear.Additional info and questions:
hal_mcu_disable_irq( );
andhal_mcu_enable_irq( );
before and after sleep in example? I see in the docsBut doesn't modem handles it by itself with
smtc_modem_hal_disable_modem_irq
?lpm_enter_sleep_mode
function put the MCU in SLEEP or STOP mode?hal_mcu_set_sleep_for_ms
andmodem_hal_start_timer
are as follows:At this point I'm not sure if the problem is the way I'm using the lbm_lib library or if I've made a mistake somewhere with the STM32 HAL. I would appreciate any help or advice on this problem.
The text was updated successfully, but these errors were encountered: