USB port disappears after attempting to upload sketch

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
dpru
 
Posts: 5
Joined: Sat Dec 31, 2016 1:50 am

USB port disappears after attempting to upload sketch

Post by dpru »

Hey all,

I am having an interesting issue that I would love some input on. I am using a custom board, but it is very similar to (and based on) the Adafruit Grand Central M4. It uses the same microcontroller, the SAMD51P20A. I have created mt own board definition for my board, and I am using the Adafruit SAMD core (https://github.com/adafruit/ArduinoCore-samd).

Here is the issue:

(1) Initially, the board is empty except for the bootloader (I am using the Grand Central M4 bootloader). The bootloader shows up as COM40 on my machine.
(2) When I upload a sketch it works fine. The sketch begins to run, and it shows up as COM39 on my machine.
(3) Now, when I try to upload a sketch again (I click the "Upload" button in the Arduino IDE), it should be flipping back over to the bootloader (by forcing a reset using 1200 bps), and indeed it does seem to be forcing a reset, but the bootloader COM port never shows back up, and the upload fails to occur. In order for the upload to succeed, I must unplug the USB cable and then plug it back in. When I do this, the it shows up as the bootloader on COM40, and then I can upload a new sketch.

So basically, the "1200 bps routine" which is supposed to reset the board into bootloader mode and prepare it to receive a new sketch is not functioning properly - the USB serial port never shows up unless I unplug/plug the USB cable.

Any thoughts on what could be going on, and how to fix it?

For those who want to read more, here are some more interesting things:
1. I have another custom board using a SAMD21G17A, and I've loaded a custom bootloader onto it based on the original Arduino Zero's bootloader. I am experiencing the exact same issue with this board.
2. I have another custom board using a SAMD51P19A, and I've loaded a custom bootloader onto it based on the Adafruit Grand Central M4 bootloader. For this specific bootloader, I've changed the linking scripts to account for the fact that the SAMD51P19A has less program memory and less RAM than the SAMD51P20A. This bootloader works perfectly on this custom board. Why does this one work, while the others are not working? It is a mystery to me.

Locked
Please be positive and constructive with your questions and comments.

Return to “Metro, Metro Express, and Grand Central Boards”