The following steps consists of instruction to setup CAN communication in between BTT Manta M5P with BTT CB1 embed onto it and BTT EBB36 with the help of CanBoot Bootloader that is to be installed.
For the first time use of the BTT CB1, make sure the OS is installed and the Wifi is configured. For first time installation of the OS image, refer to the Official CB1 GitHub release page or the local Fracktal CB1 documentation
After the above steps, SSH into the CB1, preferably using 'Bitvise SSH Client'. Open the terminal and update the OS using sudo apt update. After the update, Follow the steps to install USB to CAN communication based klipper firmware in the BTT Manta M5P. Make sure klipper is installed in the CB1.
cd ~/klipper/make menuconfig
[\*] Enable extra low level configuration options
Micro controller Architecture (STMicroelectronics STM32 )
Processor model (STM32G0B1 )
Bootloader offset 8 KiB bootloader)
Clock Reference (8 MHz crystal)
Communication interface (USB to CAN bus bridge (USB on PA11/PA12))
CAN bus interface (CAN bus (on PD0/PD1))
(500000) CAN bus speed
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'klipper.bin' file
Now, enter DFU mode by holding BOOT and tapping RESET, and then letting go of BOOT. Send lsusb in the terminal, and then search for a port 0483:df11. If it is present, it means that the board is in DFU mode.
Flash the firmware by entering in the command:
make flash FLASH_DEVICE=0483:df11
In order to get the UUID of the board, enter the command in the terminal:
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Store this UUID safely in order to use in the klipper's configuration.
Following are the steps to install CanBoot Bootloader in the EBB36 board in order to setup CanBus and get the unique UUID.
SSH into the CB1 and enter the following commands:
cd ~git clone https://github.com/Arksine/CanBoot.gitcd ~/CanBootmake menuconfig
Here, we initially set the CanBoot Bootloader installation in the BTT EBB36 Toolboard. After make menuconfig, the following are to be set up:
Micro-controller Architecture (STMicroelectronics STM32) --->
Processor model (STM32G0B1) --->
Build CanBoot deployment application (8KiB bootloader) --->
Clock Reference (8 MHz crystal) --->
Communication interface (CAN bus (on PB0/PB1)) --->
Application start offset (8KiB offset) --->
(500000) CAN bus speed
() GPIO pins to set on bootloader entry
[*] Support bootloader entry on rapid double click of reset button
[ ] Enable bootloader entry on button (or gpio) state
[ ] Enable Status LED
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'canboot.bin' file
- In the SSH client, select the SFTP option to browse through the files of the CB1.
- Now go through CB1 directories and enter the path of
home/biqu/CanBoot/outand download thecanboot.binfile into the system. - Download the software of
STM32CubeProgrammerinto your local system from here and select the version according to your system.
Note: Preferably download the version of 2.10.0 since the latest version could cause problems in flashing the EBB boards.
- Connect your EBB36 board to the system using 'USB type C' cable. Make sure the
jumperis put into theVUSBpins of the board. 
After connecting with the USB cable, Press and hold the Boot button, then click the RST button to enter DFU mode.
-
Click the "Refresh" button in the STM32CubeProgrammer until the Port changes from "No DFU d..." to "USB1", then click "Connect" to connect the chip.
- Select the
downloadbutton on the left column. - Click on
Full chip erase. It will ask for confirmation, clickOKafter it. Then a message pops up saying the 'mass erase command correctly executed.' Ignore the rest of the message
-
- click on the 'Browse' button. Select the path of the
canboot.binfile wherever it was downloaded. - Click on
Start Programming. A message should pop up saying 'Download verified successfully'. Another pop up will come up saying 'File download complete'
- click on the 'Browse' button. Select the path of the
-
Click on 'Disconnect' on top right and disconnect the board from the system.
Make the connections of CANBUS between both EBB36 and the Manta M5P boards. Refer the Twin Dragon Electronics to know about it.
After making the connections, check the UUID of the EBB board using the command
~/CanBoot/scripts/flash_can.py -i can0 -q
Note the UUID for future use. Make sure that, it is mentioned as CanBoot beside the UUID
Now, we make the Klipper FIrmware for the EBB36 Toolboard.
SSH into the CB1 and enter the following commands:
cd ~/klipper/make menuconfig
Micro-controller Architecture (STMicroelectronics STM32) --->
Processor model (STM32G0B1) --->
Build CanBoot deployment application (8KiB bootloader) --->
Clock Reference (8 MHz crystal) --->
Communication interface (CAN bus (on PB0/PB1)) --->
Application start offset (8KiB offset) --->
(500000) CAN bus speed
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'klipper.bin' file
In order to flashh the EBB with Klipper, enter the command:
python3 ~/CanBoot/scripts/flash_can.py -i can0 -f ~/klipper/out/klipper.bin -u (Put_Your_UUID_Here)
In the terminal, enter the command:
~/CanBoot/scripts/flash_can.py -i can0 -q
or
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Make sure that, it is mentioned as Klipper beside the UUID.
Note: check the can0 setup by entering:
sudo nano /etc/network/interfaces.d/can0
and enter in:
allow-hotplug can0
iface can0 can static
bitrate 500000
up ifconfig $IFACE txqueuelen 2048
Now, in the printer.cfg file, enter these UUIDs in different [mcu] sections of each motherboard and toolboard. The UUID can be written in the canbus_uuid: line
The following steps consists of instruction to setup CAN communication in between BTT Manta M5P with BTT CB1 embed onto it and a RP2040 based CAN toolboard with the help of CanBoot Bootloader that is to be installed.
For the first time use of the BTT CB1, make sure the OS is installed and the Wifi is configured. For first time installation of the OS image, refer to the Official CB1 GitHub release page or the local Fracktal CB1 documentation
After the above steps, SSH into the CB1, preferably using 'Bitvise SSH Client'. Open the terminal and update the OS using sudo apt update. After the update, Follow the steps to install USB to CAN communication based klipper firmware in the BTT Manta M5P. Make sure klipper is installed in the CB1.
cd ~/klipper/make menuconfig
[\*] Enable extra low level configuration options
Micro controller Architecture (STMicroelectronics STM32 )
Processor model (STM32G0B1 )
Bootloader offset 8 KiB bootloader)
Clock Reference (8 MHz crystal)
Communication interface (USB to CAN bus bridge (USB on PA11/PA12))
CAN bus interface (CAN bus (on PD0/PD1))
(500000) CAN bus speed
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'klipper.bin' file
Now, enter DFU mode by holding BOOT and tapping RESET, and then letting go of BOOT. Send lsusb in the terminal, and then search for a port 0483:df11. If it is present, it means that the board is in DFU mode.
Flash the firmware by entering in the command:
make flash FLASH_DEVICE=0483:df11
In order to get the UUID of the board, enter the command in the terminal:
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Store this UUID safely in order to use in the klipper's configuration.
Following are the steps to install CanBoot Bootloader in the RP2040 in order to setup CanBus and get the unique UUID.
SSH into the CB1 and enter the following commands:
cd ~git clone https://github.com/Arksine/CanBoot.gitcd ~/CanBootmake menuconfig
Here, we initially set the CanBoot Bootloader installation in the RP2040 Toolboard. After make menuconfig, the following are to be set up:
Micro-controller Architecture (Raspberry Pi RP2040) --->
Flash chip (W25Q080 with CLKDIV 2) --->
Build CanBoot deployment application (Do not build) --->
Communication interface (CAN bus) --->
(0) CAN RX gpio number
(1) CAN TX gpio number
(500000) CAN bus speed
() GPIO pins to set on bootloader entry
[*] Support bootloader entry on rapid double click of reset button
[ ] Enable bootloader entry on button (or gpio) state
[*] Enable Status LED
(gpio2) Status LED GPIO Pin
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'canboot.uf2' file
Now, enter bootloader mode by holding BOOT and tapping RESET, and then letting go of BOOT (OR) Remove the USB cable, hold BOOT and while holding, reconnect the USB cable. Send lsusb in the terminal, and then search for a port 2e8a:0003. If it is present, it means that the board is in bootloader mode.
Flash the CanBoot firmware by entering in the command:
sudo make flash FLASH_DEVICE=2e8a:0003
In order to get the UUID of the board, enter the command in the terminal:
python3 ~/CanBoot/scripts/flash_can.py -q
Note the UUID in order to use it to flash the klipper.uf2 file. Make sure that, it is mentioned as CanBoot beside the UUID
Now, we make the Klipper FIrmware for the RP2040 Toolboard.
SSH into the CB1 and enter the following commands:
cd ~/klipper/make menuconfig
[*] Enable extra low-level configuration options
Micro-controller Architecture (Raspberry Pi RP2040) --->
Bootloader offset (16KiB bootloader) --->
Communication interface (CAN bus) --->
(0) CAN RX gpio number
(1) CAN TX gpio number
(500000) CAN bus speed
() GPIO pins to set at micro-controller startup
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'klipper.bin' file
In order to flash the RP2040 toolboard with Klipper, enter the command:
python3 ~/CanBoot/scripts/flash_can.py -i can0 -f ~/klipper/out/klipper.bin -u (Put_Your_UUID_Here)
In the terminal, enter the command:
~/CanBoot/scripts/flash_can.py -i can0 -q
or
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Make sure that, it is mentioned as Klipper beside the UUID.
Note: check the can0 setup by entering:
sudo nano /etc/network/interfaces.d/can0
and enter in:
allow-hotplug can0
iface can0 can static
bitrate 500000
up ifconfig $IFACE txqueuelen 2048
Now, in the printer.cfg file, enter these UUIDs in different [mcu] sections of each motherboard and toolboard. The UUID can be written in the canbus_uuid: line
Setting CAN in (BTT Manta M8P + BTT CB1) + BTT U2C + RP2040 (similar to MKS TH36) based CAN toolboard
For the first time use of the BTT CB1, make sure the OS is installed and the Wifi is configured. For first time installation of the OS image, refer to the Official CB1 GitHub release page or the local Fracktal CB1 documentation
After the above steps, SSH into the CB1, preferably using 'Bitvise SSH Client'. Open the terminal and update the OS using sudo apt update. After the update, Follow the steps to install USB to CAN communication based klipper firmware in the BTT Manta M5P. Make sure klipper is installed in the CB1.
cd ~/klipper/make menuconfig
[*] Enable extra low-level configuration options
Micro-controller Architecture (STMicroelectronics STM32) --->
Processor model (STM32G0B1) --->
Bootloader offset (8KiB bootloader) --->
Clock Reference (8 MHz crystal) --->
Communication interface (USB (on PA11/PA12)) --->
USB ids --->
() GPIO pins to set at micro-controller startup
After setting, hit Q and then hit Y when asked to save changes
-
Enter
make clean, and then entermake. This will compile the 'klipper.bin' file and will be generated inhome/pi/klipper/outfolder when make is finished, download it onto your computer using the ssh application. -
Rename
klipper.bintofirmware.bin, Copy to the SD card root directory, insert the SD card into the SD card slot of the MANTA M8P, click theresetbutton or power on again. The firmware will be updated automatically. After the update, thefirmware.binin the SD card will be renamed asFIRMWARE.CUR. -
Enter: ls
/dev/serial/by-id/in terminal to check motherboad ID to confirm whether firmware is updated successfully. It will generate a serial ID, something likeusb-Klipper_stm32g0b1xx_4100230011504B4633373520-if00. Copy and save this ID,it is needed when modifying klipper application.
- We can input:
make flash FLASH_DEVICE=/dev/serial/by-id/usb-Klipper_stm32g0b1xx_4100230011504B4633373520-if00to update firmware. Use the actual ID generated by your device.
-
There will be an error message “dfu-util: Error during download get_status” after update. Just ignore it.
-
Now enter the same path and serial ID in the
printer.cfgfile, under the[mcu]section, front of theserial:macro in order to configure the connection.
Note: The following steps are to be followed only when the U2C module comes in pre-installed when it arrives for precautionary purposes.
-
In the terminal, type in
sudo nano /etc/network/interfaces.d/can0to set the CAN network configuration that is required. -
Set in the settings as follows:
allow-hotplug can0
iface can0 can static
bitrate 500000
up ifconfig $IFACE txqueuelen 128
-
Save the file with
CTRL-xand reboot the pi withsudo reboot -
Verify the network via
ip -s link show can0which should reflect that the CAN network is UP. If the network is not found, connect your U2C via USB and repeat the command to verify thecan0network is up.
Following are the steps to install CanBoot Bootloader in the RP2040 in order to setup CanBus and get the unique UUID.
SSH into the CB1 and enter the following commands:
cd ~git clone https://github.com/Arksine/CanBoot.gitcd ~/CanBootmake menuconfig
Here, we initially set the CanBoot Bootloader installation in the RP2040 Toolboard. After make menuconfig, the following are to be set up:
Micro-controller Architecture (Raspberry Pi RP2040) --->
Flash chip (W25Q080 with CLKDIV 2) --->
Build CanBoot deployment application (Do not build) --->
Communication interface (CAN bus) --->
(0) CAN RX gpio number
(1) CAN TX gpio number
(500000) CAN bus speed
() GPIO pins to set on bootloader entry
[*] Support bootloader entry on rapid double click of reset button
[ ] Enable bootloader entry on button (or gpio) state
[*] Enable Status LED
(gpio2) Status LED GPIO Pin
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'canboot.uf2' file
Now, enter bootloader mode by holding BOOT and tapping RESET, and then letting go of BOOT (OR) Remove the USB cable, hold BOOT and while holding, reconnect the USB cable. Send lsusb in the terminal, and then search for a port 2e8a:0003. If it is present, it means that the board is in bootloader mode.
Flash the CanBoot firmware by entering in the command:
sudo make flash FLASH_DEVICE=2e8a:0003
In order to get the UUID of the board, enter the command in the terminal:
python3 ~/CanBoot/scripts/flash_can.py -q
Note the UUID in order to use it to flash the klipper.uf2 file. Make sure that, it is mentioned as CanBoot beside the UUID
Now, we make the Klipper FIrmware for the RP2040 Toolboard.
SSH into the CB1 and enter the following commands:
cd ~/klipper/make menuconfig
[*] Enable extra low-level configuration options
Micro-controller Architecture (Raspberry Pi RP2040) --->
Bootloader offset (16KiB bootloader) --->
Communication interface (CAN bus) --->
(0) CAN RX gpio number
(1) CAN TX gpio number
(500000) CAN bus speed
() GPIO pins to set at micro-controller startup
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'klipper.bin' file
In order to flash the RP2040 toolboard with Klipper, enter the command:
python3 ~/CanBoot/scripts/flash_can.py -i can0 -f ~/klipper/out/klipper.bin -u (Put_Your_UUID_Here)
In the terminal, enter the command:
~/CanBoot/scripts/flash_can.py -i can0 -q
or
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Make sure that, it is mentioned as Klipper beside the UUID.
Now, in the printer.cfg file, enter these UUIDs in different [mcu] sections of each toolboard. The UUID can be written in the canbus_uuid: line
Note: The following steps are to be followed only when the firmware for the BTT U2C is sourced from here or from the uploaded firmware .zip file above.
-
In the terminal, type in
sudo nano /etc/network/interfaces.d/can0to set the CAN network configuration that is required. -
Set in the settings as follows:
allow-hotplug can0
iface can0 can static
bitrate 1000000
up ifconfig $IFACE txqueuelen 512
pre-up ip link set can0 type can bitrate 1000000
pre-up ip link set can0 txqueuelen 512
-
Save the file with
CTRL-xand reboot the pi withsudo reboot -
Verify the network via
ip -s link show can0which should reflect that the CAN network is UP. If the network is not found, connect your U2C via USB and repeat the command to verify thecan0network is up.
Next we process the candleLight-based firmware into U2C and follow certain steps given below:
- Download the file from bigtreetech comment
- Stop klipper
sudo systemctl stop klipper - Bring down the can interface
sudo ifdown can0 - Unzip the firmware file from bigtreetech
- Unplug the u2c controller from usb
- Press and hold the boot button on the u2c and plug the usb cable back in, then release the boot button.
- Verify that the u2c is in dfu mode
dfu-util -lYou should see lines that contain Found DFU: [0483:df11] - Flash the new firmware to the u2c
dfu-util -D G0B1_U2C_V2.bin -d 0483:df11 -a 0 -s 0x08000000:leave - Unplug and replug in the usb cable for the u2c to reset it
- The CAN interface should now be back up
- Start klipper
sudo systemctl start klipper - Follow the steps to compile and flash canboot to the EBB (more on this later)
- Follow the steps to compile and flash klipper over CAN (more on this later)
- Success
When this is done, ADD THE JUMPER for the 120 ohm resistor to the U2C and set the U2C aside
Power cycle the U2C board in order to re-establish the network.
Following are the steps to install CanBoot Bootloader in the RP2040 in order to setup CanBus and get the unique UUID.
SSH into the CB1 and enter the following commands:
cd ~git clone https://github.com/Arksine/CanBoot.gitcd ~/CanBootmake menuconfig
Here, we initially set the CanBoot Bootloader installation in the RP2040 Toolboard. After make menuconfig, the following are to be set up:
Micro-controller Architecture (Raspberry Pi RP2040) --->
Flash chip (W25Q080 with CLKDIV 2) --->
Build CanBoot deployment application (Do not build) --->
Communication interface (CAN bus) --->
(0) CAN RX gpio number
(1) CAN TX gpio number
(500000) CAN bus speed
() GPIO pins to set on bootloader entry
[*] Support bootloader entry on rapid double click of reset button
[ ] Enable bootloader entry on button (or gpio) state
[*] Enable Status LED
(gpio2) Status LED GPIO Pin
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'canboot.uf2' file
Now, enter bootloader mode by holding BOOT and tapping RESET, and then letting go of BOOT (OR) Remove the USB cable, hold BOOT and while holding, reconnect the USB cable. Send lsusb in the terminal, and then search for a port 2e8a:0003. If it is present, it means that the board is in bootloader mode.
Flash the CanBoot firmware by entering in the command:
sudo make flash FLASH_DEVICE=2e8a:0003
In order to get the UUID of the board, enter the command in the terminal:
python3 ~/CanBoot/scripts/flash_can.py -q
Note the UUID in order to use it to flash the klipper.uf2 file. Make sure that, it is mentioned as CanBoot beside the UUID
Now, we make the Klipper FIrmware for the RP2040 Toolboard.
SSH into the CB1 and enter the following commands:
cd ~/klipper/make menuconfig
[*] Enable extra low-level configuration options
Micro-controller Architecture (Raspberry Pi RP2040) --->
Bootloader offset (16KiB bootloader) --->
Communication interface (CAN bus) --->
(0) CAN RX gpio number
(1) CAN TX gpio number
(500000) CAN bus speed
() GPIO pins to set at micro-controller startup
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'klipper.bin' file
In order to flash the RP2040 toolboard with Klipper, enter the command:
python3 ~/CanBoot/scripts/flash_can.py -i can0 -f ~/klipper/out/klipper.bin -u (Put_Your_UUID_Here)
In the terminal, enter the command:
~/CanBoot/scripts/flash_can.py -i can0 -q
or
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Make sure that, it is mentioned as Klipper beside the UUID.
Now, in the printer.cfg file, enter these UUIDs in different [mcu] sections of each toolboard. The UUID can be written in the canbus_uuid: line
The following steps consists of instruction to setup CAN communication in between BTT Manta M8P with BTT CB1 embed onto it and a RP2040 based CAN toolboard with the help of CanBoot Bootloader that is to be installed.
For the first time use of the BTT CB1, make sure the OS is installed and the Wifi is configured. For first time installation of the OS image, refer to the Official CB1 GitHub release page or the local Fracktal CB1 documentation
After the above steps, SSH into the CB1, preferably using 'Bitvise SSH Client'. Open the terminal and update the OS using sudo apt update. After the update, Follow the steps to install USB to CAN communication based klipper firmware in the BTT Manta M5P. Make sure klipper is installed in the CB1.
cd ~/klipper/make menuconfig
[\*] Enable extra low level configuration options
Micro controller Architecture (STMicroelectronics STM32 )
Processor model (STM32G0B1 )
Bootloader offset 8 KiB bootloader)
Clock Reference (8 MHz crystal)
Communication interface (USB to CAN bus bridge (USB on PA11/PA12))
CAN bus interface (CAN bus (on PD12/PD13))
(500000) CAN bus speed
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'klipper.bin' file
Now, enter DFU mode by holding BOOT and tapping RESET, and then letting go of BOOT. Send lsusb in the terminal, and then search for a port 0483:df11. If it is present, it means that the board is in DFU mode.
Flash the firmware by entering in the command:
make flash FLASH_DEVICE=0483:df11
In order to get the UUID of the board, enter the command in the terminal:
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Store this UUID safely in order to use in the klipper's configuration.
Following are the steps to install CanBoot Bootloader in the RP2040 in order to setup CanBus and get the unique UUID.
SSH into the CB1 and enter the following commands:
cd ~git clone https://github.com/Arksine/CanBoot.gitcd ~/CanBootmake menuconfig
Here, we initially set the CanBoot Bootloader installation in the RP2040 Toolboard. After make menuconfig, the following are to be set up:
Micro-controller Architecture (Raspberry Pi RP2040) --->
Flash chip (W25Q080 with CLKDIV 2) --->
Build CanBoot deployment application (Do not build) --->
Communication interface (CAN bus) --->
(0) CAN RX gpio number
(1) CAN TX gpio number
(500000) CAN bus speed
() GPIO pins to set on bootloader entry
[*] Support bootloader entry on rapid double click of reset button
[ ] Enable bootloader entry on button (or gpio) state
[*] Enable Status LED
(gpio2) Status LED GPIO Pin
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'canboot.uf2' file
Now, enter bootloader mode by holding BOOT and tapping RESET, and then letting go of BOOT (OR) Remove the USB cable, hold BOOT and while holding, reconnect the USB cable. Send lsusb in the terminal, and then search for a port 2e8a:0003. If it is present, it means that the board is in bootloader mode.
Flash the CanBoot firmware by entering in the command:
sudo make flash FLASH_DEVICE=2e8a:0003
In order to get the UUID of the board, enter the command in the terminal:
python3 ~/CanBoot/scripts/flash_can.py -q
Note the UUID in order to use it to flash the klipper.uf2 file. Make sure that, it is mentioned as CanBoot beside the UUID
Now, we make the Klipper FIrmware for the RP2040 Toolboard.
SSH into the CB1 and enter the following commands:
cd ~/klipper/make menuconfig
[*] Enable extra low-level configuration options
Micro-controller Architecture (Raspberry Pi RP2040) --->
Bootloader offset (16KiB bootloader) --->
Communication interface (CAN bus) --->
(0) CAN RX gpio number
(1) CAN TX gpio number
(500000) CAN bus speed
() GPIO pins to set at micro-controller startup
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'klipper.bin' file
In order to flash the RP2040 toolboard with Klipper, enter the command:
python3 ~/CanBoot/scripts/flash_can.py -i can0 -f ~/klipper/out/klipper.bin -u (Put_Your_UUID_Here)
In the terminal, enter the command:
~/CanBoot/scripts/flash_can.py -i can0 -q
or
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Make sure that, it is mentioned as Klipper beside the UUID.
Note: check the can0 setup by entering:
sudo nano /etc/network/interfaces.d/can0
and enter in:
allow-hotplug can0
iface can0 can static
bitrate 500000
up ifconfig $IFACE txqueuelen 2048
Now, in the printer.cfg file, enter these UUIDs in different [mcu] sections of each motherboard and toolboard. The UUID can be written in the canbus_uuid: line
The following steps consists of instruction to setup CAN communication in between BTT Manta M8P V2.0 with RPi CM4 embed onto it and a RP2040 based CAN toolboard with the help of CanBoot Bootloader that is to be installed.
Make sure the OS image is of the local Raspbian based settings and configuration, which is similar to the other ranges of Julia Printers.
After the above steps, SSH into the CM4, preferably using 'Bitvise SSH Client'. Open the terminal and update the OS using sudo apt update. After the update, Follow the steps to install USB to CAN communication based klipper firmware in the BTT Manta M8P V2.0. Make sure klipper is installed in the CM4.
cd ~/klipper/make menuconfig
[*] Enable extra low-level configuration options
Micro-controller Architecture (STMicroelectronics STM32) --->
Processor model (STM32H723) --->
Bootloader offset (128KiB bootloader (SKR SE BX v2.0)) --->
Clock Reference (25 MHz crystal) --->
Communication interface (USB to CAN bus bridge (USB on PA11/PA12)) --->
CAN bus interface (CAN bus (on PD0/PD1)) --->
USB ids --->
(1000000) CAN bus speed
() GPIO pins to set at micro-controller startup
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'klipper.bin' file
Now, enter DFU mode by holding BOOT and tapping RESET, and then letting go of BOOT. Send lsusb in the terminal, and then search for a port 0483:df11. If it is present, it means that the board is in DFU mode.
Flash the firmware by entering in the command:
make flash FLASH_DEVICE=0483:df11
In order to get the UUID of the board, enter the command in the terminal:
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Store this UUID safely in order to use in the klipper's configuration.
SSH into the CM4 and enter the following commands:
cd ~git clone https://github.com/Arksine/katapult(previously CanBoot)cd ~/katapultorcd ~/CanBoot(if you have the older 'CanBoot' version)make menuconfig
Here, we initially set the CanBoot Bootloader installation in the RP2040 Toolboard. After make menuconfig, the following are to be set up:
Micro-controller Architecture (Raspberry Pi RP2040) --->
Flash chip (W25Q080 with CLKDIV 2) --->
Build CanBoot deployment application (Do not build) --->
Communication interface (CAN bus) --->
(0) CAN RX gpio number
(1) CAN TX gpio number
(1000000) CAN bus speed
() GPIO pins to set on bootloader entry
[*] Support bootloader entry on rapid double click of reset button
[ ] Enable bootloader entry on button (or gpio) state
[*] Enable Status LED
(gpio2) Status LED GPIO Pin
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'canboot.uf2' file
Now, enter bootloader mode by holding BOOT and tapping RESET, and then letting go of BOOT (OR) Remove the USB cable, hold BOOT and while holding, reconnect the USB cable. Send lsusb in the terminal, and then search for a port 2e8a:0003. If it is present, it means that the board is in bootloader mode.
Flash the CanBoot firmware by entering in the command:
sudo make flash FLASH_DEVICE=2e8a:0003
In order to get the UUID of the board, enter the command in the terminal:
python3 ~/katapult/scripts/flash_can.py -q
or
python3 ~/CanBoot/scripts/flash_can.py -q
(for older 'CanBoot' version)
Note the UUID in order to use it to flash the klipper.uf2 file. Make sure that, it is mentioned as katapult beside the UUID
Now, we make the Klipper FIrmware for the RP2040 Toolboard.
SSH into the CM4 and enter the following commands:
cd ~/klipper/make menuconfig
[*] Enable extra low-level configuration options
Micro-controller Architecture (Raspberry Pi RP2040) --->
Bootloader offset (16KiB bootloader) --->
Communication interface (CAN bus) --->
(0) CAN RX gpio number
(1) CAN TX gpio number
(1000000) CAN bus speed
() GPIO pins to set at micro-controller startup
After setting, hit Q and then hit Y when asked to save changes
Enter make clean, and then enter make. This will compile the 'klipper.bin' file
In order to flash the RP2040 toolboard with Klipper, enter the command:
python3 ~/katapult/scripts/flash_can.py -i can0 -f ~/klipper/out/klipper.bin -u (Put_Your_UUID_Here)
or
python3 ~/CanBoot/scripts/flash_can.py -i can0 -f ~/klipper/out/klipper.bin -u (Put_Your_UUID_Here)
(for older 'CanBoot' version
In the terminal, enter the command:
~/katapult/scripts/flash_can.py -i can0 -q
or
~/CanBoot/scripts/flash_can.py -i can0 -q
(older 'CanBoot' version)
or
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Make sure that, it is mentioned as Klipper beside the UUID.
Note: check the can0 setup by entering:
sudo nano /etc/network/interfaces.d/can0
and enter in:
allow-hotplug can0
iface can0 can static
bitrate 1000000
up ifconfig $IFACE txqueuelen 128
Now, in the printer.cfg file, enter these UUIDs in different [mcu] sections of each motherboard and toolboard. The UUID can be written in the canbus_uuid: line
-
As per the above processes, you get the
canbus UUID'sof every microcontroller including the motherboard. When this UUID is generated, it cannot generate the serial ID simultaneously when required. The/dev/serial/by-id/path becomes invalid since theserial foldergets eliminated when flashing with canbus UUID. In this case we need to set the communication asUSBin the klipper configuration for the Manta boards and flash it in DFU mode. The following steps shows the complete process.
In case if the list of Bus devices show a CAN adapter after sending lsusb like in the above image, then the serial ID won't be generated. A new configuration has to be set for it. Set it as per the USB communication, or as per the respective manuals.
-
cd ~/klipper/make menuconfig
[*] Enable extra low-level configuration options
Micro-controller Architecture (STMicroelectronics STM32) --->
Processor model (STM32G0B1) --->
Bootloader offset (8KiB bootloader) --->
Clock Reference (8 MHz crystal) --->
Communication interface (USB (on PA11/PA12)) --->
USB ids --->
() GPIO pins to set at micro-controller startup
-
After setting, hit
Qand then hitYwhen asked to save changes -
Enter
make clean, and then entermake. This will compile the 'klipper.bin' file -
Now, enter DFU mode by holding
BOOTand tappingRESET, and then letting go ofBOOT. Sendlsusbin the terminal, and then search for a port0483:df11. If it is present, it means that the board is in DFU mode. -
Flash the firmware by entering in the command:
make flash FLASH_DEVICE=0483:df11
- Send in
lsusbin the terminal and check the status of the current type of USB device that are connected. It should look like this:
-
Now send in
ls /dev/serial/by-id/*. This will generate the serial ID after flashing. -
Note down the complete path and the ID. Now enter
make flash FLASH_DEVICE=/dev/serial/by-id/usb-Klipper_stm32g0b1xx_xxxin the terminal where 'xxx' is the unique number that is generated in step 9. -
Now the serial ID is flashed successfully and now the board works on serial communication






