On an LPC5502 I try to read 512 bytes from the flash at address 0xF800. This works most of the time but sometimes the FLASH_Read function does not return but either the controller restarts itself or it jumps to 0xdeadbeee.
Watchdog is disabled, FLASH_Init returns with success. There seems to be also a timing involved, because if I put debug output, it does not happen that often anymore. Interrupts are off during the read.
Is it necessary to wait after init or what could be the reason for that?
Does that mean, that the return of FLASH_Init is not enough? How can I be sure it is completed?
However, I changed the FLASH_Read to memcpy which seems to work stable (no crash after a few thousand reads, before it was more or less for sure with 10 reads or so).
Hi @sigmeh,
Yes, it is important to make sure the flash initialization function is fully completed before trying to access any flash addresses.
BR,
Edwin.