Hi - I've poked around the forum and found similar issues, but no solution. Have an ItsyBitsy 32U4 5v 16mhz that I use as a quick and dirty password entry tool. Have been using the same sketch in it for nearly a year. After updating IDE from 1.8 to 2.0.3 however, the sketch uploaded and, after indicating successful upload, the USB connection dropped. Device is longer recognized.
I've tried the bootloader trick described in another thread, but when I do the double press on reset, the LED only pulses for 10 seconds, then goes out and the connection drops again. Tried the Double Press->Upload->Double Press trick in that same thread and still no go. Curious if there is a utility or sequence that can re-init the board and restore the USB stack? I appreciate any insights you can share. Thanks in advance.
Did you change the sketch?
Which operating system?
I'm not familiar with the ItsyBitsy 32U4 but for other boards with native USB (e.g. Leonardo, Pro Micro) these problems are often caused by a bug in the sketch.
Part of the code that you uploaded to the board contains code to identify the board to the operating system and to react on the software reset (open/close port with baud rate of 1200 baud). A bug in a sketch can corrupt the variables used by those functionalities.
If it is a bug in the code and it did not show in earlier versions of the IDE, you can compare the hex files that are generated by the two versions of the IDE; if they differ you have to find out why. Different compiler versions, different compiler settings, different library versions, different board package versions can all contribute to a different hex file.
The 10 seconds pulsating LED is the bootloader; once it times out, it handles control over to your sketch.
Using the double-tap reset, I would upload an innocent sketch (blink or empty); does the board still disappear after the upload?
Yes, uploading a correct sketch. Try the reset sequence and upload a simple sketch (the "Blink" example), this will most probably bring you the functionality back.
Post your sketch if you need help fixing it.
Your sketch was probably buggy before but the compiler in the old version generated slightly different code so the error showed up differently, in a way the USB code wasn't fooled.
Thanks for the reply ... board still errors when connected after attempting to upload blink or empty sketches. My sketch is below. It seems pretty basic ... any corrections you can suggest would be greatly appreciated.
#include <Keyboard.h>
#define Button1 7 // Declare Button1's Pin # == 7.
#define Button2 5 // Declare Button2's Pin # == 5.
char P1 [] = "Password1"; // Init Green-button String
char P2 [] = "Password2"; // Init Red-button String
void setup()
{
pinMode(Button1,INPUT); // Init Button Inputs
pinMode(Button2,INPUT);
Keyboard.begin(); // Init Keyboard functions
} // End - void setup()
void loop() // repeatedly check for changes in either button state
{
int Button1State = digitalRead(Button1); // read state of Button1 input
int Button2State = digitalRead(Button2); // read state of Button2 input
if (Button1State == LOW) // If LOW state 0V because of button press
{
Keyboard.print(P1); // Send this string as keystrokes
delay(1000); // Wait 1 second for send to clear
} // End - if
if (Button2State == LOW) // If LOW state 0V because of button press
{
Keyboard.print(P2); // Send this string as keystrokes
delay(1000); // Wait 1 second for send to clear
} // End - if
} // End - void loop()
Posting to follow. Have the same problem with a Longan CanBed V1.2e that uses Atmega32U4 Leonardo chip. Have not yet been able to upload any code to this board. I get
avrdude: ser_open(): can't open device "\.\COM12": Access is denied.
Failed uploading: uploading error: exit status
The Bootloader is on Com 12, but "static board is on Com 8.
Which version of the IDE? I think that there's a known bug in IDE2.0 where you have to close the Serial Monitor before uploading; only applies to certain boards and I can't remember if I have experienced it.
Attempting? You mean you didn't succeed? If you cannot upload a Blink sketch after putting the board into bootloader mode or it doesn't blink the internal LED afterwards you don't have to try anything else before we fixed that problem.
I guess the actual passwords are different. Did you actually try it with exactly the posted sketch?
Thanks so much for the replies ... I'm getting a much better idea of how these work now.
I don't think any of the sketches have uploaded successfully ... the board only shows up with a COM port in the IDE for the 10 secs that the bootloader was running ... once the red light goes out, it flips to "not connected" ... USB always drops partway through the compile/upload process, and board is still unrecognized. I did try the sketch exactly as posted.
I'm beginning to suspect that there's an issue with my IDE installation or workstation environment ... The IDE jump was, after all, the major change that had occurred prior to this problem presenting. Mulling that over now.
Do you have another board like Mega, Nano or Uno? If so, connect both the ItsyBitsy and the other board.
In the IDE, select the ItsyBitsy as the target and select the port of the other board.
Upload an empty sketch.
When the IDE reports the memory usage, double tap the reset on the ItsyBitsy; you have a couple of seconds (on a Leonardo it's about 8 seconds) so don't stress.
If you still have the legacy IDE (e.g. 1.8.x) installed you can also use the following approach. I have not managed to get this working in IDE 2.0
Double tap the reset on the the ItsyBitsy to invoke the bootloader.
In the IDE, select the (bootloader) port of the ItsyBitsy.
Upload an empty sketch.
When the IDE reports the memory usage, double tap the reset.