How change boot mode via atprogram.exe for ATSAM3A8C?

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a bootloader in FLASH0 that I want to flash via atprogram.exe (for production).

After reading the command help and pdf documentation I figured the commands below would do the trick,

and it says ok, but the boot mode register does not change:

To boot from FLASH0 (this is the command I actually want to use):

atprogram.exe -t atmelice -i JTAG -d ATSAM3A8C write -o 0x400E0A04 --values 0x5A00020B

 

To boot from ROM (I tried this also, only for test):

atprogram.exe -t atmelice -i JTAG -d ATSAM3A8C write -o 0x400E0A04 --values 0x5A00000B

 

The result with both commands are:

"Firmware check OK"

"Write completed successfully."

 

But nothing happens!

When checking via AtmelStudio the "GPNVMBITS.BOOT_MODE" is unchanged!

 

What am I doing wrong?

 

Last Edited: Thu. Jan 19, 2017 - 05:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You may need an -fs (for "fuse")...

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I tried to add -fs after the write command, but after executing that I can't connect to the device any more!

From the command prompt atprogram.exe now says:

"No device detected, Error 0. (TCF Error code: 1)"

 

And if trying from AtmelStudio it says:

"Timestamp:    2017-01-20 08:27:08.475"
"Severity:        ERROR"
"ComponentId:    20100"
"StatusCode:    1"
"ModuleName:    TCF (TCF command: Device:startSession failed.)"

"No device detected. Error 0"

 

Does ATSAM3A8C even have fuses? (It says nothing about that in the pdf manual).

And how do I get it back online?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Chip erase should restore it

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I booted with 3.3V on the erase pin, and then I got it back. Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm at wits end...

Erasing and programming the bootloader works fine with atprogram.exe from the command line,

but I can't figure out how to change the CPU settings to boot from FLASH instead of ROM!

 

If this isn't the correct command, then what is?

atprogram.exe -t atmelice -i JTAG -d ATSAM3A8C write -o 0x400E0A04 --values 0x5A00020B

 

But it works to change GPNVMBITS.BOOT_MODE via AtmelStudio!

I tried to view the log, but can't see what commands it actually uses.

 

Any ideas?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Landed here while trying to solve this.  meolsen was correct.

 

Atmel Studio Command Line Interface : Version 6.2.1138.0

 

I'm using a ATSAM4E16C. Just issue the fuse settings with the value.

 

atprogram -t atmelice -i swd -d ATSAM4E16C write -fs --values 0x02

 

Per the documentation bit 0 is the Security bit so you can set both with 0x03