This is my first time using a) Atmel ICE and b) programming SAMD chips without a bootloader. My aim is to add an Adafruit M4 bootloader to a custom board.
This is my schematic:
I have used the octopus cable from the ICE to a breakout board where I connect the three GND pins together and then take VTGT, GND, SWDCLK and SWDIO to individual pads on my PCB. I have tried programming with and without a 3.3k pullup on SWDCLK. I have tried with very slow SWD clock speeds (32kHz), as well as the default 2MHz.
I can read the fuse registers and program them. I can get the device details and signature, and I am powering the target device straight into VDD at 3.1V from a power supply, via a Joulescope. I cannot erase the device or program the flash with a binary.
This is the device connected and shows I am targeting the right chip:
Target voltage is 3.1V. The chip is new and I don't know how to tell if the security bit is set but I haven't tried to set it.
I have successfully erased the SAMD51 on the Adafruit ItsyBitsy M4 that this device is loosely based on (also using the same octopus cable - so I think the cable is not part of the issue) and, once I set the BOOTPROT fuse correctly, could reflash the Adafruit bootloader binary onto the ItsyBitsy, so the overall toolchain seems fine.
I have installed the most up to date SAMD51 device pack and upgraded the ICE firmware on first connection yesterday. I have restarted the Win10 PC AS7 is running on.
Here is my error message for a chip erase:
and here it is for a program without chip erase checked (just throwing mud at this point):
Finally, here are my fuses:
I have noticed from the Joulescope that the current drops from ~10mA to ~7mA when I attempt to erase. If I then try to read the device signature it draws a blank until I repeat the request and the current rises and the signature appears. The other components are unknown current draw in this scenario and I'm loathed to take them off the board unless I can't progress with assistance from the community. I can say the accelerometer and LED will likely be under 2mA by themselves. So does the ~3mA current drop seem consistent with the ICE holding the SAMD51 cpu in a cold plugging situation? Any other ideas from what I've said?
Please help! Thanks