Flash Corruption of LPC546 Processor On Power Down

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

Flash Corruption of LPC546 Processor On Power Down

1,113 Views
dbresciaNAII
Contributor I

Hello, I've been working with a LPC54616J512ET100 microprocessor and am stumped with a particular issue. Occasionally, when I power cycle the microprocessor, a portion of the flash memory will be corrupted. I suspect that this perhaps has to do with the LPC attempting to write to the eNVM without proper input voltage. I've experimented with adding a voltage supervisor to alert the LPC that voltage is dropping via an interrupt. The interrupt sets a flag which prohibits any any writes to the eNVM. Any suggestions regarding ideas to preserve the eNVM between power cycles would be greatly appreciated.

0 Kudos
Reply
2 Replies

1,043 Views
dbresciaNAII
Contributor I

Hi XiangJun,

Thank you for your swift response!

I have good confidence that our system has a capable DC/DC converter providing power to the LPC uP.  

But I will take your advice and ensure that all interupts are disabled during writes to the flash.  I will also make sure that the first 32 bytes of RAM are used only by the flash routines.

 

Thank You,

 

Dan Brescia

 

0 Kudos
Reply

1,083 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

From hardware perspective, when you erase/program flash, the current will increase, so it is possible that the power supply voltage will decrease, I suggest you use a LDO or DC/DC converter which can provide enough current.

From software perspective, I suspect that you have the code to erase/program flash in your application code, as you know that flash operation instruction is saved in ROM and run in ROM, when you erase/program flash, you must disable all interrupt, disable watchdog lest the flash code is executed.

I copy the section from UM10912.pdf

"

section 5.6 In-Application Programming

The flash memory is not accessible during a write or erase operation. IAP commands, which results in a flash write/erase operation, use 32 bytes of space in the top portion of the on-chip RAM for execution. The user program should not be use this space if IAP flash programming is permitted in the application.

"

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply