My Customized Zero Board,upload bootlader succesfully but lost com port

Hi everyone,

We are going to make a customized zero board like SparkFun SAMD21 Dev Breakout.

We try to do similar like their schematic.

This is our schematic:

After that we upload bootlader with jlink. Bootloader link:

File name: samd21_sam_ba_sparkfun.bin

note: I did not change anything.

After that when I connect usb cable to my board, Arduino IDE find my board.

com port
kart info

And i can upload a basic code like blink.. Everything is normal but if i disconnect the cable and connect again IDE does not recognize the board.

no device

I searched the forum. Some people try to do a customized zero board and %90 has got problem about bootloader or upload the code.

If anybody help me about this subject, i will be appreciated a lot.

I hope that I can explain the situation..

why do you need a bootloader if you already have a Jlink programmer?

Yes I have a jlink programmer but other people around me does not have.

And we put a mini usb connector our pcb and want to use it. It is very easy to debug and programming.

Hi @fbasaris

What happens if you double tap the reset button (two times in quick succession), or in your case, looking at the schematic, the jumper pins? Does the COM port appear? In the case of the UF2 bootloader, it should appear as a flash memory drive on your host computer.

This will put the SAMD21 microcontroller into bootloader mode. In bootloader mode the board will connect and wait for a sketch to be uploaded.

If I double tap the reset button two times in quick succesion, d13 led was fading before but this time no response right now. I did not know why it does not work. I think that is there any problem when i soldered it.

I am going to check all wiring and soldering in my board and write here the last situtaion.

Thanks a lot for reply MartinL.

Best regards..


This is our custom board.

And you can view the behavior our board double tap reset button. I upload a video to YouTube.

But still it does not appear in my computer and Arduino IDE. :frowning:

Hi @fbasaris

Are you using a SAMD21G18A? Variants with a different memory size will require modification of the bootloader and Arduino core code.

ATSAMD21G18A-AU - IC MCU 32BIT 256KB FLASH 48TQFP

This is our chip.

@fbasaris The fact that you're using a ATSAMD21G18A greatly simplifies everything from a software standpoint.

Also, the fact that the microcontroller did connect and upload the "blink" sketch at one stage, suggests that it might be a start-up issue, (or possibly be a solder joint somewhere)?

It's probably worth inspecting board and checking if there's a 3.3V supply to all the VDD pins. The VDDCORE pin should be around 1.8V or thereabouts.

I know it sounds silly, but it might also be worth trying to waggle the USB plug in the board's USB connector, or try a different USB cable.

Start-up issues can be related to the external crystal. One way to test this is to use a the UF2 bootloader binary from a crystalless board, such as the Adafruit Itsy Bitsy M0. This uses the microcontroller's internal 32.768kHz oscillator, or the USB's 1kHz SOF (Start Of Frame) pulses instead.

The UF2 bootloaders normally set the microcontroller's BOOTPROT fuse, to protect the bootloader from being overwritten, therefore it's usually necessary to reset this fuse back to 0x7 (or 0 bytes) before uploading a new bootloader binary. (The Arduino (Zero) SAMD21 bootloader doesn't set the BOOTPROT fuse at all).

If there is a problem with the external crystal and you're using a crystalless bootloader, after a double tap reset, you'd expect to see the board connecting to the host computer/Arduino IDE, as well as the LED pulsing. It should be possible to upload the sketch, however it will fail to run the moment crystalless bootloader hands over to the crystal driven core code.

The board's core code can also be switched to crystalless operation, by inserting the -DCRYSTALLESS flag into the compiler command line in the board's core code "boards.txt" file, for example on the Adafruit Itsy Bitsy M0:

adafruit_itsybitsy_m0.build.extra_flags=-D__SAMD21G18A__ -DCRYSTALLESS -DADAFRUIT_ITSYBITSY_M0 -DARDUINO_SAMD_ZERO -DARM_MATH_CM0PLUS {build.usb_flags}

@fbasaris When testing newly developed boards, I usually build and test two, since I find that this allows them to be compared and constrasted against each other, especially when hand soldering surface mount prototypes.

At the extreme, one board might work perfectly, while the another (speaking for myself) can be a nightmare. If you know that certain functionality works on one board but not on another, it enables hardware issues such as componenet placement/orientation or dry solder joints to be isolated, pinpointed and resolved more easily.

I would assume that the arduino bootloader does not recognize the custom bootloader on the chip.
In theory you should upload the arduino bootloader (via the icsp or debug port), then remove the part that calls for the debug chip.
Alternatively, I think it might be because of the fact that the chip does not have a dedicated bootloader part and thus resetting (erasing) the board will mean that all of the flash will be erased (which include the bootloader).
What might have happened (on a normal zero) is that the zero receives the sketch, gives the programmer (16U2) the sketch, tell it to reset (and write the zero).

In that case I would simply give everyone else programmers. Does Arduino ICP not work?