MPC5748G flash start address(flashStart=1000000)

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

MPC5748G flash start address(flashStart=1000000)

1,490 Views
barkly_lin
Contributor III

Hi

A question about MPC5748G's flash start address.

When I create a new S32 DS MPC5748G project, FLASH Start Address is fixed at 0x1000000.

I checked user manual for MPC5748G's Flash memory as below:

0x00F8C000 0x00F8FFFF 16 KB Small HSM Code Block

 00F8_C000h ~ 00FA_8000 -> boot headers location
0x00F90000 0x00FFFFFF 448 KB Small and Medium NVM Blocks
0x01000000 0x0157FFFF 5632 KB Large Flash NVM

After new S32 DS project created, default flash start address listed as below:

1.com.freescale.s32ds.cross.wizard.prefs

flashStart=1000000

2.MPC5748G_flash.ld

flash_rchw : org = 0x00FA0000, len = 0x4
cpu0_reset_vec : org = 0x00FA0000+0x10, len = 0x4
cpu1_reset_vec : org = 0x00FA0000+0x14, len = 0x4
cpu2_reset_vec : org = 0x00FA0000+0x04, len = 0x4

...

    m_text         :  org = 0x1000000,

Then I modified them like this:

1.com.freescale.s32ds.cross.wizard.prefs

flashStart=FC0000

2.MPC5748G_flash.ld

flash_rchw : org = 0x00F8C000, len = 0x4
cpu0_reset_vec : org = 0x00F8C000+0x10, len = 0x4
cpu1_reset_vec : org = 0x00F8C000+0x14, len = 0x4
cpu2_reset_vec : org = 0x00F8C000+0x04, len = 0x4

...

    m_text         :  org = 0x00FC0000,      

My program is simply set LED blink to make sure program is running.

After modified FLASH Start address, I flashed .elf into DEVKIT via \Run\Flash from file...

The LED is working, but after I remove USB power from DEVKIT, then plug-in again, LED is no longer blink, program not running anymore.

It seems wrong to change flashStart=FC0000, why?

Does it means only Large Flash Blocks can be used for my own program?
0x01000000 0x0157FFFF (256 KB * 22), it is just only 5 MB within 6MB totally.

Regards,

0 Kudos
3 Replies

715 Views
Lance
Contributor I

Hi,

    I have a SPC5744B chip, which I has burned random data to the HSM Code Block . Now the chip cannot enter the debug mode.

What should I do now?

 

 

Thank you!

0 Kudos

1,135 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

there is a little bit different problem. Only block, which cannot be used is 16KB HSM code block starting at address 0x00F8C000. Erasing and programming of this block was disabled in S32DS, because of security. If there is double bit ecc error in this block, microcontroller is locked by internal mechanism and it is not working anymore (security feature).

Because there was many incidents with double bit ECC errors, it was decided to disable erasing and programming of this block. 

So, in your application, you can use any block from 0x00F90000 until the end of the flash memory. About startup wizard, there is definitely a bug with flash start address which cannot be changed. I will contact my colleague and we will report this bug next week.

So, if you want to use entire flash memory, I recommend you to edit linker file using this way:

flash_rchw : org = 0x00F90000, len = 0x4
cpu0_reset_vec : org = 0x00F90000+0x10, len = 0x4
cpu1_reset_vec : org = 0x00F90000+0x14, len = 0x4
cpu2_reset_vec : org = 0x00F90000+0x04, len = 0x4

...

    m_text         :  org = 0x00F94000,      

I tested this configuration and it works correct on my side. Could you please test this on your side and eventually let me know, if this solution is suitable for you?

Thank you in advance.

Regards,

Martin

0 Kudos

458 Views
juang
Contributor I

Hi Martin,

I am also using MPC5748G and is also trying the LED blink sample code.

I edit my linker file as you suggested to:

flash_rchw : org = 0x00F90000, len = 0x4
cpu0_reset_vec : org = 0x00F90000+0x10, len = 0x4
cpu1_reset_vec : org = 0x00F90000+0x14, len = 0x4
cpu2_reset_vec : org = 0x00F90000+0x04, len = 0x4

...

    m_text         :  org = 0x00F94000,     

The LED is blinking, but after I removed USB power from MPC5748G-LCEVB then plug in again, LED no longer blink.

Do you know why?

Thanks

0 Kudos