The Firmware Updater plugin can be used to flash pre-compiled firmware images to your printer from a local file or URL.
- Supported Boards
- Plugin Installation
- Plugin Configuration
- Board-Specific Configuration
- Customizing the Command Lines
- Pre and Post Flash Settings
- Flashing
- Troubleshooting
- Donations
The plugn supports a variety of boards, based on the MCU (processor) they have:
- 'ATmega' family 8-bit MCUs (RAMPS, Sanguinololu, Melzi, Anet, Creality, Ender, many others)
- 'AT90USB' family 8-bit MCUs (Printrboard)
- 'LPC1768' MCUs (MKS SBASE, SKR v1.1 and v1.3, etc., also SKR Pro v1.1)
- 'SAM' family 32-bit MCUs (Arduino DUE, etc.)
- 'STM32' family 32-bits MCUs with embedded ST serial bootloader (FYSETC Cheetah, not SKR Pro)
- SKR Mini E3 - waiting on more information, see this issue
It seems that SKR have included a custom bootloader which enables their STM32-based SKR Pro v1.1 to be flashed using the same copy-and-reset procedure as their LPC1768-based boards. Please follow the LPC1768 instructions for an SKR Pro v1.1 board.
Please open a Github issue if you would like a new board or MCU to be supported. If it's a new type of board which requires hardware testing please consider making a donation to help fund the costs.
Install via the bundled Plugin Manager or manually using this URL: https://github.com/OctoPrint/OctoPrint-FirmwareUpdater/archive/master.zip
The appropriate flashing tool for the board type needs to be selected.
Board Family | Flashing Tool |
---|---|
ATmega | avrdude |
AT90USB | dfu-programmer |
LPC1768 | lpc1768 |
SAM | bossac |
STM32 | stm32flash |
It seems that SKR have included a custom bootloader which enables their STM32-based SKR Pro v1.1 to be flashed using the same copy-and-reset procedure as their LPC1768-based boards. Please follow the LPC1768 instructions for an SKR Pro v1.1 board.
Plugin settings vary depending on the flashing tool and are documented below.
To flash an ATmega-based board the tool avrdude
needs to be installed on the OctoPrint host.
sudo apt-get update
sudo apt-get install avrdude
Information about the package needed can be found here Ubuntu avrdude package
sudo add-apt-repository ppa:pmjdebruijn/avrdude-release
sudo apt-get update
sudo apt-get install avrdude
The minimum settings are:
- AVR MCU Type
- Path to avrdude
- AVR Programmer Type
Typical MCU/programmer combinations are:
AVR MCU | Programmer | Example Board |
---|---|---|
Atmega1284p | arduino | Anet A series, Creality, Ender, etc. |
Atmega2560 | wiring | RAMPS, RAMbo, etc. |
Atmega644p | arduino | Sanguinololu, Melzi |
Optional advanced settings are available for:
- Baud rate - sets the speed for communication with the board
- Avrdude config file - overrides the default config file with a custom one
- Disabling write verification - speeds up flashing by not verifying the write operation
- Customizing the avrdude command line
- Disabling the bootloader warning - disables a warning which is shown the hex filename has 'bootloader' in it
To flash an AT90USB-based board the tool dfu-programmer
needs to be installed on the OctoPrint host.
A version of dfu-programmer
can be installed via apt-get install
but it is outdated. Please build the latest version from Github using these commands:
cd ~
sudo apt-get install autoconf libusb-1.0-0-dev
git clone https://github.com/dfu-programmer/dfu-programmer.git
cd dfu-programmer
./bootstrap.sh
./configure
make
sudo make install
If there were no errors dfu-programmer
should now be installed at /usr/local/bin/dfu-programmer.
The minimum settings are:
- AVR MCU Type
- Path to dfu-programmer
Optional advanced settings are available for:
- Customizing the command lines for erasing and flashing the board
AT90USB boards must be in Boot or DFU mode before they can be flashed. This is done by placing or removing a jumper then resetting the board.
For Printrboard:
- Remove the BOOT jumper (for Rev D, E & F boards, install the BOOT jumper)
- Press and release the Reset button.
- Replace the BOOT jumper onto the board (for Rev D, E & F boards, remove the BOOT jumper)
The board will now be ready for flashing. Once flashing is complete press the Reset button again to return to normal operation.
Flashing an LPC1768 board requires that the host can mount the board's on-board SD card to a known mount point in the host filesystem.
There are several ways to do this, but using usbmount works well and is documented below. It will mount the SD card to /media/usb
.
Note: The Marlin board configuration must have SDCARD_CONNECTION ONBOARD
(previously USB_SD_ONBOARD
) enabled so that the on-board SD card is presented to the host via the USB connection. This seems to be the default configuration for Marlin's LPC1768 boards. It is configured in the board's pins file.
Once installed, usbmount requires some tweaking to make it work well on the Raspberry Pi. The instructions below assume that you are running OctoPrint on a Raspberry Pi, as the user 'pi'.
-
Install usbmount
sudo apt-get install usbmount
-
Configure usbmount so that the mount has the correct permissions for the 'pi' user
sudo nano /etc/usbmount/usbmount.conf
Find FS_MOUNTOPTIONS and change it to:
FS_MOUNTOPTIONS="-fstype=vfat,gid=pi,uid=pi,dmask=0022,fmask=0111"
-
Configure systemd-udevd so that the mount is accessible
sudo systemctl edit systemd-udevd
Insert these lines then save and close the file:
[Service] MountFlags=shared
Then run:
sudo systemctl daemon-reload sudo service systemd-udevd --full-restart
Once usbmount is installed and configured the LPC1768 on-board SD card should be mounted at /media/usb
the next time it is plugged in or restarted.
The only required setting is the path to the firmware update folder. If using usbmount it will probably be /media/usb
.
Optional advanced settings are available for:
- Resetting the board prior to flashing - adds an extra board reset which can help ensure that the SD card is mounted correctly
Some boards (e.g. SKR v1.3) have been known to ship with older Marlin firmware which does not support the M997
command, so must be updated conventionally one time before using the plugin. A board running too-old Marlin firmware will log 'Board reset failed' when attempting to flash from the plugin.
If flashing an existing Marlin installation, the existing firmware must be newer than March 2nd, 2019 (i.e this commit) as that is when the M997
was added to support resetting the board.
The firmware upload will fail if the SD card is not accessible, either because it is not mounted on the host, or because the printer firmware has control over it.
To flash a SAM-based board the tool bossac
needs to be installed on the OctoPrint host.
Bossac cannot be installed using a package manager as the packaged version is out of date and will not work. Installation from source is straight-forward.
cd ~/
sudo apt-get install libwxgtk3.0-dev libreadline-dev
wget https://github.com/shumatech/BOSSA/archive/1.7.0.zip
unzip 1.7.0.zip
cd BOSSA-1.7.0
./arduino/make_package.sh
sudo cp ~/BOSSA-1.7.0/bin/bossac /usr/local/bin/
The only required setting is the path to the bossac binary.
Optional advanced settings are available for:
- Disabling write verification - speeds up flashing by not verifying the write operation
- Customizing the bossac command line
To flash an STM32-based board the tool stm32flash
needs to be installed on the OctoPrint host.
sudo apt-get update
sudo apt-get install stm32flash
brew install stm32flash
You can install a Windows binary from https://sourceforge.net/projects/stm32flash/ however the plugin hasn't been tested on that platform.
Unlike avrdude, verification is done during write process after each packet. Writing process is longer than other flashing methods, but there is no verification after the write. It is strongly recommended to keep it enabled.
When using ST serial bootloader, the boards needs to enter into bootloader mode by setting up the MCU BOOT0 input to HIGH and then proceeding with a MCU RESET input to LOW.
Such MCU inputs are generally connected to RTS/DTR signals of the USB-UART transceiver. For example, FYSETC Cheetah uses RTS to set BOOT0, and DTR to reset.
Please set STM32Flash BOOT0/Reset according to your board.
Unlike other MCU, STM32 ones will remain in bootloader mode after resetting DTR line and realeasing UART. The bootloader needs an explicit command to jump at a given flash address.
Please setup Execution address according to your board.
When setting Execution address, reset option is ignored by stm32flash. Setting Reset instead of Execution address will actually send an Execute @ 0x00000000
, which is where the bootloader is located. You will then need to power cycle your board to execute firmware. This option is not recommended then.
The command lines for avrdude
, bossac
, and dfu-programmer
can be customized by editing the string in the advanced settings for the flash method. Text in braces ({}
) will be substituted for preconfigured values if present.
String | Description |
---|---|
{avrdude} |
Full path to the avrdude executable1 |
{bossac} |
Full path to the bossac executable2 |
{dfuprogrammer} |
Full path to the dfu-programmer executable3 |
{mcu} |
MCU type4 |
{programmer} |
Avrdude programmer1 |
{port} |
COM port the printer is connected to |
{conffile} |
Full path to the avrdude configuration file1 |
{baudrate} |
Serial port speed1 |
{disableverify} |
Switch to disable write verification |
{firmware} |
Path to the uploaded firmware file |
- avrdude flash method only
- bossac flash method only
- dfu-programmer flash method only
- avrdude and dfu-programmer flash methods
Command lines can be returned to the default by clicking the Reset button.
{avrdude} -v -q -p {mcu} -c {programmer} -P {port} -D -C {conffile} -b {baudrate} {disableverify} -U flash:w:{firmware}:i
{bossac} -i -p {port} -U true -e -w {disableverify} -b {firmware} -R
Erase: {bossac} -i -p {port} -U true -e -w {disableverify} -b {firmware} -R
Flash:
Specify a system command to run on the host prior to flashing.
Specify a system command to run on the host after flashing.
This setting can be used to insert a delay of up to 180s after the firmware has been uploaded. This can be useful if the board takes some time to restart. A delay of 20-30s is usually enough.
You can use the post-flash gcode settings to run gcode commands after a successful firmware flash. The post-flash code will run more or less immediately if the printer was connected before the flash started (so reconnects automatically when the flash finishes), or whenever the printer is manually reconnected after the firmware is flashed.
Once the plugin is configured, flashing firmware is a simple operation:
- Select the COM port to communicate with the board
- Select a firmware file, either located on the filesystem or via a URL
- Click the appropriate Flash from button
- Wait for the firmware update to complete
Log messages can be found in the OctoPrint log octoprint.log
and the Firmware Updater's console log plugin_firmwareupdater_console.log
.
Both log files can be downloaded from OctoPrint's logging interface, found under 'Logging' in the settings page.
If you have trouble using the plugin please check these logs for any error messages. If you need help, please include both logs when reporting a problem.
Donations to help with the cost of test hardware are gratefully received using any of the methods below.
Currency | Link |
---|---|
Bitcoin | 1GjUmcjnAxCr9jFPUtVrr6gPQz8FhYddZz |
Bitcoin Cash | bitcoincash:qzqys6mv9rgg7dxx0m4jzgqjezu9sryk2vmdexcr56 |
Ethereum | 0xA1788874E851b425F65FF5bcB6180b0d9F50fB6d |
USD | https://www.paypal.com/ |