Lower memory SAMD21 variant

That's good, it means that the board and bootloader are working correctly.

Arduino boards that communicate over their native USB port, require a fully functioning sketch to allow auto reset and upload to work correctly. If there's a bug somewhere in the sketch and the microcontroller crashes, the COM port can be lost. The double tap reset to put the microcontroller into bootloader mode, allows the board to be recovered when this happens.

Actually, the bootloader's not too fussy when it comes to selecting the microcontroller variant, since apart from the memory (that you've now accounted for), it's using resources that are common to all of them. I'd just leave the microcontroller type as SAMD21G18A.

Bossa on the other hand, is more thorough and certainly on Shumatech's version it's checking the device ID, which is most likely why it didn't work with your SAMD21E17D variant.

In the "board_definitions_arduino_zero.h" file, if you don't require the status, Tx or Rx LEDs just comment out these lines and the bootloader code will automatically detect this and remove the code to control them.

Apart from the "board_definitions_arduino_zero.h" configuration file, if you only want the native USB upload and not the UART option, change line 65 in the bootloader's "Makefile" from:

SAM_BA_INTERFACES?=SAM_BA_BOTH_INTERFACES

to

SAM_BA_INTERFACES?=SAM_BA_USBCDC_ONLY
1 Like

Hi @nijupp24

There are some other changes to the Arduino core code that you'll require, these are disussed further with regard to the SAMD21E17D here: https://forum.arduino.cc/t/how-to-write-programs-for-a-custom-samd21-board-using-arduino-ide/914110.

@MartinL
thanks for the information i will try this method for sure.
i need to do some more changes in my bootloader listed below

  1. i was using an interrupt on PA02 and PA15 on my board but by default it is not configured for external interrupt how can i change that?
  2. my led default pin was PA28 but bootloader was having PA06 by default how to attend this issue?

Currently i was using wagiminator/SAMD-Development-Boards
link: SAMD-Development-Boards/SAMD21E_DevBoard at main · wagiminator/SAMD-Development-Boards · GitHub

with BOSSA version what you given

Hi @nijupp24

There are two separate issues here.

The first point is to do with the Arduino SAMD core code and doesn't have anything directly to do with the bootloader.

Your options are either to modify the entry for those pins in the Arduino core code "variants.cpp" file, or alternatively use the pinPeripheral() function in your sketch. The location of the "variant.cpp" file will depend on what board you've chosen in the Arduino IDE. The use of the pinPeripheral() function will depend on what Arduino pins you're using for port pins PA02 and PA15.

Point 2 requires the bootloader to be recompiled with the status LED enabled and reflashed using the J-Link. If you like, I can compile and build this for you.

variant.cpp (27.6 KB)
variant.h (15.0 KB)

first point : please check attached variant.cpp and h file modification is correct maily for PA02 and PA15 external Interrupt
i used only 1 ADC in PA7 balance all GPIO

second point: its very much helpful if you can compile and build the bootloader for SAMD21E17D with LED pin as PA28 and external crystal 32kHz with external interrupt in PA15 and PA02

thanks

Hi @nijupp24

I checked your "variant.cpp" file and the interrupt channels for PA02 and PA15 look correct.

Please find the zip file of the bootloader binary below, it includes the status LED on port pin PA28 and requires an external 32.768kHz to operate:

samd21_sam_ba.zip (4.7 KB)