Problem writing to flash on a MPC5517

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

Problem writing to flash on a MPC5517

349 Views
richardyates
Contributor I

I have a problem writing to the High block (H0) flash section on a MPC5517 and I'm hoping someone may have some suggestions. The software is a simple maintenance application that waits for serial commands and performs actions based on those commands (reading ADC values, setting digital outputs, reading/writing H0 flash, etc).

The software is targeted as running out of RAM and when loaded via the debugger (PEMicro Nexus ICD) the software works perfectly and can read/write and erase the flash as required.

However when the software is booted via the serial port all the functions except the flash writing work fine. The software can read previously programmed flash values but won't erase or write new values; no exceptions are thrown - the application performs perfectly after a flash write is commanded.

I initially suspected the debugger initialisation script was doing something different to the BAM during serial boot but I haven't managed to (in my limited time spent looking) find anything.

Any help or suggestions welcome,

Thanks,

Richard

0 Kudos
1 Reply

215 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

the BAM just initializes MMU, the reset script in pemicro debugger initializes MMU and RAM, it disables watchdog and it sets IVPR register to point to address 0x40001000. So, the differences are:

- RAM: if you use serial boot then the RAM is initialized by BAM by writing the image to RAM (up to size of image). If you want to use the rest of the RAM (behind the image) then it must be initialized manually by downloaded software.

- watchdog: if your application is working fine except flash programming then I suppose you handle watchdog appropriately.

- IVPR: should be initialized by your code, of course.

Summary: I can't see any problem here if everything is working except flash programming.

Have you tried to read status bits in flash MCR register after programming? Was there anything unusual?

Lukas

0 Kudos