Adafruit Feather 328P wont program after one upload

The board programs successfully with the first upload - Arduino IDE 1.8.11
But error in second upload - (does the program overwrite the bootloader?)
Compiles OK
Lots of posts on the net about this but I cant find a solution
The board is brand new - I havent done anything else but program it twice
Errors (verbose)
Arduino: 1.8.11 (Linux), Board: “Adafruit Feather 328P”

/home/richard/Desktop/Arduino/arduino-1.8.11/arduino-builder -dump-prefs -logger=machine -hardware /home/richard/Desktop/Arduino/arduino-1.8.11/hardware -hardware /home/richard/.arduino15/packages -tools /home/richard/Desktop/Arduino/arduino-1.8.11/tools-builder -tools /home/richard/Desktop/Arduino/arduino-1.8.11/hardware/tools/avr -tools /home/richard/.arduino15/packages -built-in-libraries /home/richard/Desktop/Arduino/arduino-1.8.11/libraries -libraries /home/richard/Arduino/libraries -fqbn=adafruit:avr:feather328p -vid-pid=10C4_EA60 -ide-version=10811 -build-path /tmp/arduino_build_80868 -warnings=none -build-cache /tmp/arduino_cache_766449 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/home/richard/.arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=/home/richard/.arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.avrdude.path=/home/richard/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/home/richard/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7 -verbose /home/richard/Desktop/Arduino/Power SWR Meter/PowerSWRMeter/PowerSWRMeter.ino
/home/richard/Desktop/Arduino/arduino-1.8.11/arduino-builder -compile -logger=machine -hardware /home/richard/Desktop/Arduino/arduino-1.8.11/hardware -hardware /home/richard/.arduino15/packages -tools /home/richard/Desktop/Arduino/arduino-1.8.11/tools-builder -tools /home/richard/Desktop/Arduino/arduino-1.8.11/hardware/tools/avr -tools /home/richard/.arduino15/packages -built-in-libraries /home/richard/Desktop/Arduino/arduino-1.8.11/libraries -libraries /home/richard/Arduino/libraries -fqbn=adafruit:avr:feather328p -vid-pid=10C4_EA60 -ide-version=10811 -build-path /tmp/arduino_build_80868 -warnings=none -build-cache /tmp/arduino_cache_766449 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=/home/richard/.arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=/home/richard/.arduino15/packages/arduino/tools/arduinoOTA/1.3.0 -prefs=runtime.tools.avrdude.path=/home/richard/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/home/richard/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7 -verbose /home/richard/Desktop/Arduino/Power SWR Meter/PowerSWRMeter/PowerSWRMeter.ino
Using board 'feather328p' from platform in folder: /home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14
Using core 'arduino' from platform in folder: /home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3
Detecting libraries used...
/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/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=8000000L -DARDUINO=10811 -DARDUINO_AVR_FEATHER328P -DARDUINO_ARCH_AVR -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/cores/arduino -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/variants/standard /tmp/arduino_build_80868/sketch/PowerSWRMeter.ino.cpp -o /dev/null
Alternatives for Wire.h: [Wire@1.0 Wire@1.0]
ResolveLibrary(Wire.h)
  -> candidates: [Wire@1.0 Wire@1.0]
/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/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=8000000L -DARDUINO=10811 -DARDUINO_AVR_FEATHER328P -DARDUINO_ARCH_AVR -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/cores/arduino -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/variants/standard -I/home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire /tmp/arduino_build_80868/sketch/PowerSWRMeter.ino.cpp -o /dev/null
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
  -> candidates: [SPI@1.0]
/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/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=8000000L -DARDUINO=10811 -DARDUINO_AVR_FEATHER328P -DARDUINO_ARCH_AVR -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/cores/arduino -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/variants/standard -I/home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/SPI/src /tmp/arduino_build_80868/sketch/PowerSWRMeter.ino.cpp -o /dev/null
Alternatives for Adafruit_GFX.h: [Adafruit_GFX_Library@1.10.10]
ResolveLibrary(Adafruit_GFX.h)
  -> candidates: [Adafruit_GFX_Library@1.10.10]
/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/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=8000000L -DARDUINO=10811 -DARDUINO_AVR_FEATHER328P -DARDUINO_ARCH_AVR -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/cores/arduino -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/variants/standard -I/home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/SPI/src -I/home/richard/Arduino/libraries/Adafruit_GFX_Library /tmp/arduino_build_80868/sketch/PowerSWRMeter.ino.cpp -o /dev/null
Alternatives for Adafruit_I2CDevice.h: [Adafruit_BusIO@1.9.1]
ResolveLibrary(Adafruit_I2CDevice.h)
  -> candidates: [Adafruit_BusIO@1.9.1]
/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/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=8000000L -DARDUINO=10811 -DARDUINO_AVR_FEATHER328P -DARDUINO_ARCH_AVR -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/cores/arduino -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/variants/standard -I/home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/SPI/src -I/home/richard/Arduino/libraries/Adafruit_GFX_Library -I/home/richard/Arduino/libraries/Adafruit_BusIO /tmp/arduino_build_80868/sketch/PowerSWRMeter.ino.cpp -o /dev/null
Using cached library dependencies for file: /tmp/arduino_build_80868/sketch/Display.cpp
Using cached library dependencies for file: /tmp/arduino_build_80868/sketch/PowerSWRMeter.cpp
Using cached library dependencies for file: /home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire/TinyWireM.cpp
Using cached library dependencies for file: /home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire/USI_TWI_Master.cpp
Using cached library dependencies for file: /home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire/Wire.cpp
Using cached library dependencies for file: /home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire/utility/twi.c
Using cached library dependencies for file: /home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/SPI/src/SPI.cpp
Using cached library dependencies for file: /home/richard/Arduino/libraries/Adafruit_GFX_Library/Adafruit_GFX.cpp
Using cached library dependencies for file: /home/richard/Arduino/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp
Using cached library dependencies for file: /home/richard/Arduino/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.cpp
Using cached library dependencies for file: /home/richard/Arduino/libraries/Adafruit_GFX_Library/glcdfont.c
Using cached library dependencies for file: /home/richard/Arduino/libraries/Adafruit_BusIO/Adafruit_BusIO_Register.cpp
Using cached library dependencies for file: /home/richard/Arduino/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp
Using cached library dependencies for file: /home/richard/Arduino/libraries/Adafruit_BusIO/Adafruit_SPIDevice.cpp
Generating function prototypes...
/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/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=8000000L -DARDUINO=10811 -DARDUINO_AVR_FEATHER328P -DARDUINO_ARCH_AVR -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/cores/arduino -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/variants/standard -I/home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/SPI/src -I/home/richard/Arduino/libraries/Adafruit_GFX_Library -I/home/richard/Arduino/libraries/Adafruit_BusIO /tmp/arduino_build_80868/sketch/PowerSWRMeter.ino.cpp -o /tmp/arduino_build_80868/preproc/ctags_target_for_gcc_minus_e.cpp
/home/richard/Desktop/Arduino/arduino-1.8.11/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_80868/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
Using previously compiled file: /tmp/arduino_build_80868/sketch/Display.cpp.o
Using previously compiled file: /tmp/arduino_build_80868/sketch/PowerSWRMeter.cpp.o
/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/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=8000000L -DARDUINO=10811 -DARDUINO_AVR_FEATHER328P -DARDUINO_ARCH_AVR -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/cores/arduino -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/variants/standard -I/home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire -I/home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/SPI/src -I/home/richard/Arduino/libraries/Adafruit_GFX_Library -I/home/richard/Arduino/libraries/Adafruit_BusIO /tmp/arduino_build_80868/sketch/PowerSWRMeter.ino.cpp -o /tmp/arduino_build_80868/sketch/PowerSWRMeter.ino.cpp.o
Compiling libraries...
Compiling library "Wire"
Using previously compiled file: /tmp/arduino_build_80868/libraries/Wire/TinyWireM.cpp.o
Using previously compiled file: /tmp/arduino_build_80868/libraries/Wire/USI_TWI_Master.cpp.o
Using previously compiled file: /tmp/arduino_build_80868/libraries/Wire/Wire.cpp.o
Using previously compiled file: /tmp/arduino_build_80868/libraries/Wire/utility/twi.c.o
Compiling library "SPI"
Using previously compiled file: /tmp/arduino_build_80868/libraries/SPI/SPI.cpp.o
Compiling library "Adafruit_GFX_Library"
Using previously compiled file: /tmp/arduino_build_80868/libraries/Adafruit_GFX_Library/glcdfont.c.o
Using previously compiled file: /tmp/arduino_build_80868/libraries/Adafruit_GFX_Library/Adafruit_GFX.cpp.o
Using previously compiled file: /tmp/arduino_build_80868/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o
Using previously compiled file: /tmp/arduino_build_80868/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.cpp.o
Compiling library "Adafruit_BusIO"
Using previously compiled file: /tmp/arduino_build_80868/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp.o
Using previously compiled file: /tmp/arduino_build_80868/libraries/Adafruit_BusIO/Adafruit_SPIDevice.cpp.o
Using previously compiled file: /tmp/arduino_build_80868/libraries/Adafruit_BusIO/Adafruit_BusIO_Register.cpp.o
Compiling core...
Using precompiled core: /tmp/arduino_cache_766449/core/core_adafruit_avr_feather328p_bfc8022f79b0407bd20d9469ccc176c5.a
Linking everything together...
/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-gcc -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o /tmp/arduino_build_80868/PowerSWRMeter.ino.elf /tmp/arduino_build_80868/sketch/Display.cpp.o /tmp/arduino_build_80868/sketch/PowerSWRMeter.cpp.o /tmp/arduino_build_80868/sketch/PowerSWRMeter.ino.cpp.o /tmp/arduino_build_80868/libraries/Wire/TinyWireM.cpp.o /tmp/arduino_build_80868/libraries/Wire/USI_TWI_Master.cpp.o /tmp/arduino_build_80868/libraries/Wire/Wire.cpp.o /tmp/arduino_build_80868/libraries/Wire/utility/twi.c.o /tmp/arduino_build_80868/libraries/SPI/SPI.cpp.o /tmp/arduino_build_80868/libraries/Adafruit_GFX_Library/glcdfont.c.o /tmp/arduino_build_80868/libraries/Adafruit_GFX_Library/Adafruit_GFX.cpp.o /tmp/arduino_build_80868/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o /tmp/arduino_build_80868/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.cpp.o /tmp/arduino_build_80868/libraries/Adafruit_BusIO/Adafruit_BusIO_Register.cpp.o /tmp/arduino_build_80868/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp.o /tmp/arduino_build_80868/libraries/Adafruit_BusIO/Adafruit_SPIDevice.cpp.o /tmp/arduino_build_80868/../arduino_cache_766449/core/core_adafruit_avr_feather328p_bfc8022f79b0407bd20d9469ccc176c5.a -L/tmp/arduino_build_80868 -lm
/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /tmp/arduino_build_80868/PowerSWRMeter.ino.elf /tmp/arduino_build_80868/PowerSWRMeter.ino.eep
/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -R .eeprom /tmp/arduino_build_80868/PowerSWRMeter.ino.elf /tmp/arduino_build_80868/PowerSWRMeter.ino.hex
Multiple libraries were found for "Wire.h"
 Used: /home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire
 Not used: /home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/Wire
Using library Wire at version 1.0 in folder: /home/richard/.arduino15/packages/adafruit/hardware/avr/1.4.14/libraries/Wire 
Using library SPI at version 1.0 in folder: /home/richard/.arduino15/packages/arduino/hardware/avr/1.8.3/libraries/SPI 
Using library Adafruit_GFX_Library at version 1.10.10 in folder: /home/richard/Arduino/libraries/Adafruit_GFX_Library 
Using library Adafruit_BusIO at version 1.9.1 in folder: /home/richard/Arduino/libraries/Adafruit_BusIO 
/home/richard/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-size -A /tmp/arduino_build_80868/PowerSWRMeter.ino.elf
Sketch uses 17170 bytes (53%) of program storage space. Maximum is 32256 bytes.
Global variables use 820 bytes (40%) of dynamic memory, leaving 1228 bytes for local variables. Maximum is 2048 bytes.
/home/richard/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/richard/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:/tmp/arduino_build_80868/PowerSWRMeter.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 "/home/richard/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/home/richard/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega328P
         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 : Arduino
         Description     : Arduino

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0
         Hardware Version: 4238814
         Firmware Version: 40481808.0
         Topcard         : Unknown

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0
         Vtarget         : 0.0 V
         Varef           : 3842313.6 V
         Oscillator      : Off
         SCK period      : 0.1 us


avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0xe0
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0xe0

avrdude done.  Thank you.

the selected serial port 
 does not exist or your board is not connected

Thanks
R

1 Like

Hi Oliver, Welcome to the forum!

I tested a unit from shelf just to make sure it wasn’t a bad batch, and confirmed I was able to program it as many times as I liked, with different variations on the blink sketch,

My settings looked like this, as per the Adafruit guide on this product:
image

Have you got your set up like this?

Keen to get to the bottom of this!
-James

Ah
Thanks James

I downloaded the Library with the Adafruit Feather 328P in it and selected this as the board. (which seems logical enough)

I did try the setting for Pro Mini/Atmega328P 3.3V to reprogram the board but it would not work.

I can only assume that the Feather option does something to the fuses which may make the board unprogrammable

Yeah should have read the guide…

I will set up an Uno as an ISP and try reading the fuses that way on the boards I have programmed
I tried AVRdude on the command line to read the fuses via the USB port without success - get the dreaded “out of synch” error

I still have several “virgin” ones - will try your approach and report back

R

Hi Oliver,

Keen to see how you go! In the Adafruit guide, it does give you the option of using the Board Support Package for the feathers to get the same result as you did (“Feather 328P” appearing as a board option), but I picked the easy way just to arrive at a verdict faster. I’ll test using the “hard way” today to see if their process has bugs that bork your boards, as we definitely want to warn people about that!

I can see that you’re obviously well versed in programming micros, so if anyone could skip the guide, it’d probably be you, but 3rd-party boards from manufacturers like Adafruit can have quirks that need some attention, and they’ll at least have good guides to point those quirks out!

-James

1 Like

Mmm
Tried the Pro Mini 328P 3.3V 8 MHz option
Same result :slightly_frowning_face:
Learning about this process as I go though
I need an ISP for other projects

I did note if I use -F (force skip ID check) with AVRDude on the command line I get an invalid chip ID as 0x000000 instead of the correct one. When it initially programs I get
“Device signature = 0x1e950f (probably m328p)”
Will try reading the fuses with an ISP before and after programming the first time
Maybe the programmer is writing to the fuses and making the chip unprogrammable?

R

1 Like

Hi Oliver,

Have you made any modifications to your Arduino IDE/programming process? This seems out of line with what I’ve experienced with it.

-James

I note that the AVRDude.conf file seems to be the one that defines the various fuse bits - maybe I have a different version?
The code is somewhat cryptic without much comment and I cant make sense of it - there are 16 bit codes to write to an 8 bit register
eg
memory “lfuse”
size = 1;
min_write_delay = 4500;
max_write_delay = 4500;
read = “0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0”,
“x x x x x x x x o o o o o o o o”;

write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0",
      	"x x x x x x x x i i i i i i i i";

Presumably with the write command the first 8 bits are “write to the lfuse register” with the lowest 8 bits being data.
Do you have any detailed info on this?
Maybe there is an error here?

No I used Arduino IDE
Loaded Adafruit boards
Sketch => Upload

R

(Richard)
I am Oliver Richard Hosking :slight_smile:

To continue on the fuse debate…
The chip runs when programmed as I can start up a serial monitor and see something coming back
The orange LED is flashing fast so…
The crystal oscillator is running and the chip is running a program
I note from the circuit the board is using an 8MHz crystal From some posts on the net re programming the fuses “0” is set and “1” is clear
So “10100000” is actually “01011111” ??
For the lfuse register 10100000 would be external clock, fast rising oscillator, No output on pin 14, Divide output by 8
01011111 would be Low power crystal oscillator, output on pin 14 no divide by 8 Brownout Detector enabled - this makes more sense
I can see a crystal oscillator signal running at 8 MHz on the CRO but no output on pin 14
Oh well better get the ISP working…

Hey Richard (did I get it right this time? :smiley: )

This one is a little over my head at this point… I’ll do some more research into fuses and the programming process to get to the bottom of this with you.

Hopefully someone deeper into this stuff can chime in in the mean-time…
-James

Thanks James - still hacking
Tried the ISP idea - doesnt solve it
OTOH I saw a post on the net about a capacitor to ground on the reset pin
Tried a 10uF cap Reset => ground and I can get it to reprogram if I hold the reset button down on the Feather and release it as the compilation finishes and the upload starts
So I think it is something to do with reset timing.
I note in the circuit there is a 1K resistor to VCC and a 0.1uF cap to the DTR pin on the UART. Presumably the UART drives this pin low for Reset and the low pulse duration will depend on the RC combination of the 0.1uF and 1K. Seems a rather quick and dirty solution…
Timing is probably affected with different voltage levels
Still doesnt explain why it works with you and not with me…

1 Like

I note from the Atmel datasheet that reset should stay low during series programming
This doesnt seem to happen

1 Like

Revisiting this post
Am designing various projects for Radio
There doesnt seem to be a good 3.3V solution for Arduino
I dont want to use level shifters for peripherals such as displays
The Adafruit Feather seemed to be an option but then I ran into the programming problem which has not been solved AFAIK
Have tried again with a new Feather - programmed once and then would not reprogram
Any new solutions?

1 Like