Error Programming A-Star 328PB Micro

I selected the port ending in 022 and tried to burn the bootloader again (using the STK500 programmer selection with the Pololu AVR Programmer v2.1). Different error, but still not working (red light on the AVR Programmer is on, too):

Arduino: 1.8.10 (Mac OS X), Board: "Pololu A-Star 328PB, 5V, 16MHz"

/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -C+/Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/extra_avrdude.conf -v -patmega328pb -cstk500 -P/dev/cu.usbmodem002795022 -B 5 -e -Ulock:w:0xFF:m -Uefuse:w:0xF4:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF: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 "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/rwaddell/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping
         Additional configuration file is "/Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/extra_avrdude.conf"
avrdude: warning at /Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/extra_avrdude.conf:1: part m328pb overwrites previous definition /Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf:8597.

         Using Port                    : /dev/cu.usbmodem002795022
         Using Programmer              : stk500
         Setting bit clk period        : 5.0
         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         : 4.9 V
         SCK period      : 8.7 us
         Varef           : 0.0 V
         Oscillator      : Off

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Error while burning bootloader.

It looks like you are using the correct AVRDUDE command now, but the programmer cannot connect to the ATmega328PB. After a failed programming attempt, please open the Pololu USB AVR Programmer v2 Configuration Utility and take a screenshot of it so we can see a more specific error message. Also, please post some pictures of your setup here so I can check your connections.

–David

The config utility doesn’t show any error (I had the app open when I last tried to program the board using the “Upload” button):

Arduino: 1.8.10 (Mac OS X), Board: "Pololu A-Star 328PB, 5V, 16MHz"

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/rwaddell/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/rwaddell/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/rwaddell/Dropbox/Arduino Projects/libraries -fqbn=pololu-a-star:avr:a-star328PB:version=16mhz -vid-pid=1FFB_00BB -ide-version=10810 -build-path /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550 -warnings=none -build-cache /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_cache_966972 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Applications/Arduino.app/Contents/Java/examples/01.Basics/Blink/Blink.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -hardware /Users/rwaddell/Library/Arduino15/packages -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/rwaddell/Library/Arduino15/packages -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/rwaddell/Dropbox/Arduino Projects/libraries -fqbn=pololu-a-star:avr:a-star328PB:version=16mhz -vid-pid=1FFB_00BB -ide-version=10810 -build-path /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550 -warnings=none -build-cache /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_cache_966972 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino5.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Applications/Arduino.app/Contents/Java/examples/01.Basics/Blink/Blink.ino
Using board 'a-star328PB' from platform in folder: /Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2
Using core 'arduino' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Detecting libraries used...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_A_STAR_328PB -DARDUINO_ARCH_AVR -include /Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/variants/a-star328pb/io_328pb.h -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/variants/a-star328pb /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/sketch/Blink.ino.cpp -o /dev/null
Generating function prototypes...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_A_STAR_328PB -DARDUINO_ARCH_AVR -include /Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/variants/a-star328pb/io_328pb.h -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/variants/a-star328pb /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/sketch/Blink.ino.cpp -o /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/preproc/ctags_target_for_gcc_minus_e.cpp
/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10810 -DARDUINO_AVR_A_STAR_328PB -DARDUINO_ARCH_AVR -include /Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/variants/a-star328pb/io_328pb.h -I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino -I/Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/variants/a-star328pb /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/sketch/Blink.ino.cpp -o /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/sketch/Blink.ino.cpp.o
Compiling libraries...
Compiling core...
Using previously compiled file: /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/core/new_vectors_328pb.cpp.o
Using precompiled core: /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_cache_966972/core/core_pololu-a-star_avr_a-star328PB_version_16mhz_51f02b7210b938436b779d1c032618e1.a
Linking everything together...
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/Blink.ino.elf /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/sketch/Blink.ino.cpp.o /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/core/new_vectors_328pb.cpp.o /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/../arduino_cache_966972/core/core_pololu-a-star_avr_a-star328PB_version_16mhz_51f02b7210b938436b779d1c032618e1.a -L/var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550 -lm
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/Blink.ino.elf /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/Blink.ino.eep
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-objcopy -O ihex -R .eeprom /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/Blink.ino.elf /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/Blink.ino.hex
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-size -A /var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/Blink.ino.elf
Sketch uses 1152 bytes (3%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -C+/Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/extra_avrdude.conf -v -patmega328pb -carduino -P/dev/cu.usbmodem002795024 -b115200 -D -Uflash:w:/var/folders/nb/2356s9gj6y714v9fzf4hck080000gn/T/arduino_build_785550/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 "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/rwaddell/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping
         Additional configuration file is "/Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/extra_avrdude.conf"
avrdude: warning at /Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/extra_avrdude.conf:1: part m328pb overwrites previous definition /Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf:8597.

         Using Port                    : /dev/cu.usbmodem002795024
         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=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done.  Thank you.

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

IMG_7401

When I switch to the programming port and try to burn the bootloader, I do see an error in the config utility:

Arduino: 1.8.10 (Mac OS X), Board: "Pololu A-Star 328PB, 5V, 16MHz"

/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -C+/Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/extra_avrdude.conf -v -patmega328pb -cstk500 -P/dev/cu.usbmodem002795022 -B 5 -e -Ulock:w:0xFF:m -Uefuse:w:0xF4:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF: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 "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/rwaddell/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping
         Additional configuration file is "/Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/extra_avrdude.conf"
avrdude: warning at /Users/rwaddell/Library/Arduino15/packages/pololu-a-star/hardware/avr/4.0.2/extra_avrdude.conf:1: part m328pb overwrites previous definition /Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf:8597.

         Using Port                    : /dev/cu.usbmodem002795022
         Using Programmer              : stk500
         Setting bit clk period        : 5.0
         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         : 4.9 V
         SCK period      : 8.7 us
         Varef           : 0.0 V
         Oscillator      : Off

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Error while burning bootloader.

Do I need to adjust the “ISP Frequency” or “Max ISP Frequency”?

At this stage, there is no reason to use the “Upload” button because that button only works if the board has a bootloader. We should focus on fixing all of the issues that are preventing you from burning the bootloader.

On November 1, you said “I connected the Pololu AVR Programmer v2.1 to the 328PB via the ISP” but in your picture from yesterday, I see that they are only connected via their serial interfaces. You should use the 6-pin ISP cable that comes with the programmer to connect the programmer to the A-Star’s ISP header. Be careful to use the right orientation.

Please refer to the “Connecting an AVR for programming” section of the Pololu USB AVR Programmer v2 User’s Guide. Please refer to the “A-Star 328PB Micro pinout and components” section of the Pololu A-Star 328PB User’s Guide for information about where the ISP header is and how it is oriented.

You should not change the ISP frequency settings at this time.

–David

Thanks for all your patience, David. After connecting the 328PB to the AVR Programmer via the 2x3 ISP header I was able to burn the bootloader (using the programming port), and then program it with ‘Blink’ using the serial interface and the TTL port.

So I’m clear:

  • You can only burn the bootloader via the 2x3 ISP header and the programming port in the Arduino IDE.
  • If you upload a sketch to the 328PB via the 2x3 ISP header it blows away the bootloader, so you cannot subsequently upload sketches via the serial header and the TTL port until you re-burn the bootloader as above.

Is that right?

I am glad you were able to burn the bootloader.

That is correct.

That sentence would be correct if you replace “ISP port” with “TTL port”.

–David

Corrected my post for future reference, and thanks again.

Hi,

I build myself a A-Star like board but without serial header, cause I thaught i can upload sketches with AVR Programmer 2.1.
Bootloader programming works, but it seems when I choose to upload the sketch via programmer “sketch → upload wth programmer”, it doesn’t take the additional configuration file “extra_avrdude.conf” into account, as it does while burning the bootloader.
Because AVRDude is complaining about wrong signature:

avrdude: Device signature = 0x1e9516 (probably m328pb)
avrdude: Expected signature for ATmega328P is 1E 95 0F
         Double check chip, or use -F to override this check.

I inspected the “platform.txt” in the pololu a-star folder already and can’t find the clue.
What needs to be changed that the Arduino IDE takes the extra config as well, when uploading via programmer.

platform.txt (1.8 KB)

If you have not done so already, you should open the Programmer menu and select “STK500 for Pololu A-Star 328PB”. The platform.txt file you found defines a tool called avrdudecustom, but that tool is not used unless you select a programmer entry that is configured to use it.

You should also select the correct board in the “Board” menu and the correct board version in the “Version” menu.

–David