hello , thesesdays im trying to make some flash residence bootloader for mpc5674f
i found some reference pdf and project which is for mpc5634m and ssd driver
and below code is reference things... but it's not working
however, 5634m code is working.. i dont why and how it is working...
is there a someon who can explane to me?
/* Erase all blocks (except area occupied by bootloader) in low and mid addr space of flash array 0 */
// it is a 5634m code
// lowEnabledBlocks = 0x000003F8;
// midEnabledBlocks = 0x00000003;
// highEnabledBlocks = 0x00000000;
/* Select all blocks in low addr space except block 0 */
#if (!RUN_IN_FLASH)
lowEnabledBlocks = (0xFFFFFFFF >> (32 - ssdConfig.lowBlockNum));
midEnabledBlocks = 0x00000000;
highEnabledBlocks = 0x00000000;
returnCode = pFlashErase( &ssdConfig,
shadowFlag,
lowEnabledBlocks,
midEnabledBlocks,
highEnabledBlocks,
(tpfNullCallback)NULL_CALLBACK );
if ( C90FL_OK != returnCode )
{
return(FlashEraseError);
}
#endif
lowEnabledBlocks = 0x00000000;
midEnabledBlocks = (0xFFFFFFFF >> (32 - ssdConfig.midBlockNum));
highEnabledBlocks = 0x00000000;
returnCode = pFlashErase( &ssdConfig, shadowFlag, lowEnabledBlocks, midEnabledBlocks, highEnabledBlocks, (tpfNullCallback)NULL_CALLBACK );
if ( C90FL_OK != returnCode )
{
return(FlashEraseError);
}
/* Select all blocks in high addr space */
lowEnabledBlocks = 0x00000000;
midEnabledBlocks = 0x00000000;
highEnabledBlocks = (0xFFFFFFFF >> (32 - ssdConfig.highBlockNum));
returnCode = pFlashErase( &ssdConfig, shadowFlag, lowEnabledBlocks, midEnabledBlocks, highEnabledBlocks, (tpfNullCallback)NULL_CALLBACK );
if ( C90FL_OK != returnCode )
{
return(FlashEraseError);
}