2

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??

wovano
  • 4,543
  • 5
  • 22
  • 49
KansaiRobot
  • 7,564
  • 11
  • 71
  • 150
  • 3
    It's the program entry point, usually in `cstartup.s`. I suggest that you read the IAR manual**s** (both for ide and the compiler). – user694733 Oct 20 '16 at 07:12

2 Answers2

3

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.

theUtherSide
  • 3,338
  • 4
  • 36
  • 35
Eyal B
  • 31
  • 2
0

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
mryldz
  • 95
  • 2
  • 9