S32 Flash and debug two elf files

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

S32 Flash and debug two elf files

1,604 Views
kfirbs
Contributor III

Hi,

I have 2 elfs that I try and flash and than debug on S32.

The flashing seems to work, and and debug even goes from startup to main.

BUT ...

When I look at the section to which I refer it seems messed up, and does not match either elf:

pegdbserver console:

Command Line :C:\Freescale\S32_Power_v1.1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_1.3.3.201605241936\win32\pegdbserver_power_console -device=MPC5748G -startserver -singlesession -serverport=7224 -interface=USBMULTILINK -speed=5000 -resetdelay=300 -ˆ


CMD>RE


Initializing.
Target has been RESET and is active.
CMD>CM C:\Freescale\S32_Power_v1.1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_1.3.3.201605241936\win32\gdi\P&E\freescale_mpc5748g_1x32x1524k_cflash.pcp


Initializing.
Initialized.


;version 1.01, 04/23/2015, Copyright P&E Microcomputer Systems, www.pemicro.com [5748G_6096k]


;device Freescale, MPC5748G, 1x32x1524k, desc=CFlash


;begin_cs device=$00F8C000, length=$005F4000, ram=$40000000


Loading programming algorithm ...


WARNING - Selected .PCP file has been modified. CRC16 = $6D58
Done.
CMD>EM


Erasing.
Module has been erased.
CMD>PM


Programming.
Processing Object File Data ...

Error during programming.
Error Programming flash of device

Error occured during Flash programming.

Starting reset script (C:\Freescale\S32_Power_v1.1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_1.3.3.201605241936\win32\gdi\P&E\s32e200_mpc574xg.mac) ...

REM This script is compatible with MPC574xG devices.

REM Initialize all of the Main SRAM - 768KB

Initializing RAM from $40000000 to $400BFFFF.

Reset script (C:\Freescale\S32_Power_v1.1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_1.3.3.201605241936\win32\gdi\P&E\s32e200_mpc574xg.mac) completed.

PE-ERROR: Error downloading to the device.
Preset breakpoint encountered.


Preset breakpoint encountered.


Preset breakpoint encountered.


Disconnected from "127.0.0.1" via 127.0.0.1
Target Disconnected.
Target Disconnected.

map file from both elf's with relevant section:

elf1:

*(.modulelist)
.modulelist 0x011cf004 0x20 ./src/ar.o
0x011cf004 module_list

elf2:

*(.modulelist)
.modulelist 0x011cf004 0x20 ./src/ar.o
0x011cf004 module_list

srecord data from relevant address:

elf1:

S319011CF0000000000201002FB00000000001002E16006600004C
S315011CF01401002FB80000000001002DB0006600009D

elf2:

S319011CF000000000020100836C0000000001008092006600006E
S315011CF01401008374000000000100802C00660000BE

and from reading the flash while in debug:

pastedImage_12.png

0 Kudos
2 Replies

988 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

are these two elf files created by S32DS or by different IDE?

If you have multicore project created by S32DS, you can simply use LaunchGroup option to load and debug.

pastedImage_1.png

If you want to load and debug elf files which does not come from S32DS, please see article below and use point 3. Instead of single core project, create multicore project and use it's debug configuration (LaunchGroup configuration).

HOWTO: download separate elf/srec file to microcontroller using S32 Design Studio 

I suppose these two elf files are files for different cores and I suppose you have correctly created linker files.

Also this is not elf file, but Srecord file. elf file is binary file which cannot be correctly interpreted by text editor.

elf1:

S319011CF0000000000201002FB00000000001002E16006600004C
S315011CF01401002FB80000000001002DB0006600009D

In case my advice does not help you, could you please write me back more details about microcontroller, files you try to load and eventually post here the whole project or at least the files you try to load into the microcontroller.

Regards,

Martin

0 Kudos

988 Views
kfirbs
Contributor III

Hi Martin,

Thanks for the detailed response.

These are two elf files for the same core downloaded to DEVKIT-MPC5748G via S32.

I have dumped the elf files to S record in order to show my memory problem.

Both elf files affect 0x011CF000, with different data, and I want the second elf to overwrite the first, other data from the second elf does not overlap the first.

As mentioned in my original post above:

map file from both elf's with relevant section:

elf1:

*(.modulelist)
.modulelist 0x011cf004 0x20 ./src/ar.o
0x011cf004 module_list

elf2:

*(.modulelist)
.modulelist 0x011cf004 0x20 ./src/ar.o
0x011cf004 module_list

srecord data from relevant address:

elf1:

S319011CF0000000000201002FB00000000001002E16006600004C
S315011CF01401002FB80000000001002DB0006600009D

elf2:

S319011CF000000000020100836C0000000001008092006600006E
S315011CF01401008374000000000100802C00660000BE

Both elfs are for the same core, does that matter?

0 Kudos