cancel
Showing results for 
Search instead for 
Did you mean: 

LoRaWAN "User defined skeleton" application stuck with `LORAMAC_HANDLER_BUSY_ERROR`

SenseJo
Associate II

Hello,

we are developing an application with LoRaWAN and FreeRTOS, based on STM32CubeWL, for a custom board.

While we got this to send data properly with the LoRaWAN "End Node skeleton", we are facing issues with the "User defined skeleton".

With "User defined skeleton", join and sending works the first time, but further calls to `LmHandlerSend(…)` error with `LORAMAC_HANDLER_BUSY_ERROR`, because in LoRaMac.c `MacCtx.MacState` is `LORAMAC_TX_RUNNING`.

While this might be similar to question 0D53W00001aJT8eSAG in this forum, we already tried increasing the stack sizes with no success.

Instead, repeated sending works properly if we set `DISABLE_LORAWAN_RX_WINDOW` in lorawan_conf.h to 1. That is with "NVIC/SUBGHZ Radio Interrupt" enabled in the IOC. But we want to use RX functionality as well.

Any help is greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
SenseJo
Associate II

I could now finally fix my application, to make repeated LoRaWAN sending with FreeRTOS and user-defined skeleton work.

The issue was that we hadn't implemented timer_if.c, assuming it wouldn't be required since we weren't using the UTIL_TIMER in lora_app.c. But it turned out that radio.c is using UTIL_TIMER, and thus an implementation of timer_if.c is necessary.

View solution in original post

4 REPLIES 4
Louis AUDOLY
ST Employee

Hello @Johannes Süllner​ ,

Sorry for the delay.

Did you solve this issue ?

Otherwise, could you try with the LoRaWAN example from STM32Cube_FW_WL_V1.2.0 (under \Projects\NUCLEO-WL55JC\Applications\LoRaWAN\LoRaWAN_End_Node_FreeRTOS ) and verify if it is working.

Regards

Louis

SenseJo
Associate II

Hello @Louis AUDOLY​ ,

thank you for your response. No, I could not solve this issue so far.

I could not find a LoRaWAN_End_Node_FreeRTOS example in the Path you described.

Nevertheless, I tried again with a generated project with FreeRTOS and LoRaWAN End Node skeleton; it is working properly. It's only the User-defined skeleton we have this problem with.

Louis AUDOLY
ST Employee

Hello, @Johannes Süllner​ ,

With my link you can download the software (last version is 1.2.0) and once this package is downloaded you will find the project under this path.

The end node skeleton enable more features than the user defined which is a very basic initialization of a lorawan project.

With the end node skeleton you will add a lot of code in the "user section" that miss in the user defined skeleton where you have to define every thing.

You will find even more code if you start from the ioc from the firmware package

Regards

SenseJo
Associate II

I could now finally fix my application, to make repeated LoRaWAN sending with FreeRTOS and user-defined skeleton work.

The issue was that we hadn't implemented timer_if.c, assuming it wouldn't be required since we weren't using the UTIL_TIMER in lora_app.c. But it turned out that radio.c is using UTIL_TIMER, and thus an implementation of timer_if.c is necessary.