This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS570LC4357: [TMS570LC43x] Why Ti safety library defines this MCU as little endian system?.

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

hello

in order to develop spi devices, i have been worked for spi implement. 

and i can find a bug(maybe) at HL_sys_common.h (demo_app\HALCoGen\TMS570LC4357_NoOS\include)

Ti reference manual for TMS570LC43 indicate this system have BE32(big endian). but, little endian is defined at HL_sys_common.h. and mibspi rambase struct include member variable in little endian method.

Could you please check this?

thanks

  • Hello,

    Those header files are used for both little endian and big endian devices. The device's endianness is selected in CCS project property. If BE32 is selected, the CCS will use big endian format to compile the code, and undef __little_endian__. By default, the big endian format is used.

    HL_sys_common.h:


    #ifndef __little_endian__
    #define __little_endian__  1
    #endif
    #ifndef __LITTLE_ENDIAN__
    #define __LITTLE_ENDIAN__  1
    #endif

    HI_reg_mibspi.h:

    typedef volatile struct mibspiRamBase
    {
        struct
        {
    #if ((__little_endian__ == 1) || (__LITTLE_ENDIAN__ == 1))
         uint16  data;     /**< tx buffer data    */  
         uint16  control;  /**< tx buffer control */ 
    #else
         uint16  control;  /**< tx buffer control */
         uint16  data;     /**< tx buffer data    */
    #endif

  • thanks for your faithful reply :)