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

 Author: Min G. (minge519) Posted on: 2006-06-22 21:52

Rate this post
 0 ▲ 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

 Author: Martin Thomas (Guest) Posted on: 2006-06-23 15:02

Rate this post
 0 ▲ 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.

 Author: Min G. (minge519) Posted on: 2006-06-23 15:39

Rate this post
 0 ▲ 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

• $formula (LaTeX syntax)$