So I was working with programming the shadow flash on MPC5668G. I wasn't performing ANY erase operation at all - just programming.
In one instance, I wrote to a 32-bit aligned address (0x00FFC004). The board has refused to boot after that. I later read in the manual that shadow-flash addresses need to be 64-bit aligned.
What has happened to the board and what is the best way to recover from it?
Jitesh
PS:
Code I used to program shadow flash (incorrectly):
// Unlock flash
if (!(MEM_READ(FLASH_LML) & FLASH_LML_LME))
MEM_WRITE(FLASH_LML, FLASH_LML_PASSWORD);
if (!(MEM_READ(FLASH_SLL) & FLASH_SLL_LME))
MEM_WRITE(FLASH_SLL, FLASH_SLL_PASSWORD);// unlock shadow block for programming
MEM_AND(FLASH_LML, ~FLASH_LML_SLOCK);
MEM_AND(FLASH_SLL, ~FLASH_SLL_SSLOCK);// Write to shadow space
MEM_WRITE(FLASH_MCR, FLASH_MCR_PGM); // Init flash for PGM operationMEM_WRITE(PVU32 (START_OF_SHADOW_FLASH + SLOTB_OFFSET), LC_PROD_FUSED); // Unfortunately I set SLOTB_OFFSET to 0x4. START_OF_SHADOW_FLASH = 0x00FFC000
MEM_OR(FLASH_MCR, FLASH_MCR_EHV); // Enable high voltagetick = xTaskGetTickCount();
while (!(MEM_READ(FLASH_MCR) & FLASH_MCR_DONE) && TICK_DELTA_NOW(tick) <= FLASH_OP_TIMEOUT);
Hi,
yes the shadow flash should be always programmed by 64-bit.
Usually there are stored device configuration records, which set the device during reset.
Like calibration values, special registers contents, etc..
I suggest you to rewrite it with 0xFFFF_FFFF_FFFF_FFFF or 0x0000_0000_0000_0000 (nop)
The board has refused to boot after that.
what do you mean by this? Is device in permanent reset? What do you see when you measure reset line?
regards,
Peter