0

Grand Central programming with Atmel Studio
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Grand Central programming with Atmel Studio

by mblue on Wed Jun 19, 2019 4:44 pm

When developing a program in Atmel Studio for the Grand Central, are there any memory, fuse, or other settings that need to be changed from Grand Central's default settings?
I am using the Atmel-ICE programmer.
mblue
 
Posts: 6
Joined: Tue Aug 14, 2012 4:27 pm

Re: Grand Central programming with Atmel Studio

by mblue on Sun Jun 23, 2019 12:54 pm

just an update in case I was not clear in my post..
I am Not using Atmel Studio to create an Arduino program..
I am using Atmel Studio to create a native ATSAMD51 C program.
Has anyone done this and successfully programmed this processor on the Grand Central? (I use Atmel-ICE).
In Atmel Studio I can read the device id, and I can read the contents of memory, and I can erase the chip..
When I go to write my program to the ATSAMD51 it seems to write successfully because I can then read the memory and see the hex code has replaced the erased (all 0xFF) memory.
However when I reset the Grand Central, the program does not seem to execute..
I have been thinking that the program was written to the wrong address in memory, possibly due to a fuse, or some other setting, (related to the boot loader?)
Thanks for any help with this issue.
(sorry about getting so wordy again)
mblue
 
Posts: 6
Joined: Tue Aug 14, 2012 4:27 pm

Re: Grand Central programming with Atmel Studio

by emtark on Thu Jul 04, 2019 3:46 am

Hey mate,

I would start by checking the linker script, it has been a while since I had this issue but I'm fairly sure it was due to program address/location.
The boot protection fuse is described here in the fuses section:

https://github.com/adafruit/uf2-samdx1
Code: Select all | TOGGLE FULL SIZE
SAMD51

The SAMD51s bootloader protection can be temporarily disabled through an NVM command rather than a full erase and write of the AUX page. The boot protection will be checked and set by the self updaters.

So, if you've used self-updaters but want to load it directly, then you'll need to temporarily turn off the protection. In gdb the command is:

set ((Nvmctrl *)0x41004000UL)->CTRLB.reg = (0xA5 << 8) | 0x1a


Hope that is of use.

Tim.
emtark
 
Posts: 5
Joined: Sat Apr 26, 2014 7:36 am

Re: Grand Central programming with Atmel Studio

by mblue on Tue Jul 09, 2019 5:13 pm

Thanks Tim.. Sorry to take so long to reply..
I will give an update as soon as I try that.
mblue
 
Posts: 6
Joined: Tue Aug 14, 2012 4:27 pm

Re: Grand Central programming with Atmel Studio

by westfw on Tue Jul 09, 2019 9:12 pm

I am using Atmel Studio to create a native ATSAMD51 C program.
(I use Atmel-ICE).
However when I reset the Grand Central, the program does not seem to execute..

There's certainly an awful lot that can go wrong in this scenario. :-(
With the Atmel ICE, you have debugging capabilities as well, right?
What does the debugger say is happening when you reset the chip? (ie, from the debugger...)

Some "it inexplicably stops" bugs on the fancier ARMs seem to end up being an unhandled exception, which then "escalates" to a HardFault
westfw
 
Posts: 1559
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Please be positive and constructive with your questions and comments.