#91 stm32f4xx sections.ld errors

Next release

GNU ARM C/C++ Cross Compiler Support
GNU ARM C/C++ STM32Fx Project Templates

sections.ld:39: undefined symbol `_Main_Stack_Size' referenced in expression

it is `__Main_Stack_Size'
strange that in std perif project we do not see it.
Maybe _heap is not needed so expression expression at line 39 is not evaluated

I find it after copying and using the the files to an empty project


  • Liviu Ionescu (ilg)

    • status: open --> open-accepted
  • Liviu Ionescu (ilg)

    oops! where do you think the problem is, the definition should have only one underscore or the reference should have two?

  • diabolo38

    diabolo38 - 2014-02-26

    don't know exactly why one or two _ ?
    I did change to and it build so is the symbol crt0.s/lib was needing

    Even with that empty project is not 100% functional, starting from scratch require too many things vector etc ... though

    Starting from std-perif project and removing all unused things would be much simpler :D

    All these is chips specific so i understand plugin cannot support all,

  • Liviu Ionescu (ilg)

    I'm afraid I'm not able to follow you, sometimes your messages do not provide all required details to identify the problem, and sometimes the phrasing is quite cryptic.

    in this case you mention the STM32Fx plug-in, but do not mention what template and exactly the configuration used (what wizard options you used), so I can not reproduce the problem.

  • Liviu Ionescu (ilg)

    starting from scratch require too many things

    that's the point of the templates, to provide a functional starting point.

  • diabolo38

    diabolo38 - 2014-02-26

    oops sorry

    it's sections.ld of the stm32f4xx std perif template
    you will not see it until you use the ld file inside an empty project.

    I created std perif project for stm32f4xx
    then created a new empty (hello world) cross arm project
    copied/paste the ld from stm32f4xx std perif into that project.
    Added the 3 ld files to linker file options and the error appeared.

    is it clearer said that way ?
    So up to you to correct it does prevent the basic stm32f4xx to work.

    I'm basically trying to setup a "raw STM32F4XX template" project (use as base for many over)
    Add do it standard peripheral if i need but as a lib (linked resource or project dependency) that i will not recompile each time (also lib can be compiled at higher opt level ad w/o debug info)
    Enable semi-hosting or not without changes (build configuration change, file include/Exclude from build )
    Also it must not crach when hosting is not active ;)

    maybe explain all my request
    next one will be "debug attaching to a running target" ;)

  • Liviu Ionescu (ilg)

    ah, you are messing files from one template to another. no, this currently was not tested, and probably doesn't work. the hello world template is very old and used different configuration files; I probably need to update it too.

  • diabolo38

    diabolo38 - 2014-02-27

    "hello world" is empty project + hello world source
    it doesn't include any ld file nor startup (if any needed)
    user must bring these few files before it could work
    for stm32f4xx it's the ld file +content of cmsis

  • Liviu Ionescu (ilg)

    sorry, I have difficulties to follow you.

    please take a look at how a bug report should look like and rephrase accordingly:


    otherwise I regret, but I cannot be of much help.

  • Liviu Ionescu (ilg)

    • status: open-accepted --> closed-fixed
  • Liviu Ionescu (ilg)

    fixed in 2.2.1-201404120702

    all templates use the same ldscripts and startup code


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks