0

I bought a SAMD21G18A (ARM Cortex M0+) from RobotDYN and trying to simply get setup to program it but I can not find much documentation on how these are connected/setup for programming and debugging.

On the website it states "One of its most important features is Atmel’s Embedded Debugger (EDBG), which provides a full debug interface without the need for additional hardware..." so I assumed that the connections would be similar to some of the other MCU Development Boards like the Arduino, PI or Beaglebone meaning that there isn't any need for things like a JTAG Programmer but I don't know if that's the case or maybe I am just confused on how to set this up.

Can anyone point me in the right direction on how to upload the program and get my IDE setup? I can find all sorts of information on the Registers, the newlib library and stuff like that, but I can not find much on the actual connections or other needed components.

I would prefer Visual Studio +VisualGDB if anyone uses that combo but I will take any help so I can just get started. I also have tried Atmel Studio and the Arduino IDE also without success. Just to mention I am not looking for a step by step guide, just some direction and explanation of how I should proceed.

When I installed the Arduino IDE I was able to get the board to show up under COM11 as a Arduino-M0, so possibly I am simply missing some drivers?

Edit: I have been searching the internet for possible ways of hooking this up and it seems like I need to have some sort of programmer/debugger. I also found there are a couple types of these boards out there, one of them is the XPlained series. I looked at the schematics and they have a ATMega in addition to the ATSAMD21. I have a variety of AVR's, BeagleBone Black and also a FTDI CDM USB cable. Does anyone know if its possible to use any of these to setup for programming/debugging?

artless noise
  • 21,212
  • 6
  • 68
  • 105
Andy Braham
  • 9,594
  • 4
  • 48
  • 56
  • It is a cortex-m0+ it has an swd interface, as shown in the datasheet SWCLK in pa30 and SWDIO on pa31. Add to that power and ground. On ebay search for jlink swd you will see these little purple boards for a few bucks. TVCC is not to power your board it is a voltage monitor to know how hard to drive the SWD signals, power the chip normally. use openocd to connect -f jlink.cfg -f samsomething... you can use full sized jlink dongles but have to figure out which wires to jumper (pretty easy), fake clones or real jlink dongles. can get a $10 NUCLEO board from ST and use the stlink header.. – old_timer Feb 14 '18 at 15:02
  • ..as well as have another mcu to play with. can buy a generic ftdi breakout board that HAS MPSSE, most dont. FT has a board for like $20. FT2232 mini or something like that. Worry about an IDE later get the command line tools to work first. – old_timer Feb 14 '18 at 15:08
  • technically you can bit bang the swd from pretty much anything, but that doesnt mean there are already made packages, pretty easy to use the dummy backend to openocd and then take those raw signal changes and bit bang whatever BBB gpio, AVR gpio, etc... – old_timer Feb 14 '18 at 15:10
  • unlike the good old days (cant blame this on microchip, they messed this up while still atmel) they dont have a burned in bootloader anymore, they provide one but it is so trivial to erase the flash that there is little point. the board you have or others you may buy (both sparkfun and adafruit have samd21 boards) may come with a usb bootloader, but if you misuse that, game over, have to resort to the primary programming interface, swd into the arm then through the arm to the flash. – old_timer Feb 14 '18 at 15:12
  • @old_timer Thank you so much for the info that really helps allot. I see that these newer MCU's are the same but not the same as the AVR's which is requiring a little learning curve. I just broke down and bought one of Atmels-ICE programmer/debuggers, I plan on doing quite a bit of development with these so might as well have the right tools. I will revisit this after I get a little more familiar with things and hopefully post some alternatives like you mentioned with using one of the other boards to bit-bang the signal. – Andy Braham Feb 14 '18 at 15:52
  • The bottom line is to have the tools, they dont need to be expensive, the purple jlink clone thing are a handful of bucks and should work on all cortex-ms not just one brand. Then there is cabling sure, and those new little debug headers are tiny, I made my own board to break those out from those higher density pins to something I can get a jumper wire on and just use jumper wires no special cables. usb uart for various voltages certainly 3.3 maybe 5.0 and 1.8 (for around $2 on ebay can get an ftdi breakout that has a jumper between 5 and 3.3) plus a jtag/swd solution should be in your... – old_timer Feb 14 '18 at 16:20
  • developers toolbox along with some experience dabbling with openocd and various other tools, and at times writing your own (programming an avr with your own software talking to the arduino bootloader for example is pretty easy, as is bit banging their ISP interface, st has a bootloader, pretty easy, nxp same story). all good toolbox tools... – old_timer Feb 14 '18 at 16:22
  • to be fair I didnt finish my swd program, started but didnt finish, on my pile of things to do... – old_timer Feb 14 '18 at 16:24

1 Answers1

0

Your SAMD21 board from RobotDYN doesn't have the Atmel EDBG interface, so you need an external SWD debugger like the Atmel-ICE you mentioned in your comment. This debugger comes with the standard 10-pin Cortex Debug Connector, which is also present on the RobotDYN SAMD21 board (labeled "SWD(EDBG)", which is a bit unfortunate since it seems to suggest this is an EDBG interface, which it isn't). So the only connection needed is between these two connectors via the flat cable that is likely included in your Atmel-ICE kit. Pay attention to how you connect the cable to the RobotDYN SAMD21 board: the first pin of the 10-pin header (i.e. the one with a "1" label next to it on the PCB) must correspond to the first pin on the the Atmel-ICE connector, which is the pin at the bottom left. See also http://microchipdeveloper.com/atmelice:connecting-to-avr-and-sam-target-devices.

Francesco Lavra
  • 809
  • 6
  • 16