SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By g1pete
#141854
I somehow managed to wipe my bootloader. I think I managed to program the bootloader again using the AVR Pocket Programmer and the DiskLoader-Leonardo.hex file in the Arduino/hardware/arduino/bootloader/diskloader folder, but since then I cannot connect it to my Windows 7x64 machine. In the Device manager I get "Unknown Device" under the USB controllers, Error Code is 43. I tried uninstalling, re-installing - nothing works. If I tryt to upgrade the driver, windows tells me that the driver software is up to date and shows it as "Unknown Device". I removed all oem.inf files in the Windows/inf folder which referred to Sparkfun micro pro or Leonardo.
Up until the bootloader incident, all was just dandy.
So, any ideas of what I messed up and how I could get it back working again? Does the Pro Micro need a special bootloader or can I use the one from the Arduino collection?

Pete
By pedroid
#143137
I may have a similar problem... well... my board just stopped working and I could no longer upload sketches to it. It's the SparkFun Pro Micro 16MHz/5v. Did you find a solution to your problem? I may be headed down the same road where I have to reprogram the boot loader.

Thanks.
By smitty11
#144484
I don't know if I have a bootloader issue or not but both of my Pro Micro's have stopped working. When connected all I get is "USB Device not Recognized" and I can't do anything with it. Has anyone else ran into this issue?
By g1pete
#145061
Finally got back into looking at my driver/bootloader issue.
I thought that I did reprogram my Pro Micro with the Leonardo bootloader, well I was wrong. Whatever I programed into the Pro Micro was not the correct bootloader. So I tried again with the new released Arduino 1.01

Here is what I did:
Installed the latest Arduino 1.01
connected the AVR Pocket programmer from Sparkfun to my Windows 7 box
used 6 jumpes to connect VCC, GND, MISO, MOSI, SCK and RESET from the AVR Pocket programmer to the Pro Micro
started Arduino, under Tools->Board I selected Arduino Leonardo
under Tools->Programmer I selected USBtinyISP
lastly under Tools select Burn Bootloader
this starts the programming of the Leonardo Bootloader onto the Pro Micro
Be patient, it takes some time and there is no indication things are working. But once all is done, the two yellow LED's lit up.
From here I installed the driver as shown here: http://arduino.cc/en/Guide/ArduinoLeonardo

Edit: might have spoken too soon. Initially all looked good, it showed me Leonardo was found and gave my COM13 as serial port. Once I tried to download sketch, all disappeared and the Device manager goes through enumaration when I plug the Pro Micro in, but eventually settles on Unknown Device under the USB controllers, no new com port is showing up. So back to the drawing board.
By Archegar
#146005
I fixed my promicros' bootloader issue! And for posterity's sake here's how I did it:

1. Purchased Sparkfun Pocket Programmer
http://www.sparkfun.com/products/9825
2. Installed winAVR
http://sourceforge.net/projects/winavr/files/
3. Downloaded the promicro "add-on" folder, which contains the appropriate HEX file
http://www.sparkfun.com/products/11098 under documents section
4. Open command prompt and navigate to where that .hex file is. It Should be something like "...\proMicro\bootloaders\diskloader"
5. Type the following:
avrdude -c usbtiny -B 1 -patmega32U4 -U flash:w:DiskLoader-ProMicro16.hex

And just like that, you have the bootloader back on! make sure you have installed the drivers correctly and everything should work. If any problems arise, I'll make a note!

A few useful notes:
- I originally tried to burn the bootloader on using the Arduino IDE but never got it to work.
- Using jumper wires is just fine for the pocket programmer, and to save you some time here's what's what:
GND => GND
RST => RST
VCC => VCC
SCK => D15
MISO => D14
MOSI => D16
- Don't feel bad about buying the pocket programmer as it can be very useful. For example, before I tried burning the bootloader back on, I was able to burn sketches DIRECTLY to the atmega32U4, which saves some flash space (~2K maybe?).
- Finally, a few steps would most likely have to be changed if using a different programmer. I just thought the pocket programmer was small, cheap, and easy to use.
*edit: I used the right pins, but wrote the wrong ones! The current pins are correct now :)
By pvmellor
#146959
I'm in the same boat - my pro micro was working fine, then it stopped. I am very pleased to see from this thread that there might be a way forward by re-burning the bootloader.
Still, i am interested in why this happened in the first place. Would anyone care to comment on what they think they did to cause this? Can a rogue sketch corrupt the bootloader - i had thought not?

