newbie question about virtual boards


I probably messed up something....
I was playing around with a Board and using Arduino uno as programmer. I did some testing and created a new board in the IDE with a different clock (1Mhz) and different fuse values.
So far so good....

Then I got another board and tried to upload a sketch with Arduino IDE. I forgot to switch the board from my custom one to the proper one. I uploaded the sketch. The board (based on atmega32U4) started to behave in a strange way. I realized that I selected the wrong board in IDE. I thought it was a matter of switching to the correct one and re-upload the sketch....but it looks like it does not work as that possible? May be I bricked up something?

How did you upload it? If you did it over isp, you need to reborn bootloader, because uploading sketch via isp erased the bootloader.

How did you upload a sketch ? Using a bootloader via RX, TX or with a programmer with MISO, MOSI, SCK ?
When a sketch is uploaded with a programmer, the bootloader is removed.

Can you please tell us what you mean with: "started to behave in a strange way" ? That is a very mysterieus sentence. Perhaps your Arduino was making R2-D2 noises, and now it is meowing like a cat :smiley_cat: ? Or the red leds are now green :grin:

(while I was typing this, DrAzzy already asked the same question)


I uploaded the sketch just using the usb connection to the board, not with a programmer...that is what surprised me.

eh eh eh....strange ways, I mean that the skecth starts, then it stops running without a reason, the board resets...

The serial communication with the ATmega32U4 via the usb does not really use the baudrate. However, it does detect 1200 baud to reset the bootloader when a sketch needs to be uploaded.
The (virtual) serial port is for a part inside the ATmega32U4. When the computer sets the baudrate to 1200, the bootloader can detect that the baudrate has been set to 1200.
Because of that the bootloader must still be compiled for that specific clock speed (1MHz) to detect the 1200 baud properly.

Thank you Peter!

But, one question: is possible that by using the virtual board setting (by mistake) of a different board, is going to break up something?
Because this is what happened. I just forgot to switch the settings, uploaded the sketch (with usb connection from IDE), and from this point it looks the board is not stable any more.

I think that is not possible (but I'm not 100% sure). Even changing fuses or lock bits and uploading a wrong sketch or using a wrong bootloader, that should not damage something.

Perhaps there was a voltage glitch at the same time. Or your new board has not all the GND and all the VCC and AVCC connected properly, or the crystals have wires that are too long. Or you forgot a diode at the reset and the bootloader has been corrupted.

I tell you one more thing: before doing this “wrong” upload in the IDE, I checked the signature with avrdude and Arduino uno as programmer, with the following command:

./avrdude -C …/etc/avrdude.conf -c avrisp -b 19200 -P /dev/ttyACM0 -p m32u4 -v

It was correctly reporting the m32u4 signature

After my wrong sketch upload (remember, just with direct USB connection, without a programmer), the same command returns a 000000 signature…

Does this tell you something?

Thanks so much

No... yes... maybe :confused:
Uploading a sketch does not change the fuses or the signature. Requesting a signature is very basic and that should work. When the signature is all zero, perhaps one of the MISO, MOSI, SCK is not connected anymore. When you connected the USB, did you do something to the reset pin as well ? I still think that something else is going on, and it did not happen by just uploading a sketch.
The single -v gives short info, and the tripple -vvv gives full info.

If you can upload a sketch, it would be fun to read the signature from within the sketch. That results into a valid signature of course.

You are right!

By loading a sketch the signature and fuses are what they should be...
I have to check the programmer connections now...I'll let you know

Connection seems to be fine.....I have to search somewhere else....

It is possible that one of the pins of the ATmega chip is damaged. It is also possible that a part of the chip inside the ATmega is damaged. Those things do happen. Perhaps it is best to use a new ATmega32U4.

It was the cable: even if it was looking ok, I created a new one, and with this one is working.