memory backup within strict time limit (10s max) on STM32L4R9
Hello everyone,
I’m currently working on developing a bootloader, and I’m trying to implement a memory backup function. My goal is to copy 158 pages of 4 KB from BANK1 to BANK2.
I’ve written software that uses the standard copy function with FLASH_TYPEPROGRAM_DOUBLEWORD (64 bits at a time). However, this process takes more than 10 seconds because after each write, I check the data integrity: I read the data from BANK1, write it to BANK2, then read it again from BANK2 and compare to verify the data.
The main issue I’m facing is that after writing the 158 pages, I need to send a response via CAN. This results in a timeout error on the diagnostic application because the 10-second limit is exceeded.
I’m looking for a solution to perform the memory backup operation faster, ideally in under 8 seconds, while still ensuring data integrity.
I’ve tried using DMA, and although it works, I believe it’s not the best solution for my scenario due to some limitations.
If you have any ideas or suggestions to optimize this operation, I would greatly appreciate your help!
Thank you in advance for your feedback.
