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.

Using GCC with code composer studio

Hello!

I'm trying to use GCC with CCS (MSP432). The target board is the MSP432 launchpad.
I program in C++. It compiles fine with TI's compiler, it doesn't with GCC.
The error I get is:
undefined reference to `operator delete(void*)'

Is there a quick fix for that kind of problem?

Thanks,

Pascal

  • Pascal4275 said:
    The error I get is:
    undefined reference to `operator delete(void*)'

    For GCC the operator delete(void*) is supplied from the stdc++ library which needs to be included in the list of libraries for the project:

  • Hello!
    Thanks for your reply! I couldn't add a library because even by browsing, there are myriads of possible libs and I don't
    know which one it is, but I found a workaround. In case somebody faces the same problem:
    - Create a new project (file -> new ccs project).
    - In the project configuration panel, there is an "advanced settings" menu (click the triangle)
    Choose libstdc++ in the runtime support library menu (triangle on the right).
    - Of course, set project name, processor type, etc...

    That's it, you can now compile C++.

    I'm facing other problems:
    - When commenting out some lines in my main program, the flash programming size does not decrease significantly.
    It looks everything is loaded even if not used.
    - My project compiles fine. When trying to run it, it simply doesn't start. There is a randomly fast blinking line in the debug
    window. It says "Running A reset occured on the target". It just blinks and apparently constantly resets, but never starts
    the debug process.

    Any hint welcome.

    Pascal
  • Pascal4275 said:
    It just blinks and apparently constantly resets, but never starts
    the debug process.

    That probably means the watchdog is firing.

    [For a MSP432 driverlib example using the TI ARM compiler, I found that the start-up code was disabling the watchdog as the first step Need to check if the example MSP432 projects using the MSP432 compiler also disable the watchdog.]

  • Hello!
    How is it possible? The first thing is disabling the watchdog as in any MSPxxx program.
    Pascal
  • Pascal4275 said:
    How is it possible? The first thing is disabling the watchdog as in any MSPxxx program.

    Agree that the examples disable the watchdog at the start of main().

    The issue is that watchdog is enabled at device reset, and if the C/C++ run time library start-up code doesn't disable the watchdog a watchdog reset may occur before main() is reached which results in a continuous reset of the device.

    E.g. I had a C++ example for a MSP432 which has ~54000 bytes of initialized data. When a new CCS 6.1.3 project was created using the TI ARM compiler the combination of the startup_msp432p401r_ccs.c and system_msp432p401r.c source files added by CCS disable the watchdog before calling the C run time library start-up code and the program works.

    When a new CCS 6.1.3 project was created using the GCC compiler, and the main.cpp file ported from the TI compiler project I got the same symptoms as you in that "It just blinks and apparently constantly resets". Looking at the combination of the startup_msp432p401r_gcc.c and system_msp432p401r.c source files added by CCS the watchdog is only disabled after the .bss (uninitialized) and .data (initialized) segments have been initialized. Am investigating what the fix is.

**Attention** This is a public forum