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.

MSP430GCC startup nostdlib

Hi!

I am porting a software made for another platform, to the MSP430, and I would like to use MSP430 GCC.

Every code file is compiled well but the linker  throws an error regarding that the RAM is overrunned (something about collect2 routine)

I tried -nostdlib option in the linker, and all the software compiles. Of course, it doesn't run because the nostdlib option  do not add the reset_vector routine and all the initializations procedures.

I do not know what to do. I started to write my own reset_vector function but I tought that probably is a way of doing this correctly (I mean, that the reset vector routine is compiled automatically).


thanks in advance.

  • Thank you very much for keeping the actual error message a secret.

    The -nostdlib option indicates that you do not want the standard library. In this case, this is not actually true.

    There are several ways to reduce your application's size:

    • optimize for size (-Os);
    • enable link-time optimization (-flto) (this requires all interrupt handler functions to be marked with __attribute__((used)); TI forgot this in the __interrupt macro);
    • use a reduced run-time library (-minrt) (if you don't have static initializer functions or constructors);
    • change your software.

  • Shame on me, I found the answer looking into the map file. The bss was too long, because there was a module that allocated 10k of ram for an array (this SW I'm porting originally was running on a Cortex M4, so RAM wasn't a limitation).
    Thanks for your support!

**Attention** This is a public forum