Problem flashing bootloader to ATmega1284p

I bricked my Anet board when I was wiring an NPN auto level sensor, I confirmed it by trying to flash the firmware to the board, detected the port but got an outofsync error.
So I used an Uno to flash the OptiBoot bootloader on it as per CrossLinks guide. I uploaded the ArduinoISP sketch to the Uno, wired it up to the J3, changed the board to Anet, and my programmer to "Arduino as ISP". I then tried to burn the bootloader but got the following error:

Arduino: 1.8.13 (Mac OS X), Board: "Anet V1.0 (Optiboot)"

/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega1284p -cstk500v1 -P/dev/cu.usbmodem14201 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xD6: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 "/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/matteostassin/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem14201
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega1284P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         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    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
           flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | Error while burning bootloader.
################################################## | 100% 0.02s

avrdude: Device signature = 0x5e4040
avrdude: Expected signature for ATmega1284P is 1E 97 05
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

I rewired it about 6 times and made sure it was correct. The only thing that might be screwing this up is the capacitor, rated at 100µF for 16v. The guide said >10µF was fine, so I'm not sure.
Any tips? Thanks.

matteo69:

avrdude: Device signature = 0x5e4040

Does the value for the device signature shown here change every time you try to flash the bootloader, or is it always the same?

The capacitor is not needed since there is -cstk500v1 switch in used command. See also "Using Programmer: stk500v1" in the log. However, 100uF should not be a problem (on UNO, from RESET to GND right?).
Response 0x5e4040 in device signature looks weird. It does not look like problem with the wiring at first sight but you should check your wiring first and also try it with more detailed log switched on.

pert:
Does the value for the device signature shown here change every time you try to flash the bootloader, or is it always the same?

I tried it twice more:

Arduino: 1.8.13 (Mac OS X), Board: "Anet V1.0 (Optiboot)"

/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega1284p -cstk500v1 -P/dev/cu.usbmodem14201 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xD6: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 "/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem14201
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega1284P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         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    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
           flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x5e4040
avrdude: Expected signature for ATmega1284P is 1E 97 05
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

Same as the first time.

Arduino: 1.8.13 (Mac OS X), Board: "Anet V1.0 (Optiboot)"

/Users/matteostassin/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/matteostassin/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega1284p -cstk500v1 -P/dev/cu.usbmodem14201 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xD6: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 "/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/Users/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem14201
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega1284P
         Chip Erase delay              : 55000 us
         PAGEL                         : PD7
         BS2                           : PA0
         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    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
           flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x5e4040
avrdude: Expected signature for ATmega1284P is 1E 97 05
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

Exactly the same.
Not sure what it means.

Budvar10:
The capacitor is not needed since there is -cstk500v1 switch in used command. See also "Using Programmer: stk500v1" in the log. However, 100uF should not be a problem (on UNO, from RESET to GND right?).
Response 0x5e4040 in device signature looks weird. It does not look like problem with the wiring at first sight but you should check your wiring first and also try it with more detailed log switched on.

I have rewired it several times and did so again, without the capacitor and it gave me the same exact log. The log is as detailed as I can make it, both compilation and upload verbose output are displayed.

Run it from command line with -vvvv added (resp. replace -v) in to the current command. Post it as file in an attachment.

Budvar10:
Run it from command line with -vvvv added (resp. replace -v) in to the current command. Post it as file in an attachment.

I'm using a Mac, googled around, not sure this is possible with terminal, unfortunately (unless I use a makefile, which would take a while to set up).

Of course it's possible to do from the terminal.

Just copy and paste this command:

/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -vvvv -patmega1284p -cstk500v1 -P/dev/cu.usbmodem14201 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xD6:m

pert:
Of course it's possible to do from the terminal.

Just copy and paste this command:

/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -vvvv -patmega1284p -cstk500v1 -P/dev/cu.usbmodem14201 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xD6:m

Thanks for the tip, I've attached the output.

