Where is __main?

We use Keil tools to generate C++ embedded application that run in our embedded controller. Our target is ARM 7 based.

My initialization code jumps to __main as follows:

IMPORT __main LDR R0, =__main BX R0

Wher is "__main" ?

I searched C:\Keil but could not find definition of __main.

This is what my map file says about __main

__main 0x00008308 ARM Code 8 __main.o(!!!main)

My application starts at 0x8000. __main is at 0x00008308. Where is __main.o ?

--------------------------------------- Posted through

formatting link

Reply to
Loading thread data ...

It is the default start symbol, and the entry to their C run time libraries. It is library code that will configure the run time environment (scatter loading, etc. in ARM's case), then call main().

If you want to change the start symbol then use the --startup= compiler option (it is in the manual).

Regards, Richard.

  • formatting link
    Designed for microcontrollers. More than 103000 downloads in 2012.

  • formatting link
    Trace, safety certification, FAT FS, TCP/IP, training, and more...

Reply to
FreeRTOS info

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.