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

Where is __main?

We use Keil tools to generate C++ embedded application that run in our embedded controller.

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 ?

Parents
  • return 0 should never execute. We should never get to return 0 statement.
    I assume you want to say that the code should never exit main(). True.
    But when using RTOS, main() is terminated.
    And, "return" in main() is not good for embedded designs.

    Coming back to the topic
    what is your startup code?
    possibly post your code.
    And use Tips for Posting Messages

Reply
  • return 0 should never execute. We should never get to return 0 statement.
    I assume you want to say that the code should never exit main(). True.
    But when using RTOS, main() is terminated.
    And, "return" in main() is not good for embedded designs.

    Coming back to the topic
    what is your startup code?
    possibly post your code.
    And use Tips for Posting Messages

Children