Skip to main content
PeterKwek
Associate II
Apr 25, 2023 7:23 AM UTC
Question

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.

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.

This topic has been closed for replies.

6 replies

Senior III
Apr 25, 2023 4:18 PM UTC

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
Senior III
Apr 27, 2023 8:45 AM UTC

@PeterKwek​ did you resolve problem?

Dudo
PeterKwek
PeterKwekAuthor
Associate II
May 9, 2023 6:18 AM UTC

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
PeterKwekAuthor
Associate II
May 10, 2023 9:05 AM UTC

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
PeterKwekAuthor
Associate II
May 10, 2023 9:56 AM UTC

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
PeterKwekAuthor
Associate II
May 17, 2023 11:52 AM UTC

New information:

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