EmbDev.net

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


Author: Min Ge (minge519)
Posted on:

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:

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 Ge (minge519)
Posted on:

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

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.