I've recently acquired an Atmel Curiosity Nano SAMD21 board and a Curiosity Nano adapter board to play with and I'm trying to get a bootloader to work on the SAMD21.
I've downloaded the Arduino Core SAMD files from github and chosen the zero bootloader as my starting point.
The Atmel Curiosity Nano SAMD21 uses a SAMD21G17D micro whereas the Arduino Zero uses a SAMD21G18 device. I've been reading through the Lower memory SAMD21 variant thread discussing something similar but for a SAMD21E17 device.
I've modified the Arduino Zero bootloader to use the on-board LED and re-route the serial port out via the EDBG debugger port. The bootloader loads and runs. I get the pulsing LED which I think means that the bootloader is a mode where I can upload a sketch.
However, the programming tool (BOSSAC I think) doesn't appear to support the SAMD21G17D device, so I'm looking at the UF2 drag and drop way of programming it. Reading though various details, it seems a quick double reset should make a new drive letter appear on my WIN10 PC so I can drag & drop the .uf2 file on it. This doesn't happen and I always get the native USB interface appearing as a serial port.
I've tried the Adafruit feather M0 bootloader files as well but I think i've got a mis-match with the Arduino SAMD libraries, as the compiler flags an error in the board_driver_usb.c file regarding the TRCPT bit the device endpoint register in the USB interface. The compiler suggests I may mean TRCPT0. Having looked at the source code there's a conditional compilation check that uses TRCPT1 if the device is defined as SAMR12G18A.
Ultimately, I think i've got various bootloaders where the source isn't compatible with the latest Arduino SAMD libraries & headers.
Has anybody got a link to a working bootloader for the Atmel Curiosity Nano SAMD21, or a pointer to the source for one, that supports the UF2 drag and drop programming method?
Cheers.