I am having trouble programming the SAMD51 Thing Plus using Atmel Studio 7. I have successfully connected the thing up to the Atmel ICE programmer, the chip is actually recognized and Studio can read its fuses.
Now, if I try running a vanilla project (GCC C Executable) with just a main() (as generated by Studio), it will build without failures, but fail when actually programming the device. The error message depends on how I try to start the code:
Start debugging (F5):
Error: Loading executable to device failed, Error downloading changes to the device at 00000000-00002000
Start debugging and break (Alt+F5) a popup appears saying:
Error: Failed to set gdb proxy
Probably it has something to do with the original bootloader still present and protected, but having read many articles on the internet it only confuses me. Most -if not all- of them deal with SAMD21 anyway, where people talk about a BOOTPROT flag that must be set to a certain value to unlock the bootloader.
Now if I look in the SAMD51 fuses list in Studio, the only fuse that resembles something like BOOTPROT is ```
USER_WORD_0.NVMCTRL_BOOTPROT
I haven't fiddled around with the other fuses - don't want to end up locking the device entirely without knowing exactly what I'm doing.
I have double checked that the device in the project config is set to ATSAMD51J20A, which is exactly what it is.
It must be something I missed. Does anyone have a clue about what I am doing wrong?