5. Canbus

ID: 152103

Description: Do not connect 24v until told to do so. It's...

Steps:

  1. Create the CAN0 interface file
  2. sudo nano /etc/network/interfaces.d/can0
  3. Enter the following
  4. auto can0 iface can0 can static bitrate 500000 up ifconfig $IFACE txqueuelen 256 pre-up ip link set can0 type can bitrate 500000 pre-up ip link set can0 txqueuelen 256
  5. You can copy paste into the file but make sure your formatting is correct to include the single space in the beginning of the last 4 lines.
  6. Exit and save the file with CTRL + SHIFT X > Yes
  7. Sudo Reboot
  8. Step image
  9. The CAN board needs a bootloader so we can flash the Klipper firmware. We will use CanBoot. Download the CanBoot repository:
  10. git clone https://github.com/Arksine/CanBoot
  11. cd CanBoot
  12. make clean
  13. make menuconfig
  14. Step image Step image
  15. Micro-controller Architecture > (STMicroelectronics STM32)
  16. Processer model > STM32F072
  17. Build CanBoot Deployment Application > (Do not build)
  18. Bootloader offset > (8KiB bootloader)
  19. Clock Reference > (8 MHz)
  20. (500000) CAN bus speed
  21. Communication interface > (CAN bus (on PB8/PB9))
  22. Step image
  23. Micro-controller Architecture > (STMicroelectronics STM32)
  24. Processer model > STM32G0B1
  25. Build CanBoot Deployment Application > (Do not build)
  26. Clock Reference > (8 MHz)
  27. Communication interface > (CAN bus (on PB0/PB1))
  28. Application start offset > (8KiB offset)
  29. (500000) CAN bus speed
  30. Step image
  31. Add the 5v jumper. Connect the USB-C from the Pi to the EBB36 board.
  32. Put the EBB36 into DFU mode
  33. Press and hold the RESET + BOOT button. Release the RESET button while holding the BOOT button, than release the BOOT button.
  34. Get the device ID of the board after it's in DFU mode
  35. Before DFU mode
  36. In DFU mode
  37. Step image Step image
  38. Erase and flash the firmware
  39. sudo dfu-util -a 0 -D ~/CanBoot/out/canboot.bin --dfuse-address 0x08000000:force:mass-erase:leave -d DEVICE:ID
  40. Power off the system. Plug in the 4 wire CAN cable from the UT0C to the EBB36, and power on the the printer and RPI.
  41. After the system is powered up verify the CAN network is up.
  42. cd klipper
  43. python3 lib/canboot/flash_can.py -q
  44. You should see 1 entry for application CanBoot. Note your UUID.
  45. Step image Step image
  46. Run
  47. cd ~/klipper
  48. make menuconfig
  49. Select the following
  50. Enable extra low-level configuration
  51. Micro-controller Architecture > (STMicroelectronics STM32)
  52. Processer model > STM32F072
  53. Bootloader offset > (8KiB bootloader)
  54. Step image
  55. continued:
  56. Clock Reference > (8 MHz)
  57. (500000) CAN bus speed
  58. Save the configuration pressing ESC > Yes
  59. Run
  60. make clean
  61. make
  62. Step image
  63. Micro-controller Architecture > (STMicroelectronics STM32)
  64. Processer model > STM32G0B1
  65. Bootloader offset > (8KiB bootloader)
  66. Clock Reference > (8 MHz)
  67. Communication interface > (CAN bus (on PB0/PB1))
  68. (500000) CAN bus speed
  69. Step image
  70. flash the EBB36 with the newly compiled firmware
  71. python3 ~/CanBoot/scripts/flash_can.py -i can0 -f ~/klipper/out/klipper.bin -u 9fd4db4bdbc0
  72. sudo dfu-util -a 0 -d 0483:df11 --dfuse-address 0x08000000 -D ~/CanBoot/out/canboot.bin
  73. If all goes well your CAN board should now be flashed
  74. run
  75. ~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
  76. Load the provided files to the printer and press FIRMWARE_RESTART
  77. Checking the Machine tab you should see the 4 systems
  78. Step image Step image Step image
Back