Skip to content

Instantly share code, notes, and snippets.

@bu5hm4nn
Last active November 29, 2025 12:26
Show Gist options
  • Select an option

  • Save bu5hm4nn/3cdc7e567a3595264cd9a556288d69ca to your computer and use it in GitHub Desktop.

Select an option

Save bu5hm4nn/3cdc7e567a3595264cd9a556288d69ca to your computer and use it in GitHub Desktop.
Flash Bootloader to Creality Ender 3 Pro (ATMega1284p, Melzi, Sanguino) using a Raspberry Pi only

My raspberry is running Raspbian

  1. Setup avrdude on Raspberry following this guide: http://archive.today/U0WzQ

    The wiring diagram works exactly the same for the Creality Melzi board

    To run the test, replace atmega328p with atmega1284p

  2. I followed the programming commands from klipper3d.org

    Download the bootloader:

    wget 'https://github.com/Lauszus/Sanguino/raw/master/avr/bootloaders/optiboot/optiboot_atmega1284p.hex'
    

    flash the bootloader and set the fuses

    avrdude -c linuxgpio -p atmega1284p -e -u -U lock:w:0x3F:m -U efuse:w:0xFD:m -U hfuse:w:0xDE:m -U lfuse:w:0xFF:m
    avrdude -c linuxgpio -p atmega1284p -U flash:w:optiboot_atmega1284p.hex
    avrdude -c linuxgpio -p atmega1284p -U lock:w:0x0F:m
    

If this succeeds you can now flash the board over USB using avrdude from your PC (Or using PlatformIO, Arduino IDE, etc)

@PSLLSP
Copy link

PSLLSP commented Nov 29, 2025

You can test for success. Connect board to Raspberry with USB cable and try avrdude, it should report this:

$ avrdude -c arduino -p atmega1284p -P /dev/ttyUSB0

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9705 (probably m1284p)

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done.  Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment