# Programming the SAMD51 Thing Plus using Atmel Studio fails

**URL:** <https://community.sparkfun.com/t/programming-the-samd51-thing-plus-using-atmel-studio-fails/39203>\
**Category:** Development Boards\
**Tags:** samd\
**Created:** [March 24, 2020, 9:15am UTC](https://community.sparkfun.com/t/programming-the-samd51-thing-plus-using-atmel-studio-fails/39203 "2020-03-24T09:15:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manfred.suttorp](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@manfred.suttorp](https://community.sparkfun.com/u/manfred.suttorp)\
**Post date:** [March 24, 2020, 9:15am UTC](https://community.sparkfun.com/t/programming-the-samd51-thing-plus-using-atmel-studio-fails/39203/1 "2020-03-24T09:15:22Z")

</div>

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):

```auto
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:

```auto
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

```auto

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?
```
