Lost USB bootloader? Want to replace it

I've been using these boards diymore DM Strong Series Pro Micro Atmega32u4 Atmega32u4 AU Microcontroller Module for Arduino|Integrated Circuits| - AliExpress?

The supplier above sent me 3.3V board in error. When I programmed the first one using the arduino IDE, I didn't notice it showed as Lilypad USB, I programmed it as Leonardo and now it is not recognised by my PC.

For good measure I messed up a further 2 items in the same way. The 4th one I programmed as Lilypad and it works fine and I can re-program it.

I've not used the 6pin header before, but can I use that to load a Leanardo USB bootloader? (if that's the right terminology).

PS. If anyone who can fix them wants to make me an offer for the 4 of them, go ahead. Because I'm not sure when I'll find the time to try and fix them.

jimmer:
I've not used the 6pin header before, but can I use that to load a Leanardo USB bootloader? (if that's the right terminology).

Yes, you can, and yes that's the correct terminology. However, I don't think it will be necessary to do that. Try this:

Press and release the reset button on the LilyPad USB.

Select the port of the LilyPad USB from the Arduino IDE's Tools > Port menu. You need to wait a second or two for the port to be enumerated, but you also need to do this before the bootloader times out, so the timing is a little tricky. Note that the Tools > Port menu only updates after you close the Tools menu, so you can't just leave the Tools > Port menu open and wait for the port to appear.

Select the correct board from the Arduino IDE's Tools > Board menu.

Sketch > Upload

Watch the black console window at the bottom of the Arduino IDE window. When you see something like this:

Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

press and release the reset button on the LilyPad USB. The upload should now finish successfully. After that, the board should be fixed.

You will probably not be able to use the Arduino Web Editor for this, because it won't allow you to start an upload with no port selected. So use the regular Arduino IDE.

thanks for that advice, I've done something similar before when I messed something up. Unfortunately the trick of setting the upload going and then plugging in/resetting doesn't work this time. Just tried lots of times and it never shows as a com port in Tools/Port

Looking at windows device manager, the device never registers in the Ports section it just appears as unknown device under USB controllers.

OK, sorry to hear that. I don't own a LilyPad USB, so I couldn't test it out. I tried it the opposite way, bricking my Leonardo by uploading with LilyPad USB selected, and my instructions above were able to restore the Leonardo.

So the next thing I would try is to use a working Arduino board (your good LilyPad USB will work) as an "Arduino as ISP" programmer to burn the bootloader on the bricked boards. If you want, I can provide detailed instructions for that.

Aha! "Arduino as ISP" I like not having to buy extra hardware, and I've got plenty of AVR boards.

I've found the instructions, and will give it a go shortly. Thanks.

I've got "Arduino as ISP" working :slight_smile:

I can get the boards back to the original state now by loading the Lilypad USB bootloader. I tried setting board to Leonardo and then upload bootloader, it appears to work but the board then isn't recognised when I plug it into USB.

Maybe a dumb question, but the boards look identical to my Leonardo clones. Can I make these boards act like Leonardos ?

Maybe it's because there isn't an option to upload Leonardo bootloader? I see both Lilypad and Lilypad USB
in the board menu, and there is Leonardo but not Leonardo USB.

Also, I'm confused now that I see Lilypad is based on ATmega168 or ATmega328V, whereas this board has 32u4 chip.

It's not a big problem to use these as Lilypads, I haven't checked the pinouts but I can use these in a simple job.