Can't programm 328PB via TTL anymore after burning bootloader

Hi,

so i have a A-Star 328PB with a USB AVR Programmer v2.1 in Arduino IDE.
It all worked perfectly well until i burned a new bootloader on the board. Now its not possible to programm the 328PB via TTL anymore :neutral_face:

For burning the bootloader i used Minicore with the following settings:

Did i used some wrong settings?

If i want to upload a blank Sketch i get the following error message:

Sketch uses 1084 bytes (3%) of program storage space. Maximum is 32384 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\tools\avrdude\7.2-arduino.1/bin/avrdude" "-CC:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1/avrdude.conf" -v -V -patmega328pb -curclock -PCOM8 -b9600 -D -xnometadata "-Ueeprom:w:C:\Users\alexa\AppData\Local\Temp\arduino\sketches\640FE08B6C1DED61F2D6B68C0023748A/Blink.ino.eep:i" "-Uflash:w:C:\Users\alexa\AppData\Local\Temp\arduino\sketches\640FE08B6C1DED61F2D6B68C0023748A/Blink.ino.hex:i"
avrdude: Version 7.2-arduino.1
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS
         System wide configuration file is C:\Users\alexa\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\3.0.1\avrdude.conf
         Using Port                    : COM8
         Using Programmer              : urclock
         Overriding Baud Rate          : 9600
avrdude urclock_getsync() warning: attempt 1 of 10: not in sync
avrdude urclock_getsync() warning: attempt 2 of 10: not in sync
avrdude urclock_getsync() warning: attempt 3 of 10: not in sync
avrdude urclock_getsync() warning: attempt 4 of 10: not in sync
avrdude urclock_getsync() warning: attempt 5 of 10: not in sync
avrdude urclock_getsync() warning: attempt 6 of 10: not in sync
avrdude urclock_getsync() warning: attempt 7 of 10: not in sync
avrdude urclock_getsync() warning: attempt 8 of 10: not in sync
avrdude urclock_getsync() warning: attempt 9 of 10: not in sync
avrdude urclock_getsync() warning: attempt 10 of 10: not in sync
avrdude urclock_recv() warning: programmer is not responding; try -xstrict and/or vary -xdelay=100
avrdude main() error: unable to open programmer urclock on port COM8
avrdude done.  Thank you.
Failed uploading: uploading error: exit status 1

I already tried different Baud rates.

Hello.

Instead of using Minicore, can you try burning the original bootloader back onto your A-Star by following the instructions in “The A-Star 328PB Serial Bootloader” section of the A-Star 328PB user’s guide?

If you try that procedure and continue having trouble programming, could you post the new error message from your IDE, a screenshot of the programmer’s configuration utility software after a programming attempt, and some pictures that show all of your connections? Also, please try to confirm whether the bootloader is on the microcontroller. As described in the user’s guide section I mentioned before, you can reset the A-Star (e.g. by pressing the reset button) and look for three quick flashes of the yellow LED performed by the bootloader, followed by a second of inactivity with the LED off.

- Patrick

Hi Patrick,

first of all: Thanks for your Answer!

I tried the Pololu Bootloader before and the same error occur, but i can post all the detail here. This is the error i get after trying to programm the Pololu 328PB via TTL after burning the bootloader:

Sketch uses 2266 bytes (7%) of program storage space. Maximum is 32256 bytes.
Global variables use 234 bytes (11%) of dynamic memory, leaving 1814 bytes for local variables. Maximum is 2048 bytes.
“C:\Users\alexa\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude” “-CC:\Users\alexa\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf” -v -V -patmega328pb -carduino “-PCOM7” -b115200 -D “-Uflash:w:C:\Users\alexa\AppData\Local\Temp\arduino\sketches\640FE08B6C1DED61F2D6B68C0023748A/Blink.ino.hex:i”
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is “C:\Users\alexa\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf”
Using Port : COM7
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xfb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xfb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xfb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xfb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xfb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xfb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xfb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xfb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xfb
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xfb
avrdude done. Thank you.
Failed uploading: uploading error: exit status 1

For burning the bootloader i use the following settings:

For burning the bootloader i receive the following:

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

     System wide configuration file is "C:\Users\alexa\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM8
     Using Programmer              : stk500
     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
     Programmer Model: STK500
     Hardware Version: 15
     Firmware Version Master : 2.10
     Topcard         : Unknown
     Vtarget         : 3.3 V
     SCK period      : 8.7 us
     Varef           : 0.0 V
     Oscillator      : Off

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9516 (probably m328pb)
avrdude: erasing chip
avrdude: reading input file “0xFF”
avrdude: writing lock (1 bytes):

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

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.

“C:\Users\alexa\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude” “-CC:\Users\alexa\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf” -v -patmega328pb -cstk500 -PCOM8 “-Uflash:w:C:\Users\alexa\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\5.1.0/bootloaders/optiboot/optiboot_atmega328pb_12mhz.hex:i” -Ulock:w:0xCF:m

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

     System wide configuration file is "C:\Users\alexa\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM8
     Using Programmer              : stk500
     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
     Programmer Model: STK500
     Hardware Version: 15
     Firmware Version Master : 2.10
     Topcard         : Unknown
     Vtarget         : 3.3 V
     SCK period      : 8.7 us
     Varef           : 0.0 V
     Oscillator      : Off

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\alexa\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\5.1.0/bootloaders/optiboot/optiboot_atmega328pb_12mhz.hex”
avrdude: writing flash (32768 bytes):

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

avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against C:\Users\alexa\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\5.1.0/bootloaders/optiboot/optiboot_atmega328pb_12mhz.hex:
avrdude: load data flash data from input file C:\Users\alexa\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\5.1.0/bootloaders/optiboot/optiboot_atmega328pb_12mhz.hex:
avrdude: input file C:\Users\alexa\AppData\Local\Arduino15\packages\pololu-a-star\hardware\avr\5.1.0/bootloaders/optiboot/optiboot_atmega328pb_12mhz.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.

(Sorry for the bad editing)
These are my programmer settings:


And here is my setup:

As you can see the board is just powered from a external Power supply.

When i use Minicore Version 2.2.2 i atleast can program the 328PB once via TTL. When trying to programm it a second time i get the same errors again.

I can’t tell from your log whether you actually burned the bootloader successfully. Can you try that procedure again? After that, please try pressing the reset button on the A-Star and let me know if you see three quick flashes of the yellow LED, followed by a second of inactivity with the LED off.

- Patrick

Hi Patrick,

i think i have an idea about the issue. Can you provide the Fuse-Settings for the Pololu Board?

You can look in boards.txt in the A-Star Software and Drivers repository to find our recommended fuse and lock bit values.

- Patrick