S32K144 - switch to big-endian?

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

S32K144 - switch to big-endian?

跳至解决方案
3,039 次查看
Novalis
Contributor III

Hello,
is it possible to switch to big-endian in S32DS for S32K144? I am porting some project from Coldfire V1 and there are so many structures used in communication, which  assume big-endiannes ...

I tried  -mbig-endian in compiler options, but I got   "compiled for a big endian system and target is little endian"  error :smileysad:

Is it even possible to switch to big-endian?

Thanks,

Martin

标签 (1)
标记 (3)
0 项奖励
1 解答
2,929 次查看
alexanderfedoto
NXP Employee
NXP Employee

Seems like "compiled for a big endian system and target is little endian"  error is the linker error since libraries are Little Endian. NXP GCC contains only LE prebuilt libraries.

在原帖中查看解决方案

0 项奖励
3 回复数
2,930 次查看
alexanderfedoto
NXP Employee
NXP Employee

Seems like "compiled for a big endian system and target is little endian"  error is the linker error since libraries are Little Endian. NXP GCC contains only LE prebuilt libraries.

0 项奖励
2,929 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

as far as I know, there is no such gcc parameter or __attribute__. Normally is such situation handled by some "endian_swap" function in receive/transmit.  

Jiri

0 项奖励
2,929 次查看
Novalis
Contributor III

I just did "send(uin8t_ *ptr_to_struct, uint16_t len)" before, now I would need to make copy of the struct, do the swapping and then send it, that would be so much rewriting for all the structures, so I thought that it would may be possible to switch S32K144 (to big-endian mode somehow (may be SETEND instruction, but it seems that it doesn't exist in Cortex-M series anymore - see ARM Cortex-M - Wikipedia  ).

0 项奖励