This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How does VFP model omit startup code?

I noticed most bare-metal examples included with DS-5 that rely on a FVP also include startup code (e.g. startup.s).  However, there's one bare-metal example (Calendar program for Cortex-A8-FVP) that only includes code for the main program.  How is model startup handled in this case?  Can all FVP models be run in this manner or is it something specific to the Cortex-A8-FVP?

In the debug configuration settings I don't see any noticeable differences between the examples outside of a different FVP model being used.  I was half expecting some sort of "use default startup sequence" check-box, but didn't find it.

Thanks for any help!

Parents
  • Thanks Stephen.

    Very well answered!  I went back to the examples and I see now how "__main" plays it's role.  In particular (coming from a more GNU background) I overlooked the scatter file which I realize now is like the linker script.

    In the full reference examples, I assume this scatter file helps defines what happens after __main calls __scatterload.  In the simple calendar example, __scatterload must setup a default C run-time environment defined by the compiler.

Reply
  • Thanks Stephen.

    Very well answered!  I went back to the examples and I see now how "__main" plays it's role.  In particular (coming from a more GNU background) I overlooked the scatter file which I realize now is like the linker script.

    In the full reference examples, I assume this scatter file helps defines what happens after __main calls __scatterload.  In the simple calendar example, __scatterload must setup a default C run-time environment defined by the compiler.

Children
  • Yes, that's right.  The scatter file tells the linker how/where the code/data should be placed in the memory map by __scatterload.  The simple calendar example has no scatter file so a default layout is used.  The default layout is program code (.text) first starting at --ro-base, followed by RW data (.data), followed by ZI data (.bss).  The armlink User Guide gives more information - see section 3.6.