S32K144 - switch to big-endian?

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

S32K144 - switch to big-endian?

Jump to solution
3,964 Views
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

Labels (1)
Tags (3)
0 Kudos
Reply
1 Solution
3,854 Views
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.

View solution in original post

0 Kudos
Reply
3 Replies
3,855 Views
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 Kudos
Reply
3,854 Views
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 Kudos
Reply
3,854 Views
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 Kudos
Reply