EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

EABI vs. ... how to get on with learning AT91SAM7 (newbie difficult beginnings)?

Started by "Jesper K. Pedersen" May 23, 2010
I am brand new in working with the AT91SAM7 microcontroller and find
the beginning very difficult.

My basis for learning the AT91SAM7S256 is as follows :

Developement board is Olimex SAM7P256
Programming done by using the Samba boot manager
(USB serial programming - verified working with Sam_I-Am)

Software developement on Linux/Debian 5.04

My goal is to be able to run my own software without the need of an
operating system running on the microcontroller. Also I would like to be
able to run software based on FreeRTOS.

I started with Linux on Slackware 0.97 as a regular user and have been
using it ever since.
I have worked with the Motorola 68HC908JB8 microcontroller (though only
using the sdcc C compiler and assembly).

My experience with the AT91SAM7 series is that it feels immensely more
challenging to learn - especially when it is difficult to get even a
basic system up and running to allow you to compile and run a piece of
code.

What I would like to end up with is a decently new version of GCC
+ compilation tools and the commonly used libraries for it - newlib +
libgcc + libc .

I run into terms like EABI in connection with gcc - what are the
difference between a gcc compiled with EABI compared to compiled in elf
version.

I have tried using several tutorials - mainly the
http://hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source

This compiled version wont let me compile even the smallest example
programs like the ARMBlinkExample from
http://www.doctort.org/adam/nerd-notes/getting-started-with-the-olimex-sam7-p256.html
This fails with :

jkp@io:~/Microcontroller/SAM7P256/ARMBlinkExample$ make
arm-elf-gcc -I./ -c -fno-common -O0 -g -c blink.c
arm-elf-as -ahls -mapcs-32 -o crt.o ram-crt.s > crt.lst
arm-elf-ld -v -Map blink.map -Tram-ln.cmd -o blink.elf crt.o blink.o
GNU ld (GNU Binutils) 2.19.1
arm-elf-ld: error: no memory region specified for loadable section
`.text.1' make: *** [blink.elf] Error 1

Anyone have any advice of where to turn to get a basic developement
system up and running? (hopefully without having to spend alot of money
on a turn-key piece of software as this is for hobby use only)
Best regards
JesperKP

Hi Jesper,

I am developing stuff for AT91SAM7X256 which is very similar to
AT91SAM7S256 you are using. I also use Debian to do the development
and I find it really useful. One of the most difficult hurdles to jump
over was to have the toolset compiled and setup. Please downoad the
folder from:
http://bitbucket.org/a.turowski/freeecu/src/tip/tools/build_toolchain/

and run build-arm-toolchain-modified script. It will download the
source code for the whole toolchain and compile it in
/tmp/arm-toolchain folder. Then you should copy it somewhere and
adjust your system PATH to execute it.

NOTE:
You will need approx. 10GB of disk space during build process because
gcc/binutils/newlib/gdb sources are quite big. Also the build process
may take couple of hours depending on your PC performance.

Hope that helps,
Adam

Quoting "Jesper K. Pedersen" :

> I am brand new in working with the AT91SAM7 microcontroller and find
> the beginning very difficult.
>
> My basis for learning the AT91SAM7S256 is as follows :
>
> Developement board is Olimex SAM7P256
> Programming done by using the Samba boot manager
> (USB serial programming - verified working with Sam_I-Am)
>
> Software developement on Linux/Debian 5.04
>
> My goal is to be able to run my own software without the need of an
> operating system running on the microcontroller. Also I would like to be
> able to run software based on FreeRTOS.
>
> I started with Linux on Slackware 0.97 as a regular user and have been
> using it ever since.
> I have worked with the Motorola 68HC908JB8 microcontroller (though only
> using the sdcc C compiler and assembly).
>
> My experience with the AT91SAM7 series is that it feels immensely more
> challenging to learn - especially when it is difficult to get even a
> basic system up and running to allow you to compile and run a piece of
> code.
>
> What I would like to end up with is a decently new version of GCC
> + compilation tools and the commonly used libraries for it - newlib +
> libgcc + libc .
>
> I run into terms like EABI in connection with gcc - what are the
> difference between a gcc compiled with EABI compared to compiled in elf
> version.
>
> I have tried using several tutorials - mainly the
> http://hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source
>
> This compiled version wont let me compile even the smallest example
> programs like the ARMBlinkExample from
> http://www.doctort.org/adam/nerd-notes/getting-started-with-the-olimex-sam7-p256.html
> This fails with :
>
> jkp@io:~/Microcontroller/SAM7P256/ARMBlinkExample$ make
> arm-elf-gcc -I./ -c -fno-common -O0 -g -c blink.c
> arm-elf-as -ahls -mapcs-32 -o crt.o ram-crt.s > crt.lst
> arm-elf-ld -v -Map blink.map -Tram-ln.cmd -o blink.elf crt.o blink.o
> GNU ld (GNU Binutils) 2.19.1
> arm-elf-ld: error: no memory region specified for loadable section
> `.text.1' make: *** [blink.elf] Error 1
>
> Anyone have any advice of where to turn to get a basic developement
> system up and running? (hopefully without having to spend alot of money
> on a turn-key piece of software as this is for hobby use only)
> Best regards
> JesperKP