Personally i had foolishly tried to configure all the digital pins from 1 to 20 plus as outputs and then pulse them to try and find the one that was connected to the TX LED (only now do i realise that there isn't one). Perhaps this had somehow caused the problem?

When i power up the Pro Micro the two LEDs flash momentarily, which i thought meant the bootloader was ok - but i can no longer get a sketch to load (the IDE (v1.0.1) times out and the LED's do not flash). Yet i can program other boards with this setup.
By Stephanie
#147003
pvmellor wrote:Can a rogue sketch corrupt the bootloader - i had thought not?
I don't know about corrupting the bootloader, but a rogue sketch can make it 'almost impossible' to get to the bootloader by normal means.

The way the Pro Micro bootloader works (and the same goes for the leonardo, they are very very similar) is if the virtual serial port (the CDC port as part of the USB files) is set to 1200 baud, there is a command which sends to the uC out of your sketch and to the start address of the bootloader. However, if the serial port is constantly busy, or disabled, or some other interrupt-heavy stuff is going on that prevents it from acknowledging the 1200 baud connection, then the Pro Micro does not automatically jump to the bootloader.

The trick I found was to add a reset button (connect RST pin to ground) and press it just after you click the 'upload' button in the IDE. It might take a few tries as the timing has to be *exact* but when you get it right, the IDE / avrdude does the upload right when the bootloader is ready for it, and all is well.

(The leonardo is different in that it has a reset button already, and the 1.0.1. IDE upload routine has a 'pause' function that waits for the Leonardo bootloader; the pro micro does not have either of these luxuries. So a bootloader problem with the leo is easily fixed with a button press, with the Pro Micro it's a bit more involved.)

Cheers!
By pvmellor
#147169
Stephanie,
OK that's interesting - i will give it a try tonight.

Could you explain how the bootloader gets run (or point me to somewhere that can)? i see from the 32U datasheet that there are three ways to get there 1) jump/call from your application program, 2) set the BOOTRST fuse so that a reset takes you there, or 3) with the external hardware boot enable. I'm guessing that its not the latter, so i'm wondering about the first two.
By Stephanie
#147626
pvmellor wrote:Stephanie,
OK that's interesting - i will give it a try tonight.

Could you explain how the bootloader gets run (or point me to somewhere that can)? i see from the 32U datasheet that there are three ways to get there 1) jump/call from your application program, 2) set the BOOTRST fuse so that a reset takes you there, or 3) with the external hardware boot enable. I'm guessing that its not the latter, so i'm wondering about the first two.
Sorry for the long delay in getting back to you.

When you try and upload a sketch, the IDE opens the serial port at 1200 baud then closes it again. There is some code within the Arduino core, in CDC.cpp, which watches for this. When it sees the USB virtual serial port open at 1200 baud then close, it turns on the watchdog timer with a 120mS delay. From CDC.cpp:
Code: Select all
			// auto-reset into the bootloader is triggered when the port, already 
			// open at 1200 bps, is closed.  this is the signal to start the watchdog
			// with a relatively long period so it can finish housekeeping tasks
			// like servicing endpoints before the sketch ends
What I had discovered in some testing, was that if you are running a sketch which is writing to the virtual serial port without any delay or pause, then the Pro Micro does not let the port close, and therefore cannot 'see' the host computer opening and closing the port at 1200 baud.

The problem with the click & reset or reset & click is that the timing really has to be perfect. The IDE does not pause or try again, so if avrdude doesn't catch the bootloader at the right moment, it fails. There is a special bit of code hardwired into the IDE for the Leonardo where the IDE will wait and retry a bunch of times, but it only does that if the leonardo bootloader is specified in the boards.txt file.

A last resort if you just can't get it to work via the bootloader, is to use an AVR ISP programmer (or if you have another arduino, use that as an ISP) and re-burn the bootloader. That will eliminate any problem sketch and get you back to a 'brand new' working state.
By ShaunFin
#176639
I am struggling to upload the Pro Micro bootloader onto a atmega32u4 I got from sparkfun. I am using an arduino uno as ISP. I have successfully uploaded the arduino leonardo and micro bootloaders to the chip, but no such luck trying to upload pro micro bootloader. The bootloader seems to initiate correctly and I get lots of blinking light from the uno, and even a "Done Burning Bootloader" message from IDE; however, I also get an error LED indicator on pin 6 and a slowly pulsating LED indicator on pin 32 showing a failure. Also my computer does not recognize or acknowledge the chip on a USB port.

The ultimate goal is to use the chip in a 3V application which requires 8MHz, but as for now I cannot upload 5V version or 3V version, changing the oscillator frequency accordingly.

Thanks for any ideas
User avatar
By Ross Robotics
#176667
Maybe you could start your own thread instead of digging up a 2 yr old one?