2
votes

In the code for a STM8 application there is a line

extern void __iar_program_start(void);

now I've searched and this function is nowhere to be found. What is this and where is located??

Thanks

2
It's the program entry point, usually in cstartup.s. I suggest that you read the IAR manuals (both for ide and the compiler). - user694733

2 Answers

2
votes

Found it in a module called cstartup_M.o inside a library which is part of the IAR tool installation.

In my case, the library is called rt7M_tl.a, but it probably depends on your target CPU.

0
votes

These function may generate for C version of code, cause this type of instruction you can find in assembly.

__iar_program_start:
        LDW     X, #CSTACK$$Limit-1     ; Set stackpointer
        LDW     SP, X