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.

main() not called when code size exceeds a certain value?

Other Parts Discussed in Thread: MSP430F5436A

I have a project using an msp430f5436a.  As best I can tell, the main() function stops being called (or perhaps hangs immediately) once the total code size exceeds around 32k.

Our codebase does a lot of stuff, but right now I have it set so that the very first thing in main() is to set a GPIO, which lights a LED.  When I'm seeing the problem, the LED doesn't light--it seems that main() isn't even being called.

There are two big chunks of code I can comment out, and if I do so to either one, the chip works again.  Each piece of code works fine on its own.  It's only when both pieces are enabled do I seem to exceed this magic threshold and have problems.

We're using the large model for both code and data, in case it matters.

Any ideas as to what's going on?  I can provide .map/.hex/.out files if necessary.  Thanks!

  • I switched the application binary interface from eabi too coffabi and it works now.  Anybody know why one would work and not the other?  I worry a bit that I'm just hiding the fundamental problem.

  • Scott Cutler said:
    I switched the application binary interface from eabi too coffabi and it works now.  Anybody know why one would work and not the other?  I worry a bit that I'm just hiding the fundamental problem.

    With EABI the run time start-up code sets uninitialized variables in the .bss segment to zero. Whereas with COFFABI the .bss segment is not zeroed by the start-up code.

    The length of time taken to zero the .bss segment when using EABI can cause the watchdog to fire during start-up, so that the application main is never reached. See WDT fires during C startup code for how you can disable the watchdog during the start-up code.

**Attention** This is a public forum