Terminal Saved Output.txt (7.72 KB)

:o
This is really weird. It looks like normal communication just the signature is odd.
It is some chinnese board from Ali or so, right? Maybe it is clone of 1284P. I do not know, I can't find anything on web.
I would try to modify the signature in avrdude.conf to 0x5e4040 and make the avrdude be able to communicate with the chip. Then just try to read out something from the chip, like the memory or fuses. Just read to prevent any modification at this step.

/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega1284p -cstk500v1 -P/dev/cu.usbmodem14201 -b19200 -Uflash:r:filename.hex:i

Without -e and -U with :r modifier, see the avrdude help for details.

Budvar10:
:o
This is really weird. It looks like normal communication just the signature is odd.
It is some chinnese board from Ali or so, right? Maybe it is clone of 1284P. I do not know, I can't find anything on web.
I would try to modify the signature in avrdude.conf to 0x5e4040 and make the avrdude be able to communicate with the chip. Then just try to read out something from the chip, like the memory or fuses. Just read to prevent any modification at this step.

/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega1284p -cstk500v1 -P/dev/cu.usbmodem14201 -b19200 -Uflash:r:filename.hex:i

Without -e and -U with :r modifier, see the avrdude help for details.

I changed the signature in the conf file:

# ATmega1284P
#------------------------------------------------------------

# similar to ATmega164p

