docs: add CanBoot documentation to bootloaders.md

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-04-14 15:45:48 -04:00 committed by KevinOConnor
parent 5ec3939f34
commit 95d06c95e3
1 changed files with 38 additions and 0 deletions

View File

@ -408,6 +408,44 @@ The bootloader can be activated by pressing the reset button of the board twice.
As soon as the bootloader is activated, the board appears as a USB flash drive As soon as the bootloader is activated, the board appears as a USB flash drive
onto which the klipper.bin file can be copied. onto which the klipper.bin file can be copied.
### STM32F103/STM32F0x2 with CanBoot bootloader
The [CanBoot](https://github.com/Arksine/CanBoot) bootloader provides an option
for uploading Klipper firmware over the CANBUS. The bootloader itself is
derived from Klipper's source code. Currently CanBoot supports the STM32F103,
STM32F042, and STM32F072 models.
It is recommended to use a ST-Link Programmer to flash CanBoot, however it
should be possible to flash using `stm32flash` on STM32F103 devices, and
`dfu-util` on STM32F042/STM32F072 devices. See the previous sections in this
document for instructions on these flashing methods, substituting `canboot.bin`
for the file name where appropriate. The CanBoot repo linked above provides
instructions for building the bootloader.
The first time CanBoot has been flashed it should detect that no application
is present and enter the bootloader. If this doesn't occur it is possible to
enter the bootloader by pressing the reset button twice in succession.
The `flash_can.py` utility supplied in the `lib/canboot` folder may be used to
upload Klipper firmware. The device UUID is necessary to flash. If you do not
have a UUID it is possible to query nodes in currently running the bootloader:
```
python3 flash_can.py -q
```
This will return UUIDs for all connected nodes not currently assigned a UUID.
This should include all nodes currently in the bootloader.
Once you have a UUID, you may upload firmware with following command:
```
python3 flash_can.py -i can0 -f ~/klipper/out/klipper.bin -u aabbccddeeff
```
Where `aabbccddeeff` is replaced by your UUID. Note that the `-i` and `-f`
options may be omitted, they default to `can0` and `~/klipper/out/klipper.bin`
respectively.
When building Klipper for use with CanBoot, select the 8 KiB Bootloader option.
## STM32F4 micro-controllers (SKR Pro 1.1) ## STM32F4 micro-controllers (SKR Pro 1.1)
STM32F4 microcontrollers come equipped with a built-in system bootloader STM32F4 microcontrollers come equipped with a built-in system bootloader