2023-05-09 01:38 AM
Hi All,
I have implemented EEPROM Emul Middleware in STM32WL project (https://www.st.com/resource/en/application_note/an4894-eeprom-emulation-techniques-and-software-for-stm32-microcontrollers-stmicroelectronics.pdf) in lieu of writing directly in FLASH the NVM Lorawan Context Structure.
LorawanEndNode example store the NVM Lorawan Context Structure in FLASH, directly as follow( function OnStoreContextRequest in lora_app.c):
if (FLASH_IF_Erase(LORAWAN_NVM_BASE_ADDRESS, FLASH_PAGE_SIZE) == FLASH_IF_OK)
{
FLASH_IF_Write(LORAWAN_NVM_BASE_ADDRESS, (const void *)nvm, nvm_size);
}
I changed this function to my own function using EEPROM Emul
//store nvm in eeprom
writeNVMContext_EEPROMemul ((const void *)nvm, nvm_size);
And something similar to restore the context.
It is working properly as desired:
My calculations are that EEPROM Emul write cycles are 10.000, and i have configured EEPROM emul for 2 & 2 EEPROM Pages:
1484 bytes first write.
24 bytes every Uplink/Downlink
...
...
4096 bytes(2 pages) 1484 + 108x24 bytes.
Every 108 Downlink/Uplink 2 pages are erased.
Next 108 Downlink/Uplink Next 2 pages are erased.
We have 4 pages of EEPROM Emul.
If every page have 10000 write cycle life.
EEPROM Emul lifetime in this case is: 216 x10000= 2.160.000 downlink/uplink messages
Do you think that it is correct?
Thanks very much
Solved! Go to Solution.
2023-05-11 03:39 AM
hello @RPaja.1 and welcome to ST Community
Based on your description, your calculations seem to be correct. If you are only writing 24 bytes for every uplink/downlink message, and you have 4 pages of EEPROM Emul each with a write cycle life of 10,000, then your EEPROM Emul lifetime in this case would be 216 x 10,000 = 2,160,000 uplink/downlink messages.
However, it's worth noting that the actual lifespan of the EEPROM Emul may vary depending on various factors . That's why it's always a good idea to perform some testing to validate the longevity of the EEPROM Emul under your specific use case.
hope this is helpful. If this is what you are looking for, please mention my answer as the best answer so that the information will be defused.
Issam
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-05-11 03:39 AM
hello @RPaja.1 and welcome to ST Community
Based on your description, your calculations seem to be correct. If you are only writing 24 bytes for every uplink/downlink message, and you have 4 pages of EEPROM Emul each with a write cycle life of 10,000, then your EEPROM Emul lifetime in this case would be 216 x 10,000 = 2,160,000 uplink/downlink messages.
However, it's worth noting that the actual lifespan of the EEPROM Emul may vary depending on various factors . That's why it's always a good idea to perform some testing to validate the longevity of the EEPROM Emul under your specific use case.
hope this is helpful. If this is what you are looking for, please mention my answer as the best answer so that the information will be defused.
Issam
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-05-11 03:52 AM
Thanks for your response @IIRHO.1 , I will test it.
Regards