SAMD21G18 Programming with Atmel ICE Fail to Write

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Check the fuses in the device programming tool, USER_WORD_0.NVMCTRL_BOOTPROT needs to be 7 to have no protected boot loader section.

/Lars

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Worked like a charm! Thanks Lars! Did you find this in the Atmel ICE manual? I am wondering for future reference.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, I guessed it from "Failed to write segment at 0x0", the boot loader starts at address 0.

/Lars

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello,

I would like to know how I can upload a HEX file (compiled by Arduino) into SAMD21G18 microcontroller with an Atmel-ICE external programmer and Atmel Studio software.
I did search for a solution on how to set the fusebits, but I didn't found one.
I also tried to different settings for fusebits, but the procedure failed again.
Thx in advance