I am designing a new board using ATSAMD21E17D processor. Originally the processor was ATSAMD21E17A, but since it was out of stock I switched it for "D" variant.
I have a J-link debugger and I was able to program a simple blink example to it using "Microchip Studio for AVR and SAM Devices", to see that the processor works fine. But I want to write my programs using Arduino IDE, because of the vast and diverse software libraries that are available. In order to do so, I feel that I have the following options:
Write my codes in Arduino IDE, export the binary file, and use the exported .bin to program the processor using Microchip Studio.
I was unable to use this approach. When I export the binary (Sketch >> Export compiled Binary) , it will compile the code for selected board (Tools >> Board). None of the board that I know of use ATSAMD21E17D. There is Tau from Rabid Prototypes that use ATSAMD21E17A. I tried to upload the code for the simple blink example using a few boards such as Tau, MKRZERO, Zero, etc with no success. Microchip Studio can upload the code to the processor but nothing happens.
Write the program in Arduino IDE, then use Microchip Studio's feature: Create project from Arduino sketch
I was unable to even import the simple Blink example to Microchip Studio. I saved the original Blink example on my computer, then in Microchip Studio I selected File>>New Project>>Create project from Arduino Sketch, I selected MKRZERO (and a few other boards), and I compiled the code (I did not even change the processor). I got 54 errors (see attached file).
Well, there were a couple of more approaches that I tried without success, but my question is already getting unusually long. So I will just mention them:
- I was unable to upload the SAM-BA bootloader to my board.
- I was unable to create a custom board matching my processor in Arduino IDE.
Any help is much appreciated, however buying another programmer is not an option for me.
Thanks and I am terribly sorry for the long post.
errors.pdf (97.8 KB)