part
    id               = "m1284p";
    desc             = "ATmega1284P";
    has_jtag         = yes;
    stk500_devcode   = 0x82; # no STK500v1 support, use the ATmega16 one
    avr910_devcode   = 0x74;
    signature        = 0x5e 0x40 0x40;
    pagel            = 0xd7;
    bs2              = 0xa0;
    chip_erase_delay = 55000;
    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
                       "x x x x  x x x x    x x x x  x x x x";

    chip_erase       = "1 0 1 0  1 1 0 0    1 0 0 x  x x x x",
                       "x x x x  x x x x    x x x x  x x x x";

    timeout		= 200;
    stabdelay		= 100;
    cmdexedelay		= 25;
    synchloops		= 32;
    bytedelay		= 0;
    pollindex		= 3;
    pollvalue		= 0x53;
    predelay		= 1;
    postdelay		= 1;
    pollmethod		= 1;

    pp_controlstack     =
        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
    hventerstabdelay    = 100;
    progmodedelay       = 0;
    latchcycles         = 6;
    togglevtg           = 1;
    poweroffdelay       = 15;
    resetdelayms        = 1;
    resetdelayus        = 0;
    hvleavestabdelay    = 15;
    chiperasepulsewidth = 0;
    chiperasepolltimeout = 10;
    programfusepulsewidth = 0;
    programfusepolltimeout = 5;
    programlockpulsewidth = 0;
    programlockpolltimeout = 5;

    idr                 = 0x31;
    spmcr               = 0x57;
    allowfullpagebitstream = no;

    ocdrev              = 3;

    memory "eeprom"
        paged           = no; /* leave this "no" */
        page_size       = 8;  /* for parallel programming */
        size            = 4096;
        min_write_delay = 9000;
        max_write_delay = 9000;
        readback_p1     = 0xff;
        readback_p2     = 0xff;
	read            = "  1   0   1   0      0   0   0   0",
                          "  0   0   x   x    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0",
                          "  o   o   o   o      o   o   o   o";

	write           = "  1   1   0   0      0   0   0   0",
                          "  0   0   x   x    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0", 
                          "  i   i   i   i      i   i   i   i";

	loadpage_lo	= "  1   1   0   0      0   0   0   1",
			  "  0   0   0   0      0   0   0   0",
			  "  0   0   0   0      0  a2  a1  a0",
			  "  i   i   i   i      i   i   i   i";

	writepage	= "  1   1   0   0      0   0   1   0",
			  "  0   0   x   x    a11 a10  a9  a8",
			  " a7  a6  a5  a4     a3   0   0   0",
			  "  x   x   x   x      x   x   x   x";

	mode		= 0x41;
	delay		= 10;
	blocksize	= 128;
	readsize	= 256;
      ;

    memory "flash"
        paged           = yes;
        size            = 131072;
        page_size       = 256;
        num_pages       = 512;
        min_write_delay = 4500;
        max_write_delay = 4500;
        readback_p1     = 0xff;
        readback_p2     = 0xff;
        read_lo         = "  0   0   1   0      0   0   0   0",
                          "a15 a14 a13 a12    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0",
                          "  o   o   o   o      o   o   o   o";

        read_hi         = "  0   0   1   0      1   0   0   0",
                          "a15 a14 a13 a12    a11 a10  a9  a8",
                          " a7  a6  a5  a4     a3  a2  a1  a0",
                          "  o   o   o   o      o   o   o   o";

        loadpage_lo     = "  0   1   0   0      0   0   0   0",
                          "  0   0   x   x      x   x   x   x",
                          "  x  a6  a5  a4     a3  a2  a1  a0",
                          "  i   i   i   i      i   i   i   i";

        loadpage_hi     = "  0   1   0   0      1   0   0   0",
                          "  0   0   x   x      x   x   x   x",
                          "  x  a6  a5  a4     a3  a2  a1  a0",
                          "  i   i   i   i      i   i   i   i";

        writepage       = "  0   1   0   0      1   1   0   0",
                          "a15 a14 a13 a12    a11 a10  a9  a8",
                          " a7   x   x   x      x   x   x   x",
                          "  x   x   x   x      x   x   x   x";

	mode		= 0x41;
	delay		= 10;
	blocksize	= 256;
	readsize	= 256;
      ;

    memory "lock"
        size            = 1;
        read            = "0 1 0 1  1 0 0 0   0 0 0 0  0 0 0 0",
                          "x x x x  x x x x   x x o o  o o o o";

        write           = "1 0 1 0  1 1 0 0   1 1 1 x  x x x x",
                          "x x x x  x x x x   1 1 i i  i i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "lfuse"
        size            = 1;
        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";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "hfuse"
        size            = 1;
        read            = "0 1 0 1  1 0 0 0   0 0 0 0  1 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  1 0 0 0",
                          "x x x x  x x x x   i i i i  i i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "efuse"
        size            = 1;

        read            = "0 1 0 1  0 0 0 0  0 0 0 0  1 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 1 0 0",
                          "x x x x  x x x x  1 1 1 1  1 i i i";
        min_write_delay = 9000;
        max_write_delay = 9000;
      ;

    memory "signature"
        size            = 3;
        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
      ;

    memory "calibration"
        size            = 1;

        read            = "0 0 1 1  1 0 0 0   0 0 0 x  x x x x",
                          "0 0 0 0  0 0 0 0   o o o o  o o o o";
        ;
  ;

Then I ran the line you provided (output is attached). Really weird, it seems to read just fine, but when I try with the -e -U and :r modifier, it fails as a first byte mismatch (also attached), I'm not quite sure what it means.
This is totally out of my league of knowledge haha.

no modifiers.txt (3.83 KB)

with modifiers.txt (14.2 KB)

Oh no, I meant without -e! It performs chip erase. Please, read avrdude help.
Anyhow, it looks like it works with this signature.
I think, you have erased chip now, with fuses set to (E:FD, H:DE, L:FF).
You can try to burn the FW or the bootloader according your needs.
And remember -Uefuse:w, w stands for write, r is for read.

It looks like counterfeit chip with its own signature. I do not know about the possibility to modify the signature on the original ATmega, even though I've read about it years ago but it was not proven.

Good job up to now. Karma++!

Let us know.

Budvar10:
Oh no, I meant without -e! It performs chip erase. Please, read avrdude help.
Anyhow, it looks like it works with this signature.
I think, you have erased chip now, with fuses set to (E:FD, H:DE, L:FF).
You can try to burn the FW or the bootloader according your needs.
And remember -Uefuse:w, w stands for write, r is for read.

