MPC5746R,define a variables which stores at a specified address in Flash?

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

MPC5746R,define a variables which stores at a specified address in Flash?

1,430 Views
529610366
Contributor II

Hi ,
I am using the S32 Design Studio to develop a calibration project.
I have a question :

How can I define a variables which stores at a specified address in Flash?


For example,in the main_Z4_0.c :

#define FLASH_CAL_PAR __attribute__ ((section("CALFLASH")))
FLASH_CAL_PAR vuint32 test9=0;

I want to define a section named "CALFLASH" at 0x00800000 to 0x00803FFF ,but I don't know how to set it.

Thanks and regards,
Liuming Yang

Labels (1)
0 Kudos
4 Replies

946 Views
stanish
NXP Employee
NXP Employee

Hi Liuming,

I'd suggest you to see this document:

HOWTO: Program data flash (DFLASH) in S32 Design Studio for Power 

It contains the instructions how to create a custom section in Dflash and also how to program it in S32 Design Studio.

Hope it helps.

Stan

0 Kudos

946 Views
529610366
Contributor II

Thank you ,Stan.

I  do following the document's step,the result in map file is correct,but I can't get the result at Memory Window.FLASH_ID.JPG

mapfile.JPG

dflash.JPG

Path: C:\Freescale\S32_Power_v1.1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_1.5.6.201703011834\win32\gdi\P&E\freescale_mpc5746r_1x32x64k_dflash.pcp

This is  the latest version of PEMicro Eclipse Plugin.

solution.JPG

Thanks and regards,
Liuming Yang

0 Kudos

946 Views
stanish
NXP Employee
NXP Employee

Hi,

I suspect the core is running while you are trying to dump the dflash memory.

I'd recommend you to adjust your _DFLASH debug configuration and turn off "Run on reset" and "Set breakpoint at" options since they are not needed for dflash programming.

pastedImage_2.png

Make sure the execution is suspended when checking the memory view:

pastedImage_3.png

Hope it helps.

Stan

946 Views
529610366
Contributor II

Thank you ,Stan.

The problem is solved.

0 Kudos