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?
Code I used to program shadow flash (incorrectly):
// Unlock flash
if (!(MEM_READ(FLASH_LML) & FLASH_LML_LME))
if (!(MEM_READ(FLASH_SLL) & FLASH_SLL_LME))
// unlock shadow block for programming
// Write to shadow space
MEM_WRITE(FLASH_MCR, FLASH_MCR_PGM); // Init flash for PGM operation
MEM_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 voltage
tick = xTaskGetTickCount();
while (!(MEM_READ(FLASH_MCR) & FLASH_MCR_DONE) && TICK_DELTA_NOW(tick) <= FLASH_OP_TIMEOUT);