Using the SAMD10 Xplained Mini dev board as a bootloader for a SAMD10 proejct - Page 1
Forum section: electronics / general

author: WOOK.ltd
author_rank: Newbie
timestamp: December 04, 2018, 09:44:30 am
content: Hello everyone,I would like to use the ATSAMD10D14A in a project however I am confused on how to program the microcontroller. What I can gather from the datasheet is that you need to interact with SWCLK, SWDIO and RESET signals on PA30, PA31 and PA28 pins to program the controller (6.2.2 Serial Wire Debug Interface Pinout - SAM D10 Datasheet).The SAM D10 Xplained Mini development board uses an ATmega32U4 as a hardware bootloader to program the onboard SAMD10 controller. The user guide for this board talks about using an external programmer to program the onboard SAMD10 microcontroller (2.2.5. Target Programming - SAM D10 Xplained User Guide). The header used to connect an external programmer connects to the same pins that the ATmega32U4 uses (PA30, PA31 and PA28). Therefore, I was thinking would I be able to use this header to program an external SAMD10 microcontroller on another board? It would also program the SAMD10 on the dev board as well.In other words, is it possible to program two of the same microcontrollers from the one bootloader (one on the dev board and one in my project)?As you can probably tell I am quite new to this, but any help will be greatly appreciated.Thanks in advanced,Will

author: ataradov
author_rank: Super Contributor
timestamp: December 04, 2018, 04:34:51 pm
content: Your question is not very clear. You can't program two SAM D10s from the same ATmega32U4 at the same time. But if you remove the D10 from the Xpro board, you can use Xpro board as a programmer for external devices.At the same time you can use the SWD connector to program the D10 on the Xpro from an external programmer. On board ATmega32U4 will be fine with that.So if I understand your question correctly, you can turn the Xpro into the programmer if you remove the D10 chip from it.

author: WOOK.ltd
author_rank: Newbie
timestamp: December 04, 2018, 07:09:03 pm
content: Thanks for the reply,I'd prefer not to pull apart my development board to program the SAM D10, however the only other solution I've found is to purchase an Atmel-ICE but they're quite expensive. Do you know of any any other options?

author: ataradov
author_rank: Super Contributor
timestamp: December 04, 2018, 07:15:50 pm
content: That depends. If you want to use Atmel Studio, then Atmel-ICE is the best tool. And PCBA version is $50.I sell a cheap SWD programmer herehttps://www.tindie.com/products/ataradov/cmsis-dap-compliant-swd-debugger/But shipping is probably going to be too expensive.With some effort you cam make your own programmer using Arduino. It is doable, but not trivial.

author: cv007
author_rank: Frequent Contributor
timestamp: December 05, 2018, 01:20:35 am
content: QuoteOne level down from 'pulling apart', is to just get at the sw lines of interest- the swclk, swdio and reset all have resistors in their path from the 32u4 so can be isolated. I'm not certain, but maybe just removing the swclk resistor, solder a wire on both pads to a spdt switch (in->sp, dt->on board, ext)- used to switch the swclk from either going to the on board sam or to an external sam. Probably won't look pretty, but we are talking about a $9 board that is meant to be used.Or buy another $9 sam d10 mini board, remove the sam (or cut the traces close to the sam as needed) and use the swd connector- one development board, one dedicated programmer.edit- a 3 pin header with a shunt would work just as good as a switch for selecting int/ext.remove swclk resistormount 3 pin header2 wires from resistor padscut trace near swd connector (bottom layer)wire from 3 pin header to swd connector (bottom layer)use shunt to select internal or external targetsee attached pictureedit again-I assumed the swd connector was populated, but I guess its not, so you could instead create your own 5 pin header (100mil) on the board close to that connector (vcc, gnd, A,B,C)- just connect to the 2 needed pins on the swd footprint (no need to cut swdclk trace), and 1 from the 3 pin header. It may be easier to deal with the standard header size, without having to populate that swd connector (50mil spacing).

author: WOOK.ltd
author_rank: Newbie
timestamp: December 05, 2018, 11:14:36 pm
content: Thanks for the detailed response. I'll give it a go, I just have to wait for the board to arrive.Also, would this only work for programming SAMD10 chips or would I be able to use it on other Atmel microcontrollers in the future?

author: ataradov
author_rank: Super Contributor
timestamp: December 06, 2018, 03:00:05 am
content: All ARM based devices should work, but you will have to select an option to show incompatible devices in the AS.But keep in mind that mEDBG is pretty slow, so 8f you are going to do this for real, better 8nvest in a good tool.