ATSamd10 Atmel ARM programming via UART bootloader

armatmel

I'm trying to collect info on how to program ATSAMD10 chip (Atmel Cortex-M0 ARM).

E.g. with LPC111x from NXP I've used gnueabi gcc toolchain to create hex-files and then uploaded them via UART using LPC21PRG or MXLI tool. It only required to drive low PIN0_0 during reset to enter bootloader programming mode.

As far as I can understand, for Atmel chips I need to use SAM-BA utility. However I could not at once find which pins help to enter bootloader mode, what minimal hardware configuration is needed etc. However as about firmware, I think the same gnueabi gcc and hex files should be ok, right?

Best Answer

I would expect the GNU tool to do exactly what you need. It is a standard Cortex-M0, so the code generated will work. However, you will need startup code to initialise the peripherals, and library code to use the peripheral interfaces.

Atmel are pushing people to use their Atmel Studio software for upload.

AFAIK, there is no guarantee that software can be uploaded via UART on a raw (newly manufactured, unprogrammed) AT SAMD10. Looking at the AT SAMD10 datasheet there is no serial bootloader built into the chip.

So you need to load one, and flash it into the chip. This, of course, is a 'chicken and an egg' bootstrapping problem. I've done a quick web search, and haven't found a serial bootloader for the SAMD10, so their may be no serial bootloader, and you'll have to write it.

Instead of a serial (USART) botloader, you could use a hardware upload/debugger which connects over the ARM two wire SWD interface (the two pins SWDIO and SWCLK). This can program a raw AT SAMD10.

Look at the AT SAMD10 datasheet 6.2.2 "Serial Wire Debug Interface Pinout" for more details.

The SAM D10 Xplained Mini demo-board includes a hardware upload/debugger. They are under $10, so that is likely the cheapest way to get an upload system. The interface is USB.

You could buy more expensive products from Atmel, or look at OpenOCD (though I can't find SAMD10 support), or look at other hardware debuggers like Segger J-Link.

The issue is not that ARM's SWD interface is proprietary, it is the protocol from the host to the debugger which is the problem.

That will need some software to drive it. AFAICT BOSSA from Shumatech provides an Open Source alternative to the Atmel SAM-BA utility. Unlike the Atmel SAM-BA utility they say "Versions of BOSSA are available for Windows, Linux, and Mac".