https://download-mirror.savannah.gnu.org/releases/avrdude/avrdude-doc-6.3.pdf

It looks like counterfeit chip with its own signature. I do not know about the possibility to modify the signature on the original ATmega, even though I've read about it years ago but it was not proven.

Good job up to now. Karma++!

Let us know.

If I change the fuses accordingly, it still gives me a lock byte verification error for

-Ulock:w:0x3F:m

I read a bit on the doc you sent, and I have a better understanding of which each term means, but I'm still confused as to why the only way I can surpass the verification error and make it work is by using:

-Ulock:w:0x0F:m

I'm guessing that the chips' lock bytes, being counterfeit or modified, are misaligned with the command, meant for a genuine 1284p. Nevertheless, I tried matching it so it worked:

/Users/matteostassin/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/matteostassin/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega1284p -cstk500v1 -P/dev/cu.usbmodem14201 -b19200 -e -Ulock:w:0x0F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m

It successfully wrote the lock and fuse files to the chip (output attached), but it is still out of sync when I try burning my firmware on there. Not sure what I'm doing wrong here.
Thank you for your help and patience when dealing with my inability to use avrdude haha, I appreciate it.

modified fuses and lock.txt (5.65 KB)

The lock 0x0F protect the boot loader section.
Try to write the program directly but you have to change fuses to boot from address 0 without the bootloader.

Budvar10:
The lock 0x0F protect the boot loader section.
Try to write the program directly but you have to change fuses to boot from address 0 without the bootloader.

I didn't completely understand what you meant but I think you meant you wanted me to do something like this?

/Users/matteostassin/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/matteostassin/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega1284p -cstk500v1 -P/dev/cu.usbmodem14201 -b19200 -e -u -Uefuse:w:0x00:m -Uhfuse:w:0x00:m -Ulfuse:w:0x00:m

Even with the safe mode off, it won't change the values for some reason; yet again a content mismatch error. Perhaps I'm being stupid and missing or misunderstood something. I've attached the output.

boot from 0.txt (4.1 KB)

No. You have to read something about fuse setting. Each bit has some meaning. Google for AVR fuse calculator but in the ATmega1284P datasheet is essential information. High fuse bit 0 is the boot vector - the address in the flash memory where the program execution will start, 0xDE -> bit 0 == 0 ~ non zero address, should be 0xDF for zero address.
If you will be able to upload the program directly into the flash via ISP you will need not the bootloader.

Budvar10:
No. You have to read something about fuse setting. Each bit has some meaning. Google for AVR fuse calculator but in the ATmega1284P datasheet is essential information. High fuse bit 0 is the boot vector - the address in the flash memory where the program execution will start, 0xDE -> bit 0 == 0 ~ non zero address, should be 0xDF for zero address.
If you will be able to upload the program directly into the flash via ISP you will need not the bootloader.

I tried to read up on what you said, but I cannot find anything related to vectors other than interrupt vectors in the datasheet. Nevertheless, I just disabled all the features from the fuses (to FF) apart from the High fuse (as you said, DF).

/Users/matteostassin/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/Users/matteostassin/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf -v -patmega1284p -cstk500v1 -P/dev/cu.usbmodem14201 -b19200 -e -u -Uefuse:w:0xFF:m -Uhfuse:w:0xDF:m -Ulfuse:w:0xFF:m

Didn't work, content mismatch error. Tried to flash the firmware direct through ISP (as I thought maybe the fuses were corrected somehow), didn't work either.
At this point, it's taking way too long to fix this, so I think I'm just gonna buy a new board.
Thank you for your extensive help anyway, maybe this thread can help someone in the future who's a little more educated than me on AVR haha.

I used the mighty core on my 1284 ( chip purchased from microchip) and it worked straight off using an isp tiny programmer plus capacitor in the 1284 reset

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.