allthingsembedded / allthingsembedded.github.io

AllThingsEmbedded blog sources
https://allthingsembedded.com
0 stars 0 forks source link

post/2019-01-03-arm-cortex-m-startup-code-for-c-and-c/ #7

Open utterances-bot opened 5 months ago

utterances-bot commented 5 months ago

ARM Cortex-M Startup code (for C and C++) - AllThingsEmbedded

When developing bare metal applications it is required to supply some functions that we normally take for granted when developing code for mainstream OS’s. Setting the startup code is not inherently difficult but beware: some of the nastiest bugs you will ever see on bare metal can come from the startup code. What is actually needed to start the execution of the main function? Well, there are a few things that the C and C++ language specifications assume when starting a new program.

https://allthingsembedded.com/post/2019-01-03-arm-cortex-m-startup-code-for-c-and-c/

g40 commented 5 months ago

Hello Javier, a useful post, thank you. It would be very helpful to also have a matching linker script? Not sure if this stuff is on Github?

Javier-varez commented 5 months ago

Hi @g40, I have used this startup code as a base for multiple projects. You could have a look at this project, that implements an uclinux boot loader for STM32. In particular: