Error burning bootloader to A-star 328PB

Hi. First and foremost, thanks for developing awesome support for the 328PB chip.

I am using Arduino 1.8.8 to burn bootloader onto 328PB.
Tools:
Board: “Pololu A-Star 328PB”
Version: 3V, 8Mhz
Programmer: “AVRISP mkII for Pololu A-Star 328PB”

As you can see in the output below, In several places it says writing failed, and a warning that the fuse values are wrong. I can still upload sketches afterwards however (I don’t have a serial connection in my application and “upload using programmer”), so it seems that the fuses have been written. I’m just concerned that the appropriate values have been written.

Have you seen this before and do you think I have a problem? Thanks.

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -C+C:\Users\Matt\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\4.0.2/extra_avrdude.conf -v -patmega328pb -cstk500v2 -Pusb -B 5 -e -Ulock:w:0xFF:m -Uefuse:w:0xF5:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
         Additional configuration file is "C:\Users\Matt\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\4.0.2/extra_avrdude.conf"
avrdude: warning at C:\Users\Matt\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\4.0.2/extra_avrdude.conf:1: part m328pb overwrites previous definition C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf:8802.

         Using Port                    : usb
         Using Programmer              : stk500v2
         Setting bit clk period        : 5.0
avrdude: usbdev_open(): Found AVRISP mkII, serno: 0000B0026998
         AVR Part                      : ATmega328PB
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel STK500 Version 2.x firmware
         Programmer Model: AVRISP mkII
         Hardware Version: 1
         Firmware Version Master : 1.23
         Vtarget         : 3.2 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9516 (probably m328pb)
avrdude: erasing chip
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -C+C:\Users\Matt\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\4.0.2/extra_avrdude.conf -v -patmega328pb -cstk500v2 -Pusb avrdude: reading input file "0xFF"
-B 0.5 -Uflash:w:C:\Users\Matt\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\4.0.2/bootloaders/optiboot/optiboot_atmega328pb_8mhz.hex:i avrdude: writing lock (1 bytes):
-Ulock:w:0xCF:m 

Writing |  ***failed;  
################################################## | 100% 0.04s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0xFF:
avrdude: load data lock data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% -0.00s

avrdude: verifying ...
avrdude: WARNING: invalid value for unused bits in fuse "lock", should be set to 1 according to datasheet
This behaviour is deprecated and will result in an error in future version
You probably want to use 0x3f instead of 0xff (double check with your datasheet first).
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xF5"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xF5:
avrdude: load data efuse data from input file 0xF5:
avrdude: input file 0xF5 contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDE"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDE:
avrdude: load data hfuse data from input file 0xDE:
avrdude: input file 0xDE contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% -0.00s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.  Thank you.


avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"
         Additional configuration file is "C:\Users\Matt\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\4.0.2/extra_avrdude.conf"
avrdude: warning at C:\Users\Matt\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\4.0.2/extra_avrdude.conf:1: part m328pb overwrites previous definition C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf:8802.

         Using Port                    : usb
         Using Programmer              : stk500v2
         Setting bit clk period        : 0.5
avrdude: usbdev_open(): Found AVRISP mkII, serno: 0000B0026998
         AVR Part                      : ATmega328PB
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel STK500 Version 2.x firmware
         Programmer Model: AVRISP mkII
         Hardware Version: 1
         Firmware Version Master : 1.23
         Vtarget         : 3.2 V
         SCK period      : 0.50 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9516 (probably m328pb)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "C:\Users\Matt\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\4.0.2/bootloaders/optiboot/optiboot_atmega328pb_8mhz.hex"
avrdude: writing flash (32768 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against C:\Users\Matt\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\4.0.2/bootloaders/optiboot/optiboot_atmega328pb_8mhz.hex:
avrdude: load data flash data from input file C:\Users\Matt\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\4.0.2/bootloaders/optiboot/optiboot_atmega328pb_8mhz.hex:
avrdude: input file C:\Users\Matt\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\4.0.2/bootloaders/optiboot/optiboot_atmega328pb_8mhz.hex contains 32768 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% -0.00s

avrdude: verifying ...
avrdude: 32768 bytes of flash verified
avrdude: reading input file "0xCF"
avrdude: writing lock (1 bytes):

Writing |  ***failed;  
################################################## | 100% 0.03s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0xCF:
avrdude: load data lock data from input file 0xCF:
avrdude: input file 0xCF contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: WARNING: invalid value for unused bits in fuse "lock", should be set to 1 according to datasheet
This behaviour is deprecated and will result in an error in future version
You probably want to use 0x0f instead of 0xcf (double check with your datasheet first).
avrdude: 1 bytes of lock verified

avrdude done.  Thank you.

Hello.

What AVR programmer are you using and which version of the A-Star 328PB are you trying to program?

- Amanda

Hi Amanda

These are the options I select under Tools in Arduino IDE:
Board: “Pololu A-Star 328PB”
Version: 3V, 8Mhz
Programmer: “AVRISP mkII for Pololu A-Star 328PB”

I am programming with an AVRISP mkII.

The output shows a problem burning the lock bits, but I’m guessing that they get burned correctly anyway. According to the data sheet the unused bits 7 and 6 are ones by default, so I don’t know why the output says they should be zeros.

Are you actually using a Pololu A-Star 328PB Micro 3V, 8Mhz board?

- Amanda

Hi Amanda

No, I’m programming a factory fresh 328PB

Hello.

We have seen error messages about unused lock bits like that before, and I do not think you have a problem.

–David

Thanks Amanda and David

Love your work, Cheers

Matt.

Hi,
Sorry for reawakening this old topic…
was this resolved ??
boggydew, did you found a away to resolve your issue ??

kind regards

No, I just ignore the warning. Everything works, fine regardless.

Boggydew,
Thanks very much for the reply.
Can you help ?
I’m burning the bootleader to an atmega328pb
but i’m most definitely missing something.
I have followed the instructions on the pololu site but i believe fresh builds
a lot of dealing with bit locks and fuses settings etc etc.
please, care to look at this topic for me ?
I’m probably doing everything wrong.

tell me what i’m missing and what was your setup.

Thanks,

Sorry, I can’t be of much help. I’m a noob! I haven’t updated my arduino IDE since 1.8.8. My build uses a 8MHz crystal. Under Tools, I select Board: " Pololu A-Star 328PB", Version: " 3.3V, 8MHz", Programmer: “AVRISP mkII for Pololu A-Star 328pb”, I click " Burn Bootloader" and it just works.

boggydew,
Thanks, this old post has helped me quite a lot
by the way what are the capacitors you’re using for your 8MHz crystal??

Crystal part no: ECS-80-18-30B-AGN-TR
caps: 27pF GRM1555C1H270FA01D