Skip to content

1_Flash_Einsy_USB_bootloader_en

ph3x edited this page Dec 22, 2021 · 4 revisions

WARNING! WARNING! WARNING!

FOLLOWING THIS TUTORIAL CAN SERIOUSLY HARM YOUR PRINTER!

WARNING! WARNING! WARNING!

This tutorial is for information only - we accept no liability for any damage!!

Special thanks to Chris Warkocki for his Tutorial, which we use as a base for our tutorial.

We will keep the setup a bit simpler by only using a Raspberry Pi (which will be needed for klipper anyways).

If you choose to flash your Einsy Board with an USBasp please follow the tutorial from Chris.

Why do we need to flash the Einsy Board?

The serial connection of the Prusa Einsy Board with factory settings is too slow to handle the lightning fast baud rate klipper is using to send commands to the printer. Therefore we need to flash an optimized firmware to the USB controller of the Einsy Board.

Manual

Software

Install a debian-based linux system on your Raspberry Pi (our recommendation for klipper is FluiddPi).

Open up a ssh connection to your Raspberry Pi and run sudo apt update and sudo apt upgrade -y to update your packages to the latest versions. Next install the required packages using sudo apt install avrdude gcc-avr make git -y (git will be used for the next steps, for more information see the manual from adafruit - installation)

Restart your Raspberry. Then edit/etc/avrdude.conf. (For more information see the manual from adafruit - configuration)

For example use sudo nano /etc/avrdude.conf and head for the section containing linuxgpio. Edit the block so it looks like this:

programmer
  id    = "pi_1";
  desc  = "Use the Linux sysfs interface to bitbang GPIO lines";
  type  = "linuxgpio";
  reset = 12;
  sck   = 24;
  mosi  = 23;
  miso  = 18;
;

(Dont forget to out comment the relevant lines)

With this change you created a "pi_1" programmer which will be used to program the USB controller of the Einsi Board.

Power down your Raspberry Pi now (sudo poweroff) and disconnect your Raspberry Pi AND your printer from mains power!

Hardware

For correct cabling we use a modified version of this manual. Please have a look at the pictures for reference and also check out the Raspberry Pi (https://github.com/PrusaOwners/mk3-32u2-firmware) dokumentation.

Einsy PIN Position Einsy Board Raspberry PIN Description
1 Top left GPIO #18 MISO
2 Top right 5V VCC
3 Middle left GPIO #24 SCK
4 Middle right GPIO #23 MOSI
5 Bottom left GPIO #12 Reset
6 Bottom right GND GND

Check your cabling - twice - and a third time! Failing to do so can seriously harm your printer! Take care!

Flashing

Now it´s getting serious. If you´re really really (!) sure about the correct cabling then it´s time to power on your Raspberry Pi but NOT your Prusa printer!

Backup the actual firmware: sudo avrdude -p m32u2 -F -c pi_1 -U flash:r:firmware_backup.hex:i -U eeprom:r:eeprom.hex:i -U lfuse:r:lowfuse:h -U hfuse:r:highfuse:h -U efuse:r:exfuse:h -U lock:r:lockfuse:h

Place fuse: sudo avrdude -p m32u2 -F -c pi_1 -U hfuse:w:0xD1:m

Download the new firmware: wget https://raw.githubusercontent.com/PrusaOwners/mk3-32u2-firmware/master/hex_files/DFU-hoodserial-combined-PrusaMK3-32u2.hex

Flashing the new firmware: sudo avrdude -p m32u2 -F -c pi_1 -U flash:w:DFU-hoodserial-combined-PrusaMK3-32u2.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m

(If you encounter errors while flashing (more precisely during the verify or fuse part) just turn off and on your Raspbery Pi and start over. But pay attention to not overwrite your backup!).

Wooohoooo

Congratulations! The USB connection of your Prusa printer is now lightning fast! :)

Clone this wiki locally