Hi Brendon,
you're right, if you use the GCC setup, then the startup files are realized in C code in the framework.
IAR and Keil tools normally use an assembler file, just another thing which is just a philosophy. Technically both options are there, one tool simply uses it this way, the other one the other way.
The entry point is always the reset handler. If you able to localize it, then you have the piece of code which gets located at the address the linker puts it to.
The beginning of an image for the ARM Cortex-M is always the same:
- 4 bytes for address vector to stack pointer start
- 4 bytes for address vector to reset handler start
- 14 words with ARM exception vector addresses
- platform dependent number of IRQ vector addresses
So when you look into the final binary, the second word tells you where the linker placed the reset handler. Normally the linker gets all the freedom to place it wherever it wants to, except if you hard-code it.
Anyway, in the GCC world the startup file is normally called cr_startup_xxxx.c, in there you might find "ResetISR" and that's the reset handler (in principle just another naming convention, could be different).
The way it is set up there, decides how it could work with the SDRAM.
- If you want to relocate the whole code to the SDRAM before you start with execution, you need to initialize the SDRAM at first.
- If you work on the basic init and the board bring up from internal SRAM or from Flash, then you can do the SDRAM init later and you relocate then all other objects to SDRAM starting with the object where main() is located.
Maybe this helps a little bit.
Regards,
Bernhard.