On Mon, 24 May 2010 13:36:47 +0200
a...@ikp.pl wrote:

> Hi Jesper,
>
> I am developing stuff for AT91SAM7X256 which is very similar to
> AT91SAM7S256 you are using. I also use Debian to do the development
> and I find it really useful. One of the most difficult hurdles to
> jump over was to have the toolset compiled and setup. Please downoad
> the folder from:
> http://bitbucket.org/a.turowski/freeecu/src/tip/tools/build_toolchain/
> and run build-arm-toolchain-modified script. It will download the
> source code for the whole toolchain and compile it in
> /tmp/arm-toolchain folder. Then you should copy it somewhere and
> adjust your system PATH to execute it.
>

It worked as a charm...
Only thing I ended up needing to change was the add a single part to
the linker options.

Apparently there is a bug with the linker which cause a missing .eh
section abort during linking.

This was quickly fixed by adding the following lines to the linker
options file (often called ram-ln.cmd)

/DISCARD/ :
{
*(.eh_*)
}

Now I can get started... (phew already have way too many projects
simmering for the microcontroller)

Thank's for the assistance Adam
JesperKP

>
> NOTE:
> You will need approx. 10GB of disk space during build process
> because gcc/binutils/newlib/gdb sources are quite big. Also the build
> process may take couple of hours depending on your PC performance.
>
> Hope that helps,
> Adam
>
> Quoting "Jesper K. Pedersen" :
>
> > I am brand new in working with the AT91SAM7 microcontroller and find
> > the beginning very difficult.
> >
> > My basis for learning the AT91SAM7S256 is as follows :
> >
> > Developement board is Olimex SAM7P256
> > Programming done by using the Samba boot manager
> > (USB serial programming - verified working with Sam_I-Am)
> >
> > Software developement on Linux/Debian 5.04
> >
> > My goal is to be able to run my own software without the need of an
> > operating system running on the microcontroller. Also I would like
> > to be able to run software based on FreeRTOS.
> >
> > I started with Linux on Slackware 0.97 as a regular user and have
> > been using it ever since.
> > I have worked with the Motorola 68HC908JB8 microcontroller (though
> > only using the sdcc C compiler and assembly).
> >
> > My experience with the AT91SAM7 series is that it feels immensely
> > more challenging to learn - especially when it is difficult to get
> > even a basic system up and running to allow you to compile and run
> > a piece of code.
> >
> > What I would like to end up with is a decently new version of GCC
> > + compilation tools and the commonly used libraries for it - newlib
> > + libgcc + libc .
> >
> > I run into terms like EABI in connection with gcc - what are the
> > difference between a gcc compiled with EABI compared to compiled in
> > elf version.
> >
> > I have tried using several tutorials - mainly the
> > http://hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source
> >
> > This compiled version wont let me compile even the smallest example
> > programs like the ARMBlinkExample from
> > http://www.doctort.org/adam/nerd-notes/getting-started-with-the-olimex-sam7-p256.html
> >
> >
> > This fails with :
> >
> > jkp@io:~/Microcontroller/SAM7P256/ARMBlinkExample$ make
> > arm-elf-gcc -I./ -c -fno-common -O0 -g -c blink.c
> > arm-elf-as -ahls -mapcs-32 -o crt.o ram-crt.s > crt.lst
> > arm-elf-ld -v -Map blink.map -Tram-ln.cmd -o blink.elf crt.o blink.o
> > GNU ld (GNU Binutils) 2.19.1
> > arm-elf-ld: error: no memory region specified for loadable section
> > `.text.1' make: *** [blink.elf] Error 1
> >
> > Anyone have any advice of where to turn to get a basic developement
> > system up and running? (hopefully without having to spend alot of
> > money on a turn-key piece of software as this is for hobby use only)
> >
> >
> > Best regards
> > JesperKP
> >
> >
Hi..
Can you elaborate a bit on
/DISCARD/:
{
*(.eh*)
}

part. I have got the same error but when I include those 4 lines in my ram-In.cmd, it gives a syntax error.
Where should I paste it in the linker options file. Is it inside SECTIONS or should I put it outside.
thank you.

I am brand new in working with the AT91SAM7 microcontroller and find
>the beginning very difficult.
>
>My basis for learning the AT91SAM7S256 is as follows :
>
> Developement board is Olimex SAM7P256
> Programming done by using the Samba boot manager
> (USB serial programming - verified working with Sam_I-Am)
>
> Software developement on Linux/Debian 5.04
>
>My goal is to be able to run my own software without the need of an
>operating system running on the microcontroller. Also I would like to be
>able to run software based on FreeRTOS.
>
>I started with Linux on Slackware 0.97 as a regular user and have been
>using it ever since.
>I have worked with the Motorola 68HC908JB8 microcontroller (though only
>using the sdcc C compiler and assembly).
>
>My experience with the AT91SAM7 series is that it feels immensely more
>challenging to learn - especially when it is difficult to get even a
>basic system up and running to allow you to compile and run a piece of
>code.
>
>What I would like to end up with is a decently new version of GCC
>+ compilation tools and the commonly used libraries for it - newlib +
>libgcc + libc .
>
>I run into terms like EABI in connection with gcc - what are the
>difference between a gcc compiled with EABI compared to compiled in elf
>version.
>
>I have tried using several tutorials - mainly the
>http://hermann-uwe.de/blog/building-an-arm-cross-toolchain-with-binutils-gcc-newlib-and-gdb-from-source
>
>This compiled version wont let me compile even the smallest example
>programs like the ARMBlinkExample from
>http://www.doctort.org/adam/nerd-notes/getting-started-with-the-olimex-sam7-p256.html
>This fails with :
>
>jkp@io:~/Microcontroller/SAM7P256/ARMBlinkExample$ make
>arm-elf-gcc -I./ -c -fno-common -O0 -g -c blink.c
>arm-elf-as -ahls -mapcs-32 -o crt.o ram-crt.s > crt.lst
>arm-elf-ld -v -Map blink.map -Tram-ln.cmd -o blink.elf crt.o blink.o
>GNU ld (GNU Binutils) 2.19.1
>arm-elf-ld: error: no memory region specified for loadable section
>`.text.1' make: *** [blink.elf] Error 1
>
>Anyone have any advice of where to turn to get a basic developement
>system up and running? (hopefully without having to spend alot of money
>on a turn-key piece of software as this is for hobby use only)
>Best regards
> JesperKP
>
>

The 2024 Embedded Online Conference