@nijupp24 ...and you've selected the port? Arduino IDE menu: Tools->Port->COMx.
What happens if you double tap the reset button two times in quick sucession? This should get the board to change COM port as it enters bootloader mode. Try selecting the bootloader COM port and upload.
Back to my posts from last summer, I don't think the issue is BOSSA, since like I said I can upload sketches to the device and they are written to NAND. They just crash when you try to load them.
I think there is some issue with the bootloader. In addition to the linker scripts, there are various other places in the source where the memory size is hard coded (e.g. gcc_arm.ld). I dug through the .map files (for both bootloader and sketches) pretty carefully, but that doesn't mean I am not missing something where memory size is assumed, a stack is allocated too large, etc.
I eventually gave up and went back to the larger memory variants, but it would be neat to know what the problem was.
@mgiacomelli2 This behaviour suggests that you're using a crystalless board and bootloader, but using Arduino core code that requires a board with an external crystal, which the Tau does. In this instance the bootloader works just fine, successfully uploading the sketch, but the sketch fails to run, since without the crystal the microcontroller stalls.
The way to compile the Arduino core code for crystalless operation, is to edit the "boards.txt" file and change the compiler flags for your board to include -DCRYSTALLESS. For example, here's the entry for the Adafruit Trinket M0:
Yes, it's to do with BOSSA. The current version used by Arduino doesn't support the SAMD21E17D.
The current situation regarding BOSSA looks a bit of a mess, the lastest release from the Shumatech master repository was a while ago, back in August 2018. However, the demand for new chip variants has continued with others forking the main repository to create their own custom copies, in order to support their own particular microcontroller of interest.
The thing is, I couldn't find anyone who had built AND released a repository that supported the SAMD21E17D. This repo supports the SAMD21E17D, but hasn't built and released it: https://github.com/LumitoLuma/BOSSA.
To build your own copy for Windows, I believe requires the use of MSYS2 plus the installation of the gcc toolchain plus mingw-w64-i686-wxWidgets. Unfortunately, I couldn't find any step-by-step instructions on how to do this.
Make a copy of the "zero" directory and call it say "zero2".
Launch Atmel Studio and open the booloader Solution/Project "samd21_samba.atsln" in the "zero2" directory.
In Atmel Studio open the bootloader file "board_definitions_arduino_zero.h". Here you'll find the configuration definitions for the bootloader itself and can edit the LED status pins, as well as the auxiliary UART that can be used in addition to the native USB port to upload code.
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:
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.