0

I am trying to program my Adafruit M0 with the SAMD21G18 chip with Atmel studio and the Atmel ICE programmer. I have pin 1 on the ICE connected to 3.3V on the M0, pin 2 connected to SWDIO, pin 4 to SWDCLK, pin 10 to Reset, and pins 3, 5, and 9 to ground. This was all according to the ARM SWD connection section of the Atmel ICE manual. In Atmel Studio, I can read the device signature, but when I go to program the chip, I get the following error:

Timestamp: 2017年04月20日 22:03:32.563
Severity: ERROR
ComponentId: 20100
StatusCode: 131103
ModuleName: TCF command: Modules:writeToMemory failed.
Failed to write segment at 0x0 to target for memorytype

I have searched the internet for hours, finding no solution to this problem.

asked Apr 21, 2017 at 3:18

1 Answer 1

0

Whats is the fuse setting of NVMCTRL_BOOTPROT?

it should be:

NVMCTRL_BOOTPROT = 0x07

which will set your memory location to 0x00 (no bootloader).

NVMCTRL_BOOTPROT sets the amount of space to allocate for the bootloader in flash memory. Setting this fuse to 0x07 tells the chip you are not allocating space for a bootloader and the programmer will start to write at address 0x00, which is the beginning of flash memory. If you are programming with an Atmel ICE, you are not using a bootloader.

Boot Allocation and Program Space

answered Apr 22, 2017 at 1:49
2
  • Worked like a charm! Thanks! Did you find this in the Atmel ICE manual? Commented Apr 22, 2017 at 2:26
  • Happy to help. No in the Samd21 datasheet. There is a whole section on NVM and boot allocation. Commented Apr 22, 2017 at 2:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.