I'm using LPC1768 or 1769, both experienced all flash data got wiped out mysteriously. What could cause that to happen? How to protect it from happening?
Could you let me know more about this problem? In which cases is when this happens? Is all the memory or is some flash section? Is the MCU in a rough enviroment?
It happened after power cycle the box which had all 8 boards in it, each board had one MCU. All 8 MCU lost the flash data. The flash data was stored in only one section. What rough environment are you thinking about that could cost problem to the flash? The board was functioning fine except lost flash data.
My question was due to sometimes in rough environments like the presence of electromagnetic fields (motors) you need to have in count in the design and use techniques to aisle the noise since it can cause unpredictable behaviors.
I will suggest to try each one of the this boards and see if this behavior happens again outside your full design. Also, could you try doing a dump in the memory and check if all the memory was erase or only a single section?
I see. There are motors but they are not near where the boards are at.
I'll check about the section. But I believe it only lost the section for data (use one section for data only). The other section for boot loader is still fine.
If you're using a bootloader to flash your MCU and after a reset the only sector that is wiped is the application sector, I will suggest to check if the bootloader is not clearing this section. Also, is this a custom bootloader or are you using the ISP commands?
Yes it is custom bootloader. I'm using IAP commands (not ISP). The boot loader is only clearing it's own section and not used during power up. The application data section is cleared using ISP command before write to that section to save the data to flash. But when all boards data lost, there shouldn't be anything to require save data to all boards.
Is strange that only the application code was erased and the bootloader was left without changes. Also could you let me know more about your project? For example, which peripherals are you using or if you could identify in which cases the memory is being wipeout?
Retrieving data ...