How to use -F command to burn bootloader?

This error might be caused by having the wrong port selected from the Tools > Port menu in Arduino IDE. COM1 is typically the internal serial port of your computer's motherboard, not the port of a connected Arduino board.

Please perform this experiment to verify that the port you have selected is your Arduino board:

  1. Disconnect the USB cable of the Arduino board from your computer.
  2. Select Tools > Port from the Arduino IDE menus.
  3. Take note of the ports (if any) listed in the menu.
  4. Close the Tools menu.
    :red_exclamation_mark: The ports list is only updated when the Tools menu is re-opened, so this step is essential.
  5. Connect the Arduino board to your computer with a USB cable.
  6. Select Tools > Port from the Arduino IDE menus. - If a new port is listed in the menu, that is the port of your Arduino board.

If you saw a new port appear at the last step, select that port from the Tools > Port menu and try uploading again.

If this doesn't solve the problem, please reply here on this forum topic with the answers to the following questions:

  • While following those instructions, did you see a port in the Tools > Port menu at step (6) that was not present at step (3)?
  • If you did see a new port, was the upload successful after you selected that port?

This USB to Serial adaptor works on my other Pro Mini's and the port is also COM1.

Device Manager shows COM1 there no other ports and the Port disapear when unpluged.

image

I recently received a clone Pro Mini from the Far East which had a 328PB on it. And it programmed as a Pro Mini in the IDE. I was curious about that, and used AVRDudess to extract the bootloader code that was on the chip. Then I found that it was byte-for-byte identical to the bootloader specified for the 5V Pro Mini in boards.txt.

But I also found that this same bootloader is the "old bootloader" specified for the Nano. That bootloader has the 328P signature hard-coded in it, which is what it reports to the IDE. That's why my 328PB Pro Mini looks like a 328P Pro Mini to the IDE, and that's why it programs successfully.

And that's also why when you reflashed the Pro Mini as an old-bootloader Nano, it started working again. That's the exact bootloader the IDE expects a 5V Pro Mini to have.

Since there is no "new" bootloader for the Pro Mini, at least in v1.8.19, then obsolete or not, that's the latest bootloader for the Pro MIni. If you want to use some other bootloader for it, you'll have to call it something else in the IDE.

It's still not clear to me how you can flash any bootloader to a Pro Mini with a 328PB MCU using the IDE since there's a signature mismatch. But maybe the -F makes that work.

Thanks , very interesting!

After some research I , it seems like the Signature is hard code and NOT part of the bootloader.

Dumping various bootloaders into the Pro Mini , the Signature remains unchanged.

How are you reading the signature, through the ISP interface or though the bootloader? The processor has a hard-coded signature that will be read through the ISP interface, but the bootloader also hard-codes a signature into its code when it is compiled, and does not read the signature from the processor hardware.

The source code for the bootloader is located in the board package, on a linux machine it is located at the following location:

~/.arduino15/packages/arduino/hardware/avr/1.8.8/bootloaders/atmega/ATmegaBOOT_168.c

I do not have the hardware to do any testing, but I would assume that uploading code via ISP would read the actual processor hardware signature, so you would need to upload through the serial interface using the bootloader if you wanted to use a 328PB as a 328P.

It is not quite correct.
There are two signatures in your chip - the first is hard coded in the chip and doesn't change by reflashing the bootloader; and the second is the part of bootloader and can be changed.

This leads to a simple conclusion: you can only flash your board as an ATmega328P if you use the bootloader. If you're flashing the chip besides the bootloader, you should choose the ATmega328PB.

You can accomplish this by installing a 3rd party platform that provides support for the ATmega328PB, then selecting the board from that platform from Arduino IDE's Tools > Board menu.

As mentioned previously, the recommended 3rd party platform for this target is MiniCore. I believe there are also a couple alternative platforms such as "XMiniCore" and "Atmel AVR Xplained-minis".

OK, that disproves my hypothesis. It was worth checking just to be sure.

I manage to get my Pro Mini back to work with the intended Pro Mini selection in the Arduino ide.

I read the Flash from a working Pro Mini and write that to my bricked Pro Mini and now the board is working as a Pro Mini.

For the benefit of future readers, can you clarify how you did that?

I made a adaptor pcb with header pins for the Pro Mini.

Use Microchip Studio to read the memory.
Save the HEX file and load the HEX file and write it to my bricked ProMini.
The board reads as 328PB but program with the Arduino ide as 328P.

ProMiniHex.hex (90.0 KB)

Thanks. I think the same could be done with AVRDudess using an Arduino_as_ISP setup. But I've never tried it.