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

call c-function in startup-file

Hi,

is it possible to call a c-function during the initalization of the startup-file? Could you give me one simple example?

; Reset Handler

                EXPORT  Reset_Handler
Reset_Handler


; open lowlevelinit c-function
; IMPORT LowLevelInit

; Setup Power Management Controller (PMC) --------------------------------------

                IF      :DEF:NO_PMC_INIT
                ELSE
                IF      PMC_SETUP != 0

                LDR     R0, =PMC_BASE

Do you know any important things writing this init-function? How do the startup-file know the place / the c-file , where the function is declared?

best regards
Alan

Parents
  • because I've problems with the startup-code provided by keil. If I use this LowLevelInit function at the beginning of the main function, the processor is running and the pll etc. is working. If I use the pll init and osciallator init the processor is not running properly - but I don't know why.

    I also test to call my function LowLevelInit() at the end of the startup file (just befor the mode section) -> but I also have not the ability to start the processor properly.

    I don't know what is going wrong, using the original startup code....

    best regards
    Scott

Reply
  • because I've problems with the startup-code provided by keil. If I use this LowLevelInit function at the beginning of the main function, the processor is running and the pll etc. is working. If I use the pll init and osciallator init the processor is not running properly - but I don't know why.

    I also test to call my function LowLevelInit() at the end of the startup file (just befor the mode section) -> but I also have not the ability to start the processor properly.

    I don't know what is going wrong, using the original startup code....

    best regards
    Scott

Children