2022-11-24 05:30 AM
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).
Has anybody faced similar problem? How to overcome it and what can I do to make context management more secure and stable?
2022-12-01 08:20 AM
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
2023-04-26 03:25 AM
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