ATsam3x8e Safe and Secure Bootloader

Discussion around product based on ARM Cortex M3 core.
This forum will be discontinued soon.

Moderators: nferre, ncollot

mdedonato
Posts: 3
Joined: Wed Oct 14, 2015 12:48 am

ATsam3x8e Safe and Secure Bootloader

Tue Dec 08, 2015 7:39 pm

I am trying to convert the Atmel safe and secure bootloader to gcc. I have the bootloader compiling and programming the chip in the correct memory location. I also updated the new program linker script to account for the new program start (after the bootloader). After I update the vector table and then jump to the new code location, nothing ever executes. Is there something I am missing? Is there an easy way to debug this behavior (ie. see where I am jumping to).
tomshirvo
Posts: 11
Joined: Wed Oct 22, 2014 7:22 am

Re: ATsam3x8e Safe and Secure Bootloader

Wed Dec 09, 2015 6:56 am

I have had this problem and I found that it was because the program I uploaded needed to have the flash starting position changed.

I was using the Arduino IDE to compile the code so I just changed the linker_script, changed the "rom" to the correct start location after the bootloader.
cdxa
Posts: 1
Joined: Sun Feb 28, 2016 12:57 pm

Re: ATsam3x8e Safe and Secure Bootloader

Sun Feb 28, 2016 1:19 pm

I have the same problem. @tomshirvo Could you explaint how to compile the mentioned bootloader in Arduino IDE?
Regards
tomshirvo
Posts: 11
Joined: Wed Oct 22, 2014 7:22 am

Re: ATsam3x8e Safe and Secure Bootloader

Tue Apr 05, 2016 7:06 am

Sorry @cdxa I only just saw this, are you still having this problem?

It depends what version of Arduino you are using.

From the start menu type in %localappdata% and you should see in the window "Arduino15" if you don't then you need to go %appdata%

Follow this in the folders, the 1.x.x is just whatever is in that folder as it depends on what version of Arduino you are using.
Arduino15\packages\arduino\hardware\sam\1.6.6\variants\arduino_due_x\linker_scripts\gcc

You will find a flash.ld file, just edit that in a text editor and you need to change the "rom" origin to the position you are trying to start your program.

Code: Select all

/* Memory Spaces Definitions */
MEMORY
{
	rom (rx)    : ORIGIN =0x00080000, LENGTH = 0x00080000 /* Flash, 512K */
	sram0 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000 /* sram0, 64K */
	sram1 (rwx) : ORIGIN = 0x20080000, LENGTH = 0x00008000 /* sram1, 32K */
	ram (rwx)   : ORIGIN = 0x20070000, LENGTH = 0x00018000 /* sram, 96K */
}

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: No registered users and 3 guests