ELF file format generated by S32 Design Studio

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ELF file format generated by S32 Design Studio

跳至解决方案
2,742 次查看
ZhouYiChuan
Contributor III

Hello NXP experts:

I've implemented a ELF file parser for MPC5642 ELF file generated by S32 DS. 

the TIS (Tool Interface Standard) ELF spec V1.2 is my reference. 

But my issue is:

For a struct type global variable or an array, only the start address can be parsed out from the ELF symbol section .  The address of its member is not found in symbol section. 

for example below is a struct:

typedef struct Ccp_Type
{
uint8_t Cro[8];/*command request object*/
uint8_t Crm[8]; /* CRM Command Return Message buffer */

boolean HasNewCro;
boolean IsInitialized;

uint8_t Ccp_Session_SM;

uint8_t SendStatus;

uint32_t MTA[CCP_MAX_MTA]; /* Memory Transfer Address */

}Ccp_Type;

the global variable is defined as:Ccp_Type ccp;

I can't get the address of its member e.g. ccp.Session_SM

Only address of the struct type global variable can be parsed out. 

Could you please provide a document to explain ELF format generated by S32 Design Studio?

Or some hint about how to find the member's address?

Vector tool ASAP2 editor can parse out the struct type variable member address like below:

Asap_snapshot.PNG

PS: 

the map file , elf file and ELF spec are attached.

thanks and BR

YiChuan

0 项奖励
回复
1 解答
2,734 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

by quick check with GNU readelf/objdump it looks, that the Ccp_Type structure is not used in your code. 

 

S32DS Uses GNU GCC - powerpc-eabivle-4_9 - the .elf output is standard elf gcc output for PowerPC. 

 

 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,642 次查看
Fiona_2022
Contributor I

Hello YiChuan,

 l have  a quetion that l can‘t update A2L file through ELF file,I hope you can give me some advices.

1.The Current toolchain is Standard S32DS toolchain for E200 

2. MCU is MPC5746.

3.I through S32DS software generates ELF file, Artifact type : E200 executable.

4. I should choice whice format of  MAP type?

Fiona_2022_0-1644464440593.png

5. I choose "ELF/ DWAFT 32 Bit " , that is invalid.

Fiona_2022_1-1644464549451.png

Looking forward to your reply!!

0 项奖励
回复
2,612 次查看
ZhouYiChuan
Contributor III

hello, 

maybe you should select *.elf file, not *.map file in ASAP2 editor. 

the *.map file is a text type file, it can be read by human, but not acceptable for ASAP2 editor.

Meanwhile *.elf is BIN type file. 

hopefully the suggestion can help you. 

thanks and BR

Yichuan

0 项奖励
回复
2,735 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

by quick check with GNU readelf/objdump it looks, that the Ccp_Type structure is not used in your code. 

 

S32DS Uses GNU GCC - powerpc-eabivle-4_9 - the .elf output is standard elf gcc output for PowerPC. 

 

 

0 项奖励
回复