Big endian on Kinetis

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

Big endian on Kinetis

1,717 Views
EduardB_
Contributor I

Hi,

 

I'm using Kinetis (K10) with MQX (3.8) for my Project. 

 

Is it possible to switch to big endian (I'm porting a large portion of code written for a big endian processor)?

 

If it is possible, how can I do this?

 

I found this macro in PSP

 

 

 

/* Indicate which endian this PSP is */

#if

defined(__ARM__) || defined(__GHS__)

 

#ifdef__BIG_ENDIAN

 

#definePSP_ENDIAN MQX_BIG_ENDIAN

 

#else#definePSP_ENDIAN MQX_LITTLE_ENDIAN

 

#endif

#elif

defined(__MET__)

 

#ifdef_BE

 

#definePSP_ENDIAN MQX_BIG_ENDIAN

 

#else#definePSP_ENDIAN MQX_LITTLE_ENDIAN

 

#endif

#elif

defined(__GNUC__)

 

#ifdefBYTES_BIG_ENDIAN

 

#definePSP_ENDIAN MQX_BIG_ENDIAN

 

#else#definePSP_ENDIAN MQX_LITTLE_ENDIAN

 

#endif

#else

#define PSP_ENDIAN MQX_LITTLE_ENDIAN

#endif

 

 

The bold define is defined!

 

 

Thx

 

Eddie

0 Kudos
2 Replies

448 Views
timias
Contributor IV

I was told with my Kinetis processor ( K60) it was not supported in the compiler Codewarrior 10.2 yet, and wasn't scheduled to be done anytime soon.

 

FYI I am currently fighting a problem with CW where to Srec generated for my firmware has inconsistant endianess. Where the vector table is being output in BIG, but the code is coming out in Little. If I find out info about this problem I will post.

 

 

0 Kudos

448 Views
ignisuti
Contributor IV

Just curious if you guys have an update on this. I have a K10 MCU that I'd like to make Big-Endian.

 

I'm trying this line of code, but doesn't seem to be working for me.

SCB_AIRCR = SCB_AIRCR_VECTKEY(0x5FA)| SCB_AIRCR_ENDIANNESS_MASK;

0 Kudos