[En-Nut-Discussion] Bootloader linker script and startup

Harald Kipp harald.kipp at egnite.de
Wed May 27 15:43:17 CEST 2009


Hans Bacher wrote:

> I am trying to compile a Nut/OS project to work with Atmel's layer-based
> bootloader: "Safe and Secure Bootloader Implementation" (application notes,
> AT91SAM7X).

...

> The bootloader is programmed to flash memory at start address 0x00100000
> (0x00000000), thus it is executed first when powering the board. The
> bootloader region is 0x8000 bytes long, therefore the application flashed by
> the bootloader starts at address 0x00108000.

Hallo Hans,

Most probably the problem is with the runtime initialization
(crtat91sam7x256_rom.S, actually the included crtat91sam7sex_rom.S), not
the linker script (at91sam7x256_rom.ld). The system assumes, that its
interrupt and exception vectors are at 0x00000000. But this location is
occupied by your boot loader.

I do not the anything about this boot loader, but you need to find a way to

...either get the vectors of the Nut/OS image to the beginning of the Flash

...or adapt the Nut/OS interrupts to the boot loader code somehow.

While following the discussions in this list, there had been several
queries and attempts to create an Ethernet boot loader for the SAM7X.
AFAIK, without any result. I won't say that it is impossible, but it is
for sure tricky.

The boot loading on Ethernut 3 was much easier to implement, because RAM
can be mapped to 0x00000000. In this environment the runtime
initialization simply copies the vectors from Flash to RAM. (Well, it is
not that easy, because the code has to be relocatable.)

Harald





More information about the En-Nut-Discussion mailing list