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

Startup code

Hello All:

How can I reference the start address of the startup code in start167.a66 in a C file? The only thing I can think of doing is

extern void C_STARTUP(void);
but that does not seem to work. As a work around I am pointing to the reset vector address which jumps to the startup code but I like to call it directly if possible.

Thanks,
Walt

Parents
  • Seems likes I've found the way. In your startup.a66 find the following:

    ?C_RESET        PROC TASK C_STARTUP INTNO RESET = 0
    ?C_STARTUP:     LABEL   Model
    
    ...
    
    ?C_RESET        ENDP
    ?C_STARTUP_CODE ENDS
    
    and change it to:
    C_RESET        PROC TASK C_STARTUP INTNO RESET = 0
    PUBLIC C_RESET
    ?C_STARTUP:     LABEL   Model
    
    ...
    
    C_RESET        ENDP
    ?C_STARTUP_CODE ENDS
    
    Now in your C modules you can use the declaration:
    extern void C_RESET(void);
    
    There is an application note on similar subject, but it wasn't of much help here:
    http://www.keil.com/appnotes/docs/apnt_142.asp

    Regards,
    - Mike

Reply
  • Seems likes I've found the way. In your startup.a66 find the following:

    ?C_RESET        PROC TASK C_STARTUP INTNO RESET = 0
    ?C_STARTUP:     LABEL   Model
    
    ...
    
    ?C_RESET        ENDP
    ?C_STARTUP_CODE ENDS
    
    and change it to:
    C_RESET        PROC TASK C_STARTUP INTNO RESET = 0
    PUBLIC C_RESET
    ?C_STARTUP:     LABEL   Model
    
    ...
    
    C_RESET        ENDP
    ?C_STARTUP_CODE ENDS
    
    Now in your C modules you can use the declaration:
    extern void C_RESET(void);
    
    There is an application note on similar subject, but it wasn't of much help here:
    http://www.keil.com/appnotes/docs/apnt_142.asp

    Regards,
    - Mike

Children