I burn Arduino nano(328p) as ISP, in Arduino IDE test firmware uploaded to the target board and everything works. In Paltformio created a configuration according to the documentation, on the forum has been discussed many times, I checked everything, I can’t find any errors. Please explain what I am doing wrong.
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [ ] 0.4% (used 9 bytes from 2048 bytes)
Flash: [ ] 3.4% (used 1032 bytes from 30720 bytes)
Building .pio/build/isp_test/firmware.hex
Configuring upload protocol…
AVAILABLE: custom
CURRENT: upload_protocol = custom
Uploading .pio/build/isp_test/firmware.hex
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
…
Half a day of my life is spent, and there is no result
Oh, sorry for the confusion, the b parameter it’s a failed test, I changed the speed from 19200 to 115200 in the hope of a miracle.
And of course I tried everything in the frame.
It works!
I was moving down from 19200 and had no idea that such a solution was possible!
Thank you very much for your professionalism!
P.S. And now I will flash the bootloader
I am working on an open source project and I want the user to first change the config.h, prepare himself a programmer, then replace the bootloader on the target board and then flash it with the main firmware. The day off is not lost!
I tried the standard ArduinoISP from Arduino IDE and this interesting example, burning the target board works, but I can’t access the fuses. Does this work at all or do I need a programmer for this purpose?
And I bought yesterday a USBASP programmer, I will not list all the steps, there were many, but there is a result
Mac OS, avrdude, terminal app
Arduino UNO: read fuses, can write firmware
Arduino NANO: can’t read fuses, can’t write firmware
Similar in platformo and Arduino IDE
There are two different Arduino NANO but I can’t read the fuses on both of them. I changed the key -p avrdude -c usbasp -p m328 -P usb -b 19200 -v -F -U hfuse:r:-:h -U lfuse:r:-:h -U efuse:r:-:h to all variants m328, m328p, m328pb
And so, all this terrible problem was my ignorance, as it turned out, the Arduino nano has two hardware revisions. With the correct pinout everything works, fuses read, bootloader updated, uploading firmware via usbasp works.
Now I’m asking for help again.
For some unknown reason I can not upload firmware via USB. Apparently, I once again am missing some nuance. Bootloader MiniCore.
[platformio]
;default_envs = nanoatmega328new
default_envs = Upload_UART
[env]
platform = atmelavr
framework = arduino
board = ATmega328P
board_build.f_cpu = 16000000L
build_unflags = -flto
build_flags =
monitor_port = ${env:Upload_UART.upload_port}
monitor_speed = 9600
[env:Upload_UART]
upload_protocol = arduino
upload_port = /dev/tty.usbserial-1430
board_upload.speed = ${env:fuses_bootloader.board_bootloader.speed}
[env:Upload_ISP]
upload_protocol = custom
upload_flags =
-C$PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf
-p$BOARD_MCU
-PUSB
-cusbasp
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i
; Run the following command to set fuses
; pio run -e fuses_bootloader -t fuses
; Run the following command to set fuses + burn bootloader
; pio run -e fuses_bootloader -t bootloader
[env:fuses_bootloader]
board_hardware.oscillator = external ; Oscillator type
board_hardware.uart = uart0 ; Set UART to use for serial upload
board_bootloader.speed = 115200 ; Set bootloader baud rate
board_hardware.bod = 2.7v ; Set brown-out detection
board_hardware.eesave = yes ; Preserve EEPROM when uploading using programmer
upload_protocol = usbasp ; Use the USBasp as programmer
upload_flags = ; Select USB as upload port and divide the SPI clock by 8
-PUSB
-B8
Terminal output
***********************************************************************************************************************************************************************************************************************************************************************************************************************************
Obsolete PIO Core v6.1.5 is used (previous was 6.1.6)
Please remove multiple PIO Cores from a system:
https://docs.platformio.org/en/latest/core/installation/troubleshooting.html
***********************************************************************************************************************************************************************************************************************************************************************************************************************************
Processing Upload_UART (platform: atmelavr; framework: arduino; board: ATmega328P)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/ATmega328P.html
PLATFORM: Atmel AVR (3.4.0) > ATmega328P/PA
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 32KB Flash
DEBUG: Current (avr-stub) On-board (avr-stub, simavr)
PACKAGES:
- framework-arduino-avr-minicore @ 2.1.3
- tool-avrdude @ 1.60300.200527 (6.3.0)
- toolchain-atmelavr @ 1.70300.191015 (7.3.0)
Converting fuse.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 38 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/Upload_UART/src/fuse.ino.cpp.o
Compiling .pio/build/Upload_UART/src/pidautotuner.cpp.o
Archiving .pio/build/Upload_UART/libFrameworkArduinoVariant.a
Indexing .pio/build/Upload_UART/libFrameworkArduinoVariant.a
Compiling .pio/build/Upload_UART/FrameworkArduino/CDC.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/HardwareSerial.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/HardwareSerial0.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/HardwareSerial1.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/HardwareSerial2.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/HardwareSerial3.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/IPAddress.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/PluggableUSB.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/Print.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/Stream.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/Tone.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/USBCore.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/WInterrupts.c.o
Compiling .pio/build/Upload_UART/FrameworkArduino/WMath.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/WString.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/abi.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/hooks.c.o
Compiling .pio/build/Upload_UART/FrameworkArduino/main.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/new.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/wiring.c.o
Compiling .pio/build/Upload_UART/FrameworkArduino/wiring_analog.c.o
Compiling .pio/build/Upload_UART/FrameworkArduino/wiring_digital.c.o
Compiling .pio/build/Upload_UART/FrameworkArduino/wiring_extras.cpp.o
Compiling .pio/build/Upload_UART/FrameworkArduino/wiring_pulse.S.o
Compiling .pio/build/Upload_UART/FrameworkArduino/wiring_pulse.c.o
Compiling .pio/build/Upload_UART/FrameworkArduino/wiring_shift.c.o
Archiving .pio/build/Upload_UART/libFrameworkArduino.a
Indexing .pio/build/Upload_UART/libFrameworkArduino.a
Linking .pio/build/Upload_UART/firmware.elf
Checking size .pio/build/Upload_UART/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 10.6% (used 218 bytes from 2048 bytes)
Flash: [= ] 6.2% (used 2016 bytes from 32256 bytes)
Building .pio/build/Upload_UART/firmware.hex
Configuring upload protocol...
AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...
Using manually specified: /dev/tty.usbserial-1430
Uploading .pio/build/Upload_UART/firmware.hex
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