PonyProg :  PonyProg Phorum PonyProg
PonyProg open discussion 
BOOT and BODLEVEL configuration bits swapped?
Posted by: chupo_cro ()
Date: September 29, 2017 02:49PM

I've been using PonyProg for years and this is the first time I have a problem. I got some Arduino Nano (ATmega328p) boards and wanted to backup the bootloader before erasing the chip. I was surprised when I saw BOOTSZ1, BOOTSZ0 and BOOTRST are unchecked (unprogrammed, bit = 1) and the bootloader does work!! The bootloader worked even after uploading the first .hex meaning the code does NOT start at 0x0000 and eventually reaches the bootloader. By checking the fuse bits with Avrdude and usbasp programmer I got: Extended=0x07, High=0xda and Low=0xff meaning BOOTRST and BOOTSZ1 *ARE* programmed (checked, bit = 0). Then I noticed PonyProg is showing BODLEVEL0 and BODLEVEL2 as checked - which they are not. I compared the flash end eeprom read by PonyProg and avrdude + usbasp and these were identical. The only difference is when reading BOOTxxx configuration bits.

Can anybody confirm that PonyProg shows BODLEVEL bits checked instead of BOOTxxx bits? I have version:

PonyProg2000 - Serial Device Programmer - mod by RG (v1.0a) Version 2.08c Beta Nov 18 2013

Chupo_cro



Edited 1 time(s). Last edit at 09/29/2017 02:53PM by chupo_cro.

Options: ReplyQuote
Re: BOOT and BODLEVEL configuration bits swapped?
Posted by: sonix ()
Date: September 29, 2017 08:53PM

Dear Chupo_cro,

thanks for your report. I have analyzed it and fixed. You are right. The bit labels for BODLEVEL2, BODLEVEL1, BODLEVEL0 from extended fuse byte were swapped with high fuse byte bits BOOTSZ1, BOOTSZ0, BOOTRST. It was my fault. My apologize. I had copied it from AtMega168 and did not see the difference at first sight when I was added it to PonyProg in June of 2012.

I have attached precompiled Windows executable.

Could you please check it?


Yours sincerely
sonix

chupo_cro Wrote:
-------------------------------------------------------
> I've been using PonyProg for years and this is the
> first time I have a problem. I got some Arduino
> Nano (ATmega328p) boards and wanted to backup the
> bootloader before erasing the chip. I was
> surprised when I saw BOOTSZ1, BOOTSZ0 and BOOTRST
> are unchecked (unprogrammed, bit = 1) and the
> bootloader does work!! The bootloader worked even
> after uploading the first .hex meaning the code
> does NOT start at 0x0000 and eventually reaches
> the bootloader. By checking the fuse bits with
> Avrdude and usbasp programmer I got:
> Extended=0x07, High=0xda and Low=0xff meaning
> BOOTRST and BOOTSZ1 *ARE* programmed (checked, bit
> = 0). Then I noticed PonyProg is showing BODLEVEL0
> and BODLEVEL2 as checked - which they are not. I
> compared the flash end eeprom read by PonyProg and
> avrdude + usbasp and these were identical. The
> only difference is when reading BOOTxxx
> configuration bits.
>
> Can anybody confirm that PonyProg shows BODLEVEL
> bits checked instead of BOOTxxx bits? I have
> version:
>
> PonyProg2000 - Serial Device Programmer - mod by
> RG (v1.0a) Version 2.08c Beta Nov 18 2013

Attachments: PonyProg208d_RG101h.zip (218.1 KB)  
Options: ReplyQuote
Re: BOOT and BODLEVEL configuration bits swapped?
Posted by: chupo_cro ()
Date: September 29, 2017 10:42PM

sonix Wrote:
-------------------------------------------------------
> Dear Chupo_cro,
>
> thanks for your report. I have analyzed it and
> fixed. You are right. The bit labels for
> BODLEVEL2, BODLEVEL1, BODLEVEL0 from extended fuse
> byte were swapped with high fuse byte bits
> BOOTSZ1, BOOTSZ0, BOOTRST. It was my fault. My
> apologize. I had copied it from AtMega168 and did
> not see the difference at first sight when I was
> added it to PonyProg in June of 2012.
>
> I have attached precompiled Windows executable.
>
> Could you please check it?
>
>
> Yours sincerely
> sonix

Hi,

I have just checked and configuration bits are now as expected :-) Thank you very much for such a quick reply and for solving the problem!! I really love PonyProg and I am still hoping there will be a solution for using it with USB programmers (at full speed) one day.

BTW, it seems this problem was related to swapped labels:
http://www.avrfreaks.net/forum/bootrst-fuse-was-disabled-bootloader-code-executed

Thank you very much once again!
Best regards

Chupo_cro

Options: ReplyQuote


Return to LancOS.
Powered by Phorum.