__main in startup assembly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-06-04 1:30 AM
Hi.
I'm using keil for programming a stm32 board. In the start up file .s there is a call to __main after the call to SystemInit. Where is the definition of __main? What's the difference between main and __main?Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-06-04 1:37 AM
Hi
IMPORT __main�?
This line refers to the __main in the C library which eventually calls the main() function defined elsewhere in your project.
-Nesrine-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-06-04 1:37 AM
Hi
IMPORT __main�?
This line refers to the __main in the C library which eventually calls the main() function defined elsewhere in your project.
-Nesrine-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-06-04 1:40 AM
Hello,
main is your main procedure form main.c file, once __main is an internal procedure created by Keil toolchain which is calling at the end your main, but before it is initializing all variables (copying variables from FLASH to proper positions in RAM). In gcc it is seen explicitly, in Keil you can see it within debug process.
Best Regards,
Artur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-06-04 2:47 AM
Thank you
