S32K144 - switch to big-endian?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K144 - switch to big-endian?

ソリューションへジャンプ
3,043件の閲覧回数
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,933件の閲覧回数
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,934件の閲覧回数
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,933件の閲覧回数
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,933件の閲覧回数
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 件の賞賛