Hi,
The AN5319SW.zip describes the MPC5748G bootloader, and the main.c folder, I cann't get some poins:
.........................................
lowBlockSelect = 0x17C;
..........................................
returnCode = pSetLock(&ssdConfig, C55_BLOCK_LOW, 0xFFFFFE83);
To unlock low block in the flash, how can I get the vaule of 0xFFFFFE83? And the lowBlockSelect ?= 0x17C.
UINT8 EraseFlash(void)
{
UINT32 opResult = 0;
UINT32 lowBlockSelect;
UINT32 midBlockSelect;
UINT32 highBlockSelect;
N256K_BLOCK_SEL n256KBlockSelect;
OutStr("\r\nPlease wait...\r\n");
/* Select all blocks except blocks occupied by bootloader */
lowBlockSelect = 0x17C;
midBlockSelect = 0x3FE;
highBlockSelect = 0x0;
n256KBlockSelect.first256KBlockSelect = 0x003FFFFF;
n256KBlockSelect.second256KBlockSelect = 0x0;
returnCode = pFlashErase(&ssdConfig,
C55_ERASE_MAIN,
lowBlockSelect,
midBlockSelect,
highBlockSelect,
n256KBlockSelect);
UINT8 FlashInitAndUnlock(void)
{
/* Flash Init */
returnCode = pFlashInit(&ssdConfig);
if (C55_OK != returnCode)
{
return(FlashInitError);
}
/* Unlock all flash blocks except two 16KB blocks which are occupied by
bootloder:
(0x00F8C000--0x00F8FFFF and 0x00F90000--0x00F93FFF) */
/* unlock low blocks except 0x00F8C000--0x00F8FFFF */
returnCode = pSetLock(&ssdConfig, C55_BLOCK_LOW, 0xFFFFFE83);
if (C55_OK != returnCode)
{
return(FlashInitError);
}
/* unlock mid blocks except 0x00F90000--0x00F93FFF */
returnCode = pSetLock(&ssdConfig, C55_BLOCK_MID, 0xFFFFFC01);
if (C55_OK != returnCode)
{
return(FlashInitError);
}
/* unlock 256K blocks */
returnCode = pSetLock(&ssdConfig, C55_BLOCK_256K_FIRST, 0xFFC00000);
if (C55_OK != returnCode)
{
return(FlashInitError);
}
return(noErr);
}//FlashInitAndUnlock