I'm having alot of problems burning the Arduino bootloader on a ATMega328p MCU.
I'm using Arduino as MCU and following the https://www.arduino.cc/en/tutorial/arduinoISP.
Using ArduinoISP i got Can't find programmer id "arduinoisp"
And using Arduino as ISP i got:
Arduino: 1.8.8 (Linux), Board: "Arduino/Genuino Uno"
//bin/avrdude -C//etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyACM2 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m
avrdude: Version 6.3, compiled on Jan 11 2019 at 08:12:38
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "//etc/avrdude.conf"
User configuration file is "/home/artur/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM2
Using Programmer : arduino
Overriding Baud Rate : 19200
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=0x14
avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x02
avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x10
Hardware Version: 971338560
Firmware Version: 19200.0
Topcard : STK502
Vtarget : 1.8 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
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=0x10
avrdude done. Thank you.
Error while burning bootloader.
I dont really know the difference between those options. But it seems that avrdude doesn't have the config for ArduinoISP so it seems that Arduino as ISP is the right choice?
I tried all the reset options, 10k resistor, nothing, 10uf capactor, both. Same result.
I've replaced all the cables and checked if the power is getting into the target using a LED.
I have also tested with another atmega328p that i already have the bootloader and a blink sketch, just to test, and the mega is running (led is bliking away) but i cannot burn the bootloader.
Here a pic of my breadboard.
Well... I need to run this mega as 20MHz for timming purposes, i was looking at MiniCore to that answer, but i cant even burn a regular bootloader into the chip. The thing is that i've done this before without problem.
I'm running Arduino 1.8.8 from Arch Linux repositories and i've also installed Arduino AVR Boards 1.6.23 from the board manager (looks like a requisite for MiniCore).