CanBoot bootloader (optional)
Canboot is a bootloader for MCUs to be able to update/flash them via CANBUS.
With CanBoot there is no physical intervention (e.g. pressing the boot button) required to flash/update firmware to the
MCUs.
This guide is tested with the following boards:
- Mellow Fly-SHT 42 v1
This guide was verified on a Pi running MainsailOS
Download CanBoot
Clone the CanBoot repository:
To add CanBoot to your moonraker update manager, add this section to your config (optional):[update_manager canboot]
type: git_repo
origin: https://github.com/Arksine/CanBoot.git
path: ~/CanBoot
is_system_service: False
Configure CanBoot
Open the config dialog with the following commands:
and use following config settings:- Micro-controller Architecture: STMicroelectronics STM32
- Processor model: STM32F072
- Build CanBoot deployment application: Do not build
- Clock Reference: 8 MHz crystal
- Communication interface: CAN bus (on PB8/PB9)
- Application start offset: 8KiB offset
- CAN bus speed: 500000
- Support bootloader entry on rapid double click of reset button: check (optional but recommend)
- Enable Status LED: check
- Status LED GPIO Pin: !PC13
this should then look like this:
use q
for exit and y
for save these settings.
These lines just clear the cache and compile the CanBoot bootloader:
Flash CanBoot
First, you have to put the board into DFU mode. To do this, plug in a jumper to the following pins and then plug in the usb cable:
With the command dfu-util -l
, you can check if the board is in DFU mode. If dfu-util can discover a board in DFU mode
it should then look like this:
If this is not the case, repeat the boot/restart process and test it again.
If your board is in DFU mode, you can flash CanBoot with the following command:
Now remove the jumper and unplug & plug-in the USB cable again. If the board is in CanBoot mode, the LED should blink.