Steps to flash a bootloader onto Creality CR10-Mini controller board (Melzi 1.1.2 Atmega1284p) with Linux/Raspberry Pi and USBasp
Unlike CR-10S variants, the CR10 Melzi boards do not come with a pre-flashed bootloader, so this needs to be done first before flashing other firmware onto the controler board.
- Ubuntu laptop (x86_64) or Raspberry Pi
- USBasp hardware connector (link below)
avrdude
CLI
The bootloader can be flashed using the USBasp hardware connector from a standard laptop or a Raspberry Pi - it's totally your choice. To keep the steps separate from the process of installing Klipper (via MainsailOS), the follow steps were used on a standard Ubuntu 21.04 system.
- Power off and unplug printer.
- Open control box to expose controller board. Connect the USBasp, ensuring that the pin orientation is correct. (I used the ISP header pinout images linked below to identify the GND pin, and then ensured that adapter was oriented correctly with its own GND.
- Install
avrdude
on the laptop/RPi; download the bootloader; test USBasp connection; flash the firmware.
sudo apt install avrdude
wget https://raw.githubusercontent.com/Lauszus/Sanguino/master/bootloaders/optiboot/optiboot_atmega1284p.hex
# Test USBasp connection
# There is no need to edit avrdude.conf if using the USBasp rather than connections via GPIO pins.
# Run this command. "If it doesn’t error out and it says ‘deviced initialized’ towards the end then everything is good."
sudo avrdude -p atmega1284p -C /etc/avrdude.conf -c usbasp -v
# Flash the bootloader
sudo avrdude -p atmega1284p -C /etc/avrdude.conf -c usbasp -v -U flash:w:optiboot_atmega1284p.hex:i
Done! :)
- Original firmware: https://github.com/Creality3DPrinting/CR10-Melzi-1.1.2
- https://www.amazon.com/dp/B07ZVN1QCL?psc=1&ref=ppx_yo2_dt_b_product_details (USBasp hardware)
- https://the-eg.github.io/2020/09/19/flashing-ender3-firmware.html (bootloader download link and
avrdude
commands) - https://support.th3dstudio.com/helpcenter/8-bit-board-bootloader-flashing-guide-for-1284p-cpus/ (ISP header pinout images)
- https://www.reddit.com/r/CR10/comments/nkfbtq/cr10_usbtinyisp_arduinoisp_usb_bootloader/ (useful images)
- Attempting to flash the bootloader via ArduinioIDE with "Sanguino" board config. I successfully loaded the third-party board config but couldn't get the IDE to detect the board. Troubleshooting the board detection issues included attempting to run the IDE as root, creating udev rules, adding my user to the
dialout
group, etc. - Attempting to flash the bootloader via RPi bootable flashing image. The guide I found used Balena Etcher to write a RPi bootable disk image to a SD card, which is then used to boot the RPi and automatically flash the connected board via RPi pinout connections. This didn't work for me - I think because I was using a USBasp rather than pinout connections