Try to program ATSAMD21G18A (Adafruit Feather M0)

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

I want to restore bootloader on my feather m0 proto that includes ATSAMD21G18A
I have Atmel-ICE Basic and Atmel Studio 7 on X64 Windows7 Machine.

 

Atmel SAM port has 100mil 10pin connector.

 

2-1
4-3
6-5
8-7
10-9

 

For programming we need;

 

1 > Vcc 3.3V > Feather proto's 3V3 pin ( second in pin line )
2> SWDIO > SWDIO on Feather's bottom side
4> SWDCLK > SWDCLK on Feather's bottom side
3,5 > GND > Feather proto's GND pin (4th in pin line)
10 > RST > Feather proto's RST pin (1st in pin line)

 

I powered Feather with Lipo ( tried with USB too)
Atmel-ICE basic has three lights. Green and red are on.

 

On Atmel Studio > Tools > Device Programming >
Tool > Atmel-ICE
Device > ATSAMD21G18A
Interface > SWD
and clicked Apply.

 

When I tried to read device signature, it returned an error ("Unable to enter programming mode.") Code 4109

Target Voltage 2.6V ( From pins directly I measured its 3.2V )

(I connected SWD's pin 5 to GND it will give correct voltage 3.2-3.4 volts)

 

I changed SWD Clock from 2Mhz to 32Khz, but nothing changed.

 

Are there any suggestions to try?

Last Edited: Tue. Sep 20, 2016 - 12:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'll move this to the SAM forum so you should get better results there.

 

JIm

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

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

I burned firmware from Adafruits M0 with Jlink to custom M0 board with these settings.

NVMCTRL_NVM_LOCK = 0x00
NVMCTRL_PSZ = 0x03
NVMCTRL_NVMP = 0x1000
ADC_LINEARITY_0 = 0x08
ADC_LINEARITY_1 = 0x04
ADC_BIASCAL = 0x03
OSC32K_CAL = 0x3A
USB_TRANSN = 0x05
USB_TRANSP = 0x1D
USB_TRIM = 0x03
DFLL48M_COARSE_CAL = 0x1D
DFLL48M_FINE_CAL = 0x200
ROOM_TEMP_VAL_INT = 0x1D
ROOM_TEMP_VAL_DEC = 0x06
HOT_TEMP_VAL_INT = 0x54
HOT_TEMP_VAL_DEC = 0x09
ROOM_INT1V_VAL = 0x00
HOT_INT1V_VAL = 0xFE
ROOM_ADC_VAL = 0xB1A
HOT_ADC_VAL = 0xD10
NVMCTRL_BOOTPROT = 0x07
NVMCTRL_EEPROM_SIZE = 0x07
BOD33USERLEVEL = 0x07
BOD33_EN = [X]
BOD33_ACTION = 0x01
WDT_ENABLE = [ ]
WDT_ALWAYSON = [ ]
WDT_PER = 0x0B
WDT_WINDOW_0 = [X]
WDT_WINDOW_1 = 0x05
WDT_EWOFFSET = 0x0B
WDT_WEN = [ ]
BOD33_HYST = [ ]
NVMCTRL_REGION_LOCKS = 0xFFFF

OTP1_WORD_0 = 0x10000300 (unknown)
OTP4_WORD_0 = 0x40004007 (unknown)
OTP4_WORD_1 = 0x75F4AE9C (unknown)
OTP4_WORD_2 = 0xFFFFFE00 (unknown)
TEMP_LOG_WORD_0 = 0x95461D (unknown)
TEMP_LOG_WORD_1 = 0xD10B1AFE (unknown)
USER_WORD_0 = 0xD8E0C7FF (valid)
USER_WORD_1 = 0xFFFFFC5D (valid)

Device cannot be known. M0 drivers already loaded. When powered it look like bootloader mode or blink, i cannot decide with one ?

Any ideas ? Could anyone confirm the fuses right.

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

After restoring bootloader ( https://learn.adafruit.com/system/asset ... 1458155274 )

https://www.youtube.com/watch?v=KnjucqKH6Us

Is bootloader has default blink program ? or it's for the bootloader mode ?

Windows Device Manager shows device as Unknown.

 

I installed these drivers, but nothing changed.


Schematic that I used for MC and USB connections are.



I have ten units. I tried another one to burn firmware. It's successfully flashed and verify the firmware, but it's still stuck in bootloader mode.

I use two clicks the button but doesn't work.

Last Edited: Wed. Oct 5, 2016 - 09:07 AM