SAMD51 Bootloader Flashing Error with Atmel-ICE

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

 

I am trying to flash a new bootloader on an Adafruit Feather M4 Express Board which contains an ATSAMD51J19 chip using ATMEL-ICE Programmer via SWD pins.  I have never tried programming the SAMD51 chip with ICE via SWD pins. I always got the SAMD21 chips programmed and working via ICE without any issue and I am following the same connections(SWDIO, SWDCLK, RST, VTG, GND) for SAMD51 also. With the SAMD51J19 chip on the feather M4 I am able to recognise the chip, read fuses(Check attachment) but not able to program it even after putting USER_WORD_0.NVMCTRL_BOOTPROT to to 0x0F or 0 kbytes as per this tutorial. USER_WORD_0.NVMCTRL_BOOTPROT
 

Whenever I click on Memories->Program. I get the following error(Check attachment)


Could not activate interface, but found DAP with ID 0x2ba01477..

This usually indicates that the device is locked or in deep sleep. Try to do a chip erase to restore connectivity to the device. Unable to enter programming mode. Verify device selection, interface settings, target power, security bit, and connections to the target device. 


 

Can anyone help me figure out what the issue is here? Is it related with some fuse settings? If anyone has a Feather M4 and an ICE programmer can they try replicating to see if this error occurs?

I tried the same on an Adafruit ItsyBitsy M4 Express with an ATSAMD51G19A chip. It also shows the same error. (I am able to read device signature and fuses properly)
 

Any help is appreciated.
 

Thanking you in advance.

 

 

Attachment(s): 

This topic has a solution.
Last Edited: Thu. Apr 8, 2021 - 09:55 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Anyone else finding the same issue? Tried it on a couple of new feather M4 boards too. I seem to get the same error. So I don't think it's the hardware or connections.

 

Can anyone please help? I am stuck on this with no other way(at least what I can think of) ahead.

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

I think the bootloader itself sets the bootprot fuses. If you let the device power up after programming the fuses than by the time you try to program it the bootprot fuses are set by the bootloader. Try to somehow hold it in reset. I'm not sure how to do this, because I moved to OpenOCD and there I can just ask the processor to reset without running.

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

Thanks for the response. I tried setting BOOT_PROT to 0 kbytes in SAMD21 M0(ATSAMD21G18A) chip then boot loaded it and then re-read the fuses. It seems fuses were not set to 8KB but the board works fine.

 

All issues are happening with the SAMD51 boards I have. I am able to erase the chip, read fuses, just not able to program anything on it via Atmel-ICE. That's the perplexing part.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

I seem to have fixed the issue. Seems to be a bug in Atmel studio or Atmel ICE Programmer firmware. In desperation to find the root cause of this issue, I uninstalled my Atmel Studio and reinstalled the latest one from the website. (Well it's rebranded as Microchip studio anyway now). Then when I connected the Atmel ICE it prompted for a firmware upgrade from 1.27 to 1.29. I think that's what fixed the issue.
 

Now I am able to flash all SAMD51 boards with the bootloader and any hex files as needed. Anyone running into this error in future please update your Atmel ICE firmware to the latest.