Author Topic: Arduino ona SAM D20G  (Read 3714 times)

0 Members and 1 Guest are viewing this topic.

Offline 97hilfelTopic starter

  • Regular Contributor
  • *
  • Posts: 66
  • Country: it
Arduino ona SAM D20G
« on: May 06, 2016, 12:12:55 pm »
Hello everybody,
since Arduino or Genuino as you have to call them outside the US,
has released the Zero with a SAM D21E (32 pin Variant of the D21) on board Im wondering if its also possible to programm my SAM D20G on a Atmel XPLAINED PRO SAMD20 board with the Arduino IDE.
Does somebody know how to burn the boodloader or how to upload the code to my board?
Felix
 

Offline Signal32

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: us
Re: Arduino ona SAM D20G
« Reply #1 on: May 06, 2016, 06:55:19 pm »
The chips seems very similar & based on the same core.
You'll need an Atmel-ICE.
First thing to try is to just hook up the Atmel-ICE to the SWD pins on the SAMD20 board.
Now use the Arduino IDE to flash the bootloader.
If the IDE complains that the chip ID is different then you'll have to use Atmel's tools to flash the bootloader.
If you can't figure out the bootloader biary, read it from a Zero using the ICE via SWD.
After that use the USB to flash sketches.
 

Offline 97hilfelTopic starter

  • Regular Contributor
  • *
  • Posts: 66
  • Country: it
Re: Arduino ona SAM D20G
« Reply #2 on: May 06, 2016, 08:33:46 pm »
The point is, the D20 on the D20 XPLAINED PRO is bound to the onboard Atmel EDBG programmer and so I dont know where to attatch the ICE... althou I have an Atmel ICE. I will try it as soon as possible.
 

Offline Signal32

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: us
Re: Arduino ona SAM D20G
« Reply #3 on: May 06, 2016, 09:21:59 pm »
http://www.atmel.com/webdoc/samd20xplainedpro/ch04s03s04.html
Quote
The SAM D20 Xplained Pro features a Cortex® Debug Connector (10-pin) for programming and debugging an external target. The connector is limited to the SWD interface and is intended for in-system programming and debugging of SAM D20 devices in the users final products.
The debug connector is connected to the onboard EDBG through level shifters and switches. When an external target voltage is detected, the EDBG will switch the SWD interface from the onboard target device to the external debug connector and the green LED next to the connector will be lit. The voltage of the external target must be between 1.6V and 5.0V.
Using this you can detach the EDBG from the SWD and hook your ICE to the chip. If the pins aren't broken out you'll have to do some soldering though.
 

Offline 97hilfelTopic starter

  • Regular Contributor
  • *
  • Posts: 66
  • Country: it
Re: Arduino ona SAM D20G
« Reply #4 on: May 06, 2016, 09:29:12 pm »
Well so I will try this out tomorrow... my only fear is that I could have problems because Arduino is using a D21E and I am using a D20G (the letter gives the pincount)
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4196
  • Country: us
Re: Arduino ona SAM D20G
« Reply #5 on: May 09, 2016, 06:51:16 am »
You should be able to flash the bootloader using the EDBG chip instead of a real ICE.  If there IS a bootloader.  The "Zero" has an mEDBG chip - doesn't the arduino IDE end up using that for programming the board through the "debug" port?  (using openocd?)  (I guess it would use a bootloader on the native USB port.)

It won't "just work."  At the minimum you'll have to implement (or find) a "board" definition that will set the compiler flags for the D20 instead of the D21, and the needed changes to the upload commands to look for the right chip and programmer.  It shouldn't be "hard", but it's probably pretty far from trivial if you haven't done it before.  It's not a good sign that I don't see any pre-made packages or tutorials on how to do this :-(
 

Offline 97hilfelTopic starter

  • Regular Contributor
  • *
  • Posts: 66
  • Country: it
Re: Arduino ona SAM D20G
« Reply #6 on: May 14, 2016, 10:22:50 am »
You should be able to flash the bootloader using the EDBG chip instead of a real ICE.  If there IS a bootloader.  The "Zero" has an mEDBG chip - doesn't the arduino IDE end up using that for programming the board through the "debug" port? 
Well, on the schematics of the Arduino Zero they hava the EDBG Degubber...

It won't "just work."  At the minimum you'll have to implement (or find) a "board" definition that will set the compiler flags for the D20 instead of the D21, and the needed changes to the upload commands to look for the right chip and programmer.  It shouldn't be "hard", but it's probably pretty far from trivial if you haven't done it before.  It's not a good sign that I don't see any pre-made packages or tutorials on how to do this :-(
Well currently I don't have the time nor the knowledge to do that... So I guess we have to live without that for wa while.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf