Question about function of "AT91F_LowLevelInit()"

Guest #1171404
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.
OP #1171405
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

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.