New Feature: You can now upgrade the Kancan bootloader directly from Klipper over CAN bus, without needing remove the board from AMS.
This guide covers upgrading both the OAMS application firmware and the Kancan bootloader on your OpenAMS mainboard over CAN bus.
Your OpenAMS mainboard has two firmware components:
Upgrade order:
The bootloader update tool is included in the klipper_openams plugin you already have installed.
Update the plugin:
cd ~/klipper_openams
git pull
Find your device UUID:
source ~/klippy-env/bin/activate
python ~/katapult/scripts/flashtool.py -i can0 -q
Look for your OpenAMS device and note the UUID (e.g., 66e4a3d0cd57)
sudo service klipper stop
Wait 20 seconds to ensure Klipper has fully stopped and released the CAN interface.
source ~/klippy-env/bin/activate
python ~/katapult/scripts/flashtool.py -u <yourUUID> -f ~/printer_data/config/oams_2.0.22.bin
Replace <yourUUID> with your actual device UUID (e.g., 66e4a3d0cd57)
Expected output:
Attempting to connect to bootloader
Bootloader connected
Initializing (block size = 64)
Flashing '/home/pi/printer_data/config/oams_2.0.22.bin'...
[##################################################]
Write complete: X pages
Verifying (block size = 64)...
[##################################################]
Verification complete
CAN Flash Success
sudo service klipper restart
Important: Only proceed if Part 1 was successful and Klipper is running with the new application!
source ~/klippy-env/bin/activate
python ~/klipper_openams/scripts/flash_bootloader.py -i can0 -u <yourUUID> -f ~/printer_data/config/kancan_1.3.0.bin
Replace <yourUUID> with your device UUID
Expected output:
Reading bootloader from /home/pi/printer_data/config/kancan_1.3.0.bin
Opening CAN interface: can0
Starting bootloader update: 3488 bytes (4 KB)
Device ready to receive bootloader data
Sending 698 chunks (3488 bytes)...
Progress: 14.3% (500/3488 bytes)
Progress: 28.7% (1000/3488 bytes)
Progress: 43.0% (1500/3488 bytes)
Progress: 57.3% (2000/3488 bytes)
Progress: 71.6% (2500/3488 bytes)
Progress: 86.0% (3000/3488 bytes)
Progress: 100.0% (3488/3488 bytes)
Verifying bootloader CRC32...
Bootloader verified successfully
Committing new bootloader to active area...
Bootloader update complete!
Device will now reset...
The device will automatically reset after the bootloader is committed.
Issue a firmware restart from Mainsail/Fluidd to ensure everything is working.
The device should restart with the new bootloader and reconnect to Klipper.
Flash Memory Map:
0x08000000 ┌──────────────────┐
│ Active Bootloader│ ← Kancan (8KB max, currently ~3.5KB)
│ (lower 8KB) │
0x08002000 ├──────────────────┤
│ Staging Area │ ← Temporary write area during update
│ (upper 8KB) │
0x08004000 ├──────────────────┤
│ Application │ ← OAMS firmware
│ (112KB) │
0x08020000 └──────────────────┘
Double-buffered bootloader update:
Power-loss safe:
No plugging the board to USB required:
Problem: Bootloader not found or connection timeout
Solution:
sudo service klipper stopip link show can0Problem: Verification failed
Solution:
md5sum oams_2.0.22.binProblem: No response from device or Resource temporarily unavailable
Solution:
sudo service klipper statusProblem: CRC32 mismatch during verification
Solution:
Problem: Device doesn't reconnect after bootloader update
Solution:
FIRMWARE_RESTART from Klipper consoletail -f ~/printer_data/logs/klippy.logIf application won't boot:
If bootloader won't boot (should be very unlikely with this design):
Current stable versions:
If you encounter issues not covered here: