cancel
Showing results for 
Search instead for 
Did you mean: 

When "USE_FULL_ASSERT" is enabled in example application "LoRaWan_End_Node" the application stops sending or keeps trying to send, but messages not received at server side.

PeterKwek
Associate II

Just used the example application "LoRaWan_End_Node" with the Nucleo-WLWL55JC board.

This example send every 10seconds data to a gateway which is received in the TheThingsNetwork environment.

Default is "LoRaWan_End_Node" disabled, when "USE_FULL_ASSERT" is enabled the applciation starts working and data is received, but after first time or after some rounds (within some minutes) the application keeps trying to send data, but data is not received at the server or the attempts are stopped. There is not assert or error in debugger.

When "USE_FULL_ASSERT" is disabled again, the data is received okay at server endless time.

In the stm32wlxx_hal_rtc.c source file some additional checks are done when USE_FULL_ASSERT is enabled. Can this be the problem?

In attachment some logging.

6 REPLIES 6
Kamil Duljas
Senior III

Generally assert_param is not implemented by default ​.

If use this code, try set breakpoint here:

https://github.com/PrometheanDesign/LoRaWAN_End_Node/blob/20cf39f58c757cf4b71abaa469fd267da802631f/Core/Src/main.c#L176​

Dudo
Kamil Duljas
Senior III

@PeterKwek​ did you resolve problem?

Dudo
PeterKwek
Associate II

Hello Kamil,

I was a couple of days out of the office.

I will try it this week. I keep you updated.

Greetings Peter

PeterKwek
Associate II

Step 1: Original "LoRaWan_End_Node" with the Nucleo-WLWL55JC board, device is periodicall communicating to server (every 10sec) -> okay.

Step 2: enable "#define USE_FULL_ASSERT  1" and set breakpoint at "assert_failed()" function.

No periodicall communication to the server, and breakpoint is not triggered.

Step 3: disable code between #ifdef USE_FULL_ASSERT in "stm32wlxx_hal_rtc.c" (5x), communicating works again. r754 HAL_RTC_SetTime(), r1140 / r1228 HAL_RTC_SetAlarm(), r1346 / r1435 HAL_RTC_SetAlarm_IT(),

Periodicall communication to the server. -> okay

Step 4 enable just statement "if (READ_BIT(RTC->ICSR, RTC_ICSR_BIN) == RTC_BINARY_NONE)" between #ifdef USE_FULL_ASSERT in "stm32wlxx_hal_rtc.c" r756

No periodicall communication to the server, and breakpoint is not triggered.

Conclusion:

Enable the USE_FULL_ASSERT will call reading register "RTC->ICSR" in "stm32wlxx_hal_rtc.c", which stops the periodicall RTC interrupt.

Question:

Why stops the periodically interrupt when reading "RTC->ICSR" ?

PeterKwek
Associate II

Additional information.

Also "assert_param(IS_PWR_STOP_ENTRY(STOPEntry));" in function HAL_PWREx_EnterSTOP2Mode() of file stm32wlxx_hall_pwr_ex.c (r1036) gives hanging in stop mode when "USE_FULL_ASSERT" is enabled.

PeterKwek
Associate II

New information:

the problem only happens when GCC optimise is set to NONE (from debug).