LPC5502 crash on FLASH_Read

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC5502 crash on FLASH_Read

454 Views
sigmeh
Contributor I

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?

Labels (1)
0 Kudos
Reply
2 Replies

419 Views
sigmeh
Contributor I

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).

0 Kudos
Reply

429 Views
EdwinHz
NXP TechSupport
NXP TechSupport

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.

0 Kudos
Reply