How to write programs for a custom SAMD21 board using Arduino IDE

Hi @meghdadi

I recently had a discussion about this on the forum.

For the the SMAD21E17D you'll need to burn a modified bootloader to account for the microcontroller's smaller memory compared with the SAMD21G18A used on SAMD21 Arduino boards. For this you'll require your J-Link programmer connected to the microcontroller's SWD port.

Here's a link to a zip file containing a minimal bootloader for the SAMD21E17D: Lower memory SAMD21 variant - #20 by MartinL.

After burning the bootloader you can remove the programmer.

You'll also need to change the Arduino IDE's BOSSSA executable, in order to upload sketches over the microcontroller's native USB port. To do this you'll need to swap Arduino's "bossac.exe", for one that's compatible with the SAMD21E17D. Here's a zip file containing "bossac.exe" and instructions for that: Lower memory SAMD21 variant - #37 by MartinL.