EmbDev.net

Forum: ARM programming with GCC/GNU tools Question about function of "AT91F_LowLevelInit()"


von Min G. (minge519)


Rate this post
useful
not useful
hI EVERYONE,

There is a funciton of "AT91F_LowLevelInit()" in Cstartup_SAM7.c.
Do I have to call this function in the beginning of my main() function?

I tried the two condition and can not tell the difference.

Min Ge

von Martin Thomas (Guest)


Rate this post
useful
not useful
Min Ge wrote:
> There is a funciton of "AT91F_LowLevelInit()" in Cstartup_SAM7.c.
> Do I have to call this function in the beginning of my main() function?
>
> I tried the two condition and can not tell the difference.

The function is used in the "Atmel-scheme" for startup-code. Atmel has
choosen a method to separate the startup in an assembler-part and a
C-part. This is rather convinient since as much as possible can be done
in C (the "Keil-Method" is to implement the startup in Assembler).
Additional the AT91-lib functions can be used. IRC the c-code sets up
the watchdog, system-clock and parts of the AIC so it is prefered to
call the function as early as possible.

If you'd like to follow the Atmel-Method look into the assembler-Code of
the examples which include a Cstartup.c. You will see at which stage the
function is called. For own developments: remind that a temporary stack
is set up before calling the c-Function, just use the examples as
templates.

Martin Thomas.

von Min G. (minge519)


Rate this post
useful
not useful
Martin Thomas wrote:
> Min Ge wrote:
>> There is a funciton of "AT91F_LowLevelInit()" in Cstartup_SAM7.c.
>> Do I have to call this function in the beginning of my main() function?
>>
>> I tried the two condition and can not tell the difference.
>
> The function is used in the "Atmel-scheme" for startup-code. Atmel has
> choosen a method to separate the startup in an assembler-part and a
> C-part. This is rather convinient since as much as possible can be done
> in C (the "Keil-Method" is to implement the startup in Assembler).
> Additional the AT91-lib functions can be used. IRC the c-code sets up
> the watchdog, system-clock and parts of the AIC so it is prefered to
> call the function as early as possible.
>
> If you'd like to follow the Atmel-Method look into the assembler-Code of
> the examples which include a Cstartup.c. You will see at which stage the
> function is called. For own developments: remind that a temporary stack
> is set up before calling the c-Function, just use the examples as
> templates.
>
> Martin Thomas.


Thanks a lot. I got it.

Min Ge

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.