cancel
Showing results for 
Search instead for 
Did you mean: 

LoRaWAN context management issue

JNowa.4
Associate III

I run a LoRaWAN End Node application on the custom board based on STM32WLCCU6 MCU. Application has enabled contex management to store LoRaWAN data and be able to resume communication after power loss without rejoining to the network. NVM memory is updated every uplink. It generally works well but sometimes (usually after reset) it doesn't manage to restore data. My first idea was that issue is caused by cutting off the power while device is manging the flash so I created another backup flash region to restore data from there in case of an issue. Apparently it was not it. Data is acctually stored in flash but restoring data process fails because CRC32 values don't match and RestoreNvmData function returns LORAMAC_STATUS_NVM_DATA_INCONSISTENT (screenshot below).

0693W00000WJR75QAH.pngHas anybody faced similar problem? How to overcome it and what can I do to make context management more secure and stable?

2 REPLIES 2
Louis AUDOLY
ST Employee

Hello @Community member​ ,

Are you sure after the last uplink to have updated the NVM correctly ? If the reset happen before you store the data, this could give you a CRC error when you try to restore the Nvm data.

Regards

Louis

RPaja.1
Associate II

Hi @Community member​ ,

I have problems with NVM context, but related to FLASH writting cycles. Similar As you are doing in your app, i am storing NVM context in FLASH every downlink (because i have uplink ACK messages) in order to update the frame counter. But i have a big problem because FLASH writing cycles are limited to 10k, and in device lifetime downlink messages could be greater than 10000