Set GPNVM bit (BOOT_MODE) with atprogram.exe for SAME70

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

Hello,

 

I am searching for a while now a possiblity to set GPNVM bit BOOT_MODE = 1 with atprogram using Atmel-ICE connected via SWD.

We use atprogram.exe to flash the devices with an elf file. In order to run our code, the BOOT_MODE bit has to be set to 1, otherwise the devices hangs in Bootloader.

 

It is possible to open the Device Programming Tab in Atmel Studio7 and set the GPNVM bit there. But we need to flash a lot of devices and want to use atprogram for that purpose.

 

Does somebody know how to do it? Maybe there is a mechanism to include the GPNVM bits in the elf file (but not in application code - which is not executed by default), like it is possible to include Fuse Settings when using AVR8.

We don´t mind to add another atprogram call to set the GPNVM explicit.

 

Many Thanks in advance!

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

I opened a support ticket and got help from atmel support team.

 

For those who are interested:

Setting GPNVM bits is done with the commands for setting "Fuse bytes". Here is an example that sets GPNVM BIT Boot_Mode to 1 and GPNVM bit6 to 1 and others to 0:

atprogram -t atmelice -i swd -d atsame70q21 write -fs -o 0 --values 0x42

 

Update: Please notice you don´t come arround of touching bit #6 ("Reserved") with this method. Atmel support confirmed to me it should always be set to 1 (I had some strange behavoiur when it was set to 0).

Last Edited: Wed. Oct 5, 2016 - 03:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is changing the bit properly.

 

But i need some info on the command line.

 

0 represents ?

0x42 represents ?

 

how to reset the bit ? I mean boot from ROM. ?

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

you should not set to 0, because then bit 6 is 0 and this is not recommended.

 

--values 0x40 (=bit6 + boot from rom)

--values 0x42 (=bit6 + boot from flash)