"Upload using programmer" and fuses question

Hi all,

I am troubleshooting a pro mini with Serial problems, so I started using "upload using programmer" and there is something I don't understand with the process.

I use Minicore with those fuse settings: 0x62 0xD6 0xFF. If I understand correctly the "IDE way" is to first burn the fuses by selecting "Burn bootloader", and then to upload the sketch using "Upload using programmer"?

My programmer is Arduino as ISP, and both operations complete successfully; however if I then run Nick Gammon's board detector I get this output: "Using bootloader: Yes"

I understand that the fuses were burnt as part of burning a bootloader, but doesn't that create a problem if I later upload a sketch w/o a bootloader?

A fuse calculator shows that my fuses currently correspond to:

Boot flash section size=256; Boot start address = $3F00; BootSZ=11 Boot Reset vector enabled (default address=$0000)

... aren't those settings a problem when there is in fact no bootloader in flash?

Thanks! Franck

doesn't that create a problem if I later upload a sketch w/o a bootloader?

Yes, at least theoretically. In practice, it won't matter unless your sketch exceeds 32256 bytes; the AVR will start at the beginning of the bootloader section, but it will be "erased" memory, which turns out to be a harmless instruction that will shortly wrap around to the beginning of program memory where your actual sketch is.

westfw:
Yes, at least theoretically. In practice, it won’t matter unless your sketch exceeds 32256 bytes; the AVR will start at the beginning of the bootloader section, but it will be “erased” memory, which turns out to be a harmless instruction that will shortly wrap around to the beginning of program memory where your actual sketch is.

Hmmm, that sounds sketchy. By which I mean, can I be 100% sure that if I see this in the “Upload using programmer” output:

avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip

… then the bootloader section has indeed been properly erased?

I could use avrdude to unprogram the boot reset vector (BOOTRST=1)… but if reading the datasheet I can’t quite figure out what the other fuse settings should be even though it states “If no Boot Loader capability is needed, the entire Flash is available for application code”.
The BOOTSZ fuse only lets you choose between 256 to 2048 words??

Franck

You'd want to turn off (set to one, I think) the BOOTRST fuse, which is what enable USING the BOOTSZ bits.

westfw: You'd want to turn off (set to one, I think) the BOOTRST fuse, which is what enable USING the BOOTSZ bits.

Ah ok, I was looking for something like that but couldn't find it in the datasheet.

Thanks! Franck

Interesting :)

But if you select in MiniCore bootloader: no and burn the "bootloader" doesn't that set the fused to no bootloader?

septillion: Interesting :)

But if you select in MiniCore bootloader: no and burn the "bootloader" doesn't that set the fused to no bootloader?

Ahh, great, I was using minicore 1.0.2 which doesn't have that option... time to upgrade :)

Thanks!