mpc5748g bootloader

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mpc5748g bootloader

1,155 Views
tony_huang
Contributor III

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
2 Replies

770 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

from RM:

pastedImage_1.png

'1' disables access

'0' enables access

All low blocks above 0xF8_C000 (this one is used for bootloader) are enabled. HSM blocks (0x0062_...) are disabled.

Regards,

Lukas

770 Views
ricky529762216
Contributor I

Where can I download this document?

0 Kudos