EmbDev.net

Forum: ARM programming with GCC/GNU tools Some basic questions (coming from WinAVR)


Author: phil (Guest)
Posted on:

Rate this post
0 useful
not useful
First, thank-you Martin Thomas for putting together this great
collection of tools for the ARM.  Thanks to your examples I quickly had
an LED blinking on my hardware.

I've done quite a bit of embedded programming but I'm not very familiar
with the GCC compilation process.  I've been using WinAVR for a while
now and so most of my questions are about the differences between WinAVR
and WinARM.  From my understanding, when you start a new WinARM project
you need to provide a startup file (crt0.S) and a linker script (such as
LPC2106-ROM.ld), in addition to the makefile, source, and header files.

How do the startup file and linker script differ from processor to
processor or from project to project?

In particular, I want to create a project using the LPC2103.  Can I just
copy the LPC2106-ROM.ld script and change the memory sizes to match the
LPC2103 or is there more involved?

Do I need to make any changes to the crt0.S file to make it work for
this new processor?  Do I need to make changes to this file to use
various interrupts?

Thanks for the help,
Phil

Author: Martin Thomas (Guest)
Posted on:

Rate this post
0 useful
not useful
phil wrote:

> First, thank-you Martin Thomas for putting together this great
> collection of tools for the ARM.  Thanks to your examples I quickly had
> an LED blinking on my hardware.

I'm glad that the collection is useful for you.

> I've done quite a bit of embedded programming but I'm not very familiar
> with the GCC compilation process.  I've been using WinAVR for a while
> now and so most of my questions are about the differences between WinAVR
> and WinARM.  From my understanding, when you start a new WinARM project
> you need to provide a startup file (crt0.S) and a linker script (such as
> LPC2106-ROM.ld), in addition to the makefile, source, and header files.
>
> How do the startup file and linker script differ from processor to
> processor or from project to project?

Usualy they just differ from processor/target to target. Sometimes I
have modified startup and linker-skripts for special tasks but for the
beginning it should be ok to copy the files from the examples.

> In particular, I want to create a project using the LPC2103.  Can I just
> copy the LPC2106-ROM.ld script and change the memory sizes to match the
> LPC2103 or is there more involved?

I do not own a LPC2103, adapting the memory-sizes might be enough but
I'm not sure.

> Do I need to make any changes to the crt0.S file to make it work for
> this new processor?  Do I need to make changes to this file to use
> various interrupts?

I don't think that you need to change the startup-code in terms for
interrupt-handling, but you will see different approaches. Some
developers use "interrupt wrappers" to call ISR others use macros inside
ISRs. I currently don't remember of a "wrapper"-example for LPC is in
the examples-directory. But there is one for AT91SAM7S which can be used
too. The basic ARM7-interupt handling is the same for LPC and AT91SAM.

Just pick a small LPC-"blink"-example, change the memory-sections and
give it a try. Describe the errors if it does not work.

Hope this helps,
Martin Thomas

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.