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.

arm-none-eabi-gcc msp432 - things that bork you (add your favorites)

ISSUE #001:
in msp_compatibility.h __wfi is wrong .. replace with code below

#include <msp.h>
/*
 * replace __wfi define from msp_compatibility.h
 */
#ifdef __GNUC__
 #undef __wfi
 #define __wfi() asm("  wfi")
#endif

  • Hi Rick,

    To make sure I understand - this is something that needs to be updated in msp_compatibility.h to work correctly with GCC for MSP432?

    -Katie
  • Yes it is broken Katie.

    The define for __wfi() in msp_compatibility.h is:

    #define __wfi() __asm("    wfi\n" \
         "    bx      lr\n");
    

    So code that works with the TI arm compiler doesn't work with arm-none-eabi-gcc

    void main() {
      ...
      while(1) {
        __wfi(); // this will exit main with gcc because of the bx lr
        ... do some stuff
      }
    }
    

  • Hi Rick,

    I've reported this and someone is looking into it. Thanks so much for the feedback.

    -Katie
  • ISSUE #002:
    msp432_startup_ccs_gcc.c in CCS 6.1.0.00104 is missing code to copy the data segment initializers from flash to SRAM

    I was going to write this one up the other day.  However, I'm not the only one who had this problem and luckily I didn't have to report it. Chester Gillon describes the problem and its solution over in the CCS forum: e2e.ti.com/.../417197 Thanks Chester!

    I wanted to add my own twist to this. I use C++ so I also want the global constructors to run. I also probably want the FPU to be enabled before those get called. You can see the reset function I use here:

    gist.github.com/.../962a5bf22b43f93ab736

    -rick

  • Rick Kimball said:
    I use C++ so I also want the global constructors to run.

    It looks the same problem of the newlib _start() function not being called occurs in the Tiva *_startup_ccs_gcc.c files as well as the msp432_startup_ccs_gcc.c

    I am trying to work out if there is a reason why the *_startup_ccs_gcc.c files call main() directly, rather than the newlib _start() function, or if this is an omission.

**Attention** This is a public forum