Occasionally I'll get the following errors while programming my SAMD21 chip. Anyone know the reason?
Error: SAMD: NVM programming error Error: Failed to erase row containing 00000100 Error: SAMD: failed to erase sector 1 at 0x00000100 Error: failed erasing sectors 0 to 10
If I spam
sudo openocd then programming will eventually succeed. Below is my script. I'm totally new to this stuff and copied my script with minor modifications from an Adafruit guide.
source [find interface/raspberrypi2-native.cfg] transport select swd set CHIPNAME at91samd21g18 source [find target/at91samdXX.cfg] # did not yet manage to make a working setup using srst #reset_config srst_only reset_config srst_nogate adapter_nsrst_delay 100 adapter_nsrst_assert_width 100 init targets reset halt at91samd bootloader 0 program image.bin verify # at91samd bootloader 8192 reset shutdown
I'm running this on a Raspberry Pi 3B+. I have no need for a bootloader on the SAMD21. I can confirm that my simple "hello world" image works correctly when it's successfully programmed.