[En-Nut-Discussion] How to use NUT/OS in the AT91SAM9XE512 platform ?

Ole Reinhardt ole.reinhardt at embedded-it.de
Wed Sep 1 12:33:03 CEST 2010


Hi!

> Porting Nut/OS to another SAM-series chip should not be that difficult. 

Btw: NutOS is just fully supporting (more or less, USB for example is
not yet implemented) working on the AT91SAM9XE512.

> Atmel uses more or less the same peripherals on all chips of a series. 
> The part that is interesting for you should be to find in the 
> arch/arm/ldscripts and th other files like startup*.*.

This one is needed:

at91sam9xe512_ram.ld
and 
crtat91sam7x512_rom.S

Be aware that this linker script / startup code assumes the application
is run from the ram! In most cases this is ok, as the AT91 Bootstrap
code you need to load your application from NAND or Dataflash will copy
it into the ram and then jump to it.

As NutOS just has included AT91SAM9XE512 support in the configurator
just use an existing config file and modify it to your needs:

ethernut50e.conf might be a good starting point. 

As the AT91SAM9XE512 is nearly 100% compatible to the AT91SAM9260 you
could also use at91sam9260-ek.conf as a good starting point.

Additionaly you need the AT91Bootstrap (as mentioned above) to load your
code from Dataflash or NAND-Flash.

The AT91Bootstrap can be obtained here

http://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap

Make shure the loading address (where the code it loaded into ram) is
the same as set int the linker script. By default it is 
0x20000000 which is the beginning of the SDRAM.

In summary you have two options to load your code:

- SAM-BA (RAM): Make sure you enable SD-RAM and load the binary to
  0x20000000 and then type a "go 0x20000000". Compile NutOS for the
  ethernut5c config for a first example and run the uart example. This
  should work without any hassle.

- Using AT91Bootstrap to load the code from Dataflash or NAND-Flash:
  The AT91Bootstrap code will be loaded. If you enable Debugging in the
  AT91Boostrap you'll see a boot message on the UART (the one configured
  for debugging output in AT91Bootstap)


At last you could also use the U-Boot bootloader to start up your NutOS
code. U-Boot is included in our Linux Board Support Package for the
Ethernut 5 Board. You'll also find a step by step documentation how to
install U-Boot (and Linux if you want) on the Ethernut5 board. And how
to run a Ethernut Application using U-Boot.

The Ethernut 5 Linux Board Support package can be found here:

http://www.embedded-it.de/en/bsp/ethernut5_bsp.php

> I heared that there are other ways to see if and how a system starts, 
> but I prefer to use a combination of JTAG, OpenOCD and Insight for GDB. 
> So you can single-step through the startup code. With that you should 
> find incorrect setups of Clock-Sources, PLLs and other things fast.
> You can even check the registers of the memory controller and so on. 
> After a certain point they should have values that match closely to what 
> you read in the data-sheet.

Right. Using OpenOCD / GDB is quite well suited to debug the code. If
you are using AT91Bootstrap or U-Boot you can easily set a breakpoint to
the NutOS Entry and then step over the code.

If you need any help porting NutOS to your board, let us know...

Best regards,

Ole Reinhardt

-- 

Thermotemp GmbH, Embedded-IT

Embedded Hard-/ Software and Open Source Development, 
Integration and Consulting

http://www.embedded-it.de

Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen - 
tel +49 (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97

Hauptsitz - Hademarscher Weg 7 - 13503 Berlin
Tel +49 (0)30 4315205 - Fax +49 (0)30 43665002
Geschäftsführer: Jörg Friedrichs, Ole Reinhardt
Handelsregister Berlin Charlottenburg HRB 45978 UstID DE 156329280 




More information about the En-Nut-Discussion mailing list