Lower memory SAMD21 variant

Yes, I updated that and several other things in both of the bootloader memory maps. This enabled the bootloader to work (without that it just crashes on start, probably because the magic number generates an exception when writing to nonexistent memory), but I never got sketches working.

I was using 2 below boards path in Arduino which will support 17A ic

  1. Tau | Rabid Prototypes

  2. GitHub - wagiminator/SAMD-Development-Boards: Collection of SAMD Development Boards, Programmers, Tools and Firmware

Bootloader programming through j link via Atmel studio 7

Hi @nijupp24

Does your custom board use an external 32.768kHz crystal?

It's just that I noticed that the Tau/Firecricket use an external crystal. However, it's also possible to alternatively run microcontroller from its internal 32.768kHz oscillator. If your board is running crystalless then it's necessary to specify this in the bootloader's board definition file.

yes i also used a 32kHz

Hi @mgiacomelli2

Creating a new variant and updating the linker scripts in itself isn't enough, unless you're just modifying the files of an existing board. It necessary to also create a new entry for your new board in the Arduino IDE.

It's a bit out-of-date, by here's a guide that shows you what it entails: https://forum.arduino.cc/t/adding-custom-zero-based-boards-to-the-arduino-ide/394499.

There's another guide here: https://www.instructables.com/Arduino-IDE-Creating-Custom-Boards/

@nijupp24 I've attached a binary for a minimal SAMD21 bootloader for a device with 16KB RAM with only native USB support. It has neither LED status outputs nor auxiliary serial port upload. It also boots crystalless, irrespective of whether your board's got a crystal or not.

I've successfully tested it on my SAMD21G18A based custom board, using it to upload a "Blink" sketch, including double tap reset to put the microcontroller into bootloader mode. So I can confirm that it all works.

samd21_sam_ba.zip (4.7 KB)

Thanks for the great support.
as i have very minimus firmware/software knowledge i have some basic doubts can you please clarify ?

  1. SAMD21G18A or SAMD21E17A bootloaders like Tau will work with SAMD21E17D?
  2. while uploading time arduino is checking board ic to conform the code dump?

i was able to load the code successfully and in windows 10 is is able to detect the com also but when i am trying to dump a blink code using arduino with tau board selected it is giving an error like no device detected in identified Com port?

@MartinL to use this bootloader which board i need to use in arduino?
using tau source code how can i compile a specific 17D bootloader in windows?

@nijupp24 Have you loaded and installed the ArduinoCore-samd package from the Boards Manager?

Tools->Board->Boards Manager... Then type "Arduino Zero" in the search bar. It should display "Arduino SAMD Boards". The current version is 1.8.11.

yes i already installedimage

your bootloader installed and got detected ( arduino zero (native USB port) ) but uploading time no deice found error still coming

@nijupp24 Ok, have you tried uploading with the board set to "Arduino Zero (Native USB Port)"?

@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.

yes i did that and com selected what it appear and pressed upload button but still no device found in com53 erroer is comingimage

normally when i connect the board to arduino i am getting com 54. but if am double tap the reset button also am getting 54 only no port difference

@nijupp24 I'm beginning to suspect it has something to do with BOSSA, the program used to upload the code. It might be that the version used by Arduino doesn't support the SAMD21E17D or SAMD21E17B.

Looking at an issue raised Github, it looks like the most recent updates now support your SAMD21E17D microcontroller: https://github.com/shumatech/BOSSA/issues/114 and https://github.com/shumatech/BOSSA/pull/124.

do you have any idea what i should do now?

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:

adafruit_trinket_m0.build.extra_flags=-DCRYSTALLESS -DADAFRUIT_TRINKET_M0 -D__SAMD21E18A__ -DARM_MATH_CM0PLUS {build.usb_flags}

To get everything to work you'll need a cyrstalless bootloader set for 16KB RAM and the Arduino core code compiler flag set for crystalless operation.

@nijupp24 I'll look into it.