How can I erase specific blocks of internal flash memory in MPC5645S?
Below is the code for flash erase.
/* Select all blocks in low addr space except block 0 */
lowEnabledBlocks = (0xFFFFFFFF >> (32 - ssdConfig.lowBlockNum));
midEnabledBlocks = 0x00000000;
highEnabledBlocks = 0x00000000;
ret = pFlashErase( &ssdConfig, shadowFlag, lowEnabledBlocks, midEnabledBlocks, highEnabledBlocks, (tpfNullCallback)NULL_CALLBACK );
if ( C90FL_OK != ret )
{
return(FlashEraseError);
}
I want to erase all other blocks except the block occupied by my program (internal_flash: org = 0x00002000, len = 0x00006000). Memory map is given below.
MEMORY
{
resetvector: org = 0x00000000, len = 0x00000008
init: org = 0x00000020, len = 0x00000FE0
exception_handlers: org = 0x00001000, len = 0x00001000
internal_flash: org = 0x00002000, len = 0x00006000
internal_ram: org = 0x40000000, len = 0x00020000
heap : org = 0x40008000, len = 0x00004000
stack : org = 0x4000C000, len = 0x00004000
}