Octopus Pro Canboot & CAN Bus Bridge

Hi All

After fighting for a long time to get CANBoot on to my Octopus Pro I was able to do so using these instructions as a bases. https://github.com/maz0r/klipper_canbus/blob/main/controller/monster8v2.md

The result is this

pi@Voron2:~/klipper $ ls /dev/serial/by-id/*
/dev/serial/by-id/usb-CanBoot_stm32f446xx_4A002E000250534E4E313120-if00

Now if I download klipper firmware with the following settings.

[*] Enable extra low-level configuration options
    Micro-controller Architecture (STMicroelectronics STM32)  --->
    Processor model (STM32F446)  --->
    Bootloader offset (32KiB bootloader)  --->
    Clock Reference (12 MHz crystal)  --->
    Communication interface (USB to CAN bus bridge (USB on PA11/PA12))  --->
    CAN bus interface (CAN bus (on PD0/PD1))  --->
    USB ids  --->
(500000) CAN bus speed
()  GPIO pins to set at micro-controller startup
python3 ~/plugins/CanBoot/scripts/flash_can.py -d /dev/serial/by-id/usb-CanBoot_stm32f446xx_4A002E000250534E4E313120-if00
Attempting to connect to bootloader
CanBoot Connected
Protocol Version: 1.0.0
Block Size: 64 bytes
Application Start: 0x8008000
MCU type: stm32f446xx
Flashing '/home/pi/klipper/out/klipper.bin'...
[##################################################]
Write complete: 2 pages
Verifying (block count = 413)...
[##################################################]
Verification Complete: SHA = 8BD03B80BBC27AD4AD5F9458B830AA19E4C35B0E
CAN Flash Success

After power cycling the printer, The serial device does not exist and no CAN bus interface.
Instead I get these error messages.

[  618.190762] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
[  724.685119] usb 1-1.2: USB disconnect, device number 14
[  724.978657] usb 1-1.2: new full-speed USB device number 15 using xhci_hcd
[  725.115808] usb 1-1.2: unable to read config index 0 descriptor/all
[  725.115821] usb 1-1.2: can't read configurations, error -32
[  725.208661] usb 1-1.2: new full-speed USB device number 16 using xhci_hcd
[  725.308873] usb 1-1.2: device descriptor read/64, error -32
[  725.528966] usb 1-1.2: device descriptor read/64, error -32
[  725.649338] usb 1-1-port2: attempt power cycle
[  726.308715] usb 1-1.2: new full-speed USB device number 17 using xhci_hcd
[  726.308936] usb 1-1.2: Device not responding to setup address.
[  726.528938] usb 1-1.2: Device not responding to setup address.
[  726.748729] usb 1-1.2: device not accepting address 17, error -71
[  726.848724] usb 1-1.2: new full-speed USB device number 18 using xhci_hcd
[  726.887001] usb 1-1.2: unable to read config index 0 descriptor/all
[  726.887025] usb 1-1.2: can't read configurations, error -32
[  726.887687] usb 1-1-port2: unable to enumerate USB device

Iā€™m able to flash back a standard Klipper with out CAN bus and its all working again.

Added a Fly-utoc and you get a log which indicates what it should look like.

[  448.927183] cdc_acm 1-1.2:1.0: ttyACM1: USB ACM device
[ 3511.922845] perf: interrupt took too long (2507 > 2500), lowering kernel.perf_event_max_sample_rate to 79700
[ 4325.211023] usb 1-1.3: new full-speed USB device number 11 using xhci_hcd
[ 4325.358205] usb 1-1.3: New USB device found, idVendor=1d50, idProduct=606f, bcdDevice= 0.00
[ 4325.358237] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4325.358258] usb 1-1.3: Product: FLY-UTOC USB to CAN adapter
[ 4325.358277] usb 1-1.3: Manufacturer: Mellow.
[ 4325.358294] usb 1-1.3: SerialNumber: 004600235842571420323035
[ 4325.434542] CAN device driver interface
[ 4325.439703] gs_usb 1-1.3:1.0: Configuring for 1 interfaces
[ 4325.441170] usbcore: registered new interface driver gs_usb

Any ideas?

Mike

So I was pointed at a discussion on Discord which indicates that CanBoot does not work on a Octopus with USB CAN Bridge enabled.

I was given the steps needed to switch back to BTT standard bootloader for an Octopus Pro, but Iā€™m not sure if Iā€™ll just wait until this issue is fixed.

Below is for my board but the bootloaders for other boards is at

Downloads the firmware file in Intel HEX format

wget https://raw.githubusercontent.com/bigtreetech/BIGTREETECH-OCTOPUS-V1.0/master/Firmware/DFU%20Update%20bootloader/bootloader/OctoPus-F446-bootloader-32KB.hex

Converts the hex firmware to a bin

objcopy --input-target=ihex --output-target=binary OctoPus-F446-bootloader-32KB.hex bootloader.bin

Optional: Backup the old bootloader

sudo dfu-util -d ,0483:df11 -R -a 0 -s 0x8000000:32768 -U old-bootloader.bin

Install the new bootloader

sudo dfu-util -d ,0483:df11 -R -a 0 -s 0x8000000:leave -D bootloader.bin

1 Like

Iā€™ve seen this report as well, and it is surprising. I think it would help if we could get additional details on the failure.

Can you reflash CanBoot to the board and provide a screenshot from ā€œmake menuconfigā€ of CanBoot. Can you check flashing, via CanBoot, a Klipper image using regular USB for communication - does it fail in the same way? Can you enter CanBoot via double click of the reset button? If you reflash Klipper with ā€œUSB to CANbus bridgeā€, via CanBoot, does it still fail? Can you enter CanBoot via double click of the reset button?

-Kevin

Here is the config I just downloaded to the flash.


As indicated I can flash a normal non CAN Klipper firmware with out issues.
I just did it again and it works correctly

Using an image with the following settings and git commit ā€˜a709ba43af8edaaa307775ed73cb49fac2b5e550ā€™

I get the following in the dmesg logs

[75506.753340] usb 1-1.2: USB disconnect, device number 10
[75507.580618] usb 1-1.2: new full-speed USB device number 12 using xhci_hcd
[75507.722812] usb 1-1.2: New USB device found, idVendor=1d50, idProduct=6177, bcdDevice= 1.00
[75507.722843] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[75507.722864] usb 1-1.2: Product: stm32f446xx
[75507.722882] usb 1-1.2: Manufacturer: CanBoot
[75507.722899] usb 1-1.2: SerialNumber: 4A002E000250534E4E313120
[75507.732804] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
[75595.816055] usb 1-1.2: USB disconnect, device number 12
[75596.112860] usb 1-1.2: new full-speed USB device number 13 using xhci_hcd
[75596.250029] usb 1-1.2: unable to read config index 0 descriptor/all
[75596.250043] usb 1-1.2: can't read configurations, error -32
[75596.342867] usb 1-1.2: new full-speed USB device number 14 using xhci_hcd
[75596.443087] usb 1-1.2: device descriptor read/64, error -32
[75596.663161] usb 1-1.2: device descriptor read/64, error -32
[75596.783594] usb 1-1-port2: attempt power cycle
[75597.442932] usb 1-1.2: new full-speed USB device number 15 using xhci_hcd
[75597.443124] usb 1-1.2: Device not responding to setup address.
[75597.663169] usb 1-1.2: Device not responding to setup address.
[75597.882944] usb 1-1.2: device not accepting address 15, error -71
[75597.982950] usb 1-1.2: new full-speed USB device number 16 using xhci_hcd
[75598.021219] usb 1-1.2: unable to read config index 0 descriptor/all
[75598.021243] usb 1-1.2: can't read configurations, error -32
[75598.021910] usb 1-1-port2: unable to enumerate USB device

Pressing the reset button gets the can serial port back

[75660.874542] usb 1-1.2: new full-speed USB device number 17 using xhci_hcd
[75661.016522] usb 1-1.2: New USB device found, idVendor=1d50, idProduct=6177, bcdDevice= 1.00
[75661.016554] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[75661.016575] usb 1-1.2: Product: stm32f446xx
[75661.016593] usb 1-1.2: Manufacturer: CanBoot
[75661.016610] usb 1-1.2: SerialNumber: 4A002E000250534E4E313120
[75661.024581] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device

Writing the standard usb serial Klipper firmware gets the following

[75661.024581] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
[75756.534895] usb 1-1.2: USB disconnect, device number 17
[75756.836946] usb 1-1.2: new full-speed USB device number 18 using xhci_hcd
[75756.979236] usb 1-1.2: New USB device found, idVendor=1d50, idProduct=614e, bcdDevice= 1.00
[75756.979268] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[75756.979289] usb 1-1.2: Product: stm32f446xx
[75756.979307] usb 1-1.2: Manufacturer: Klipper
[75756.979324] usb 1-1.2: SerialNumber: 4A002E000250534E4E313120
[75756.996498] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device

Hope this helps

It looks like I can reproduce this issue on my stm32f446 development board. I wont be able to look at it in detail for a week or so, but hopefully will be able to track it down.

-Kevin

Thanks Kevin

Happy to test when you have something.

Cheers

Ugh - there was a silly error in the Klipper build rules that caused this problem. (Alas, it took hours and hours for me to track this down.) Should be fixed now (commit 6aec6efc).

-Kevin

Confirmed, I was able to flash the usb 2 can bridging version of Klipper to the Octopus Pro board and configure the CANBUS in printer.cfg

Hi Mjoconr,

I am trying to do the same, but with a Octopus Pro 429. I am quite a noob when it comes to all this, but did I understand well that the bootloader in the Octopus Pro needs to be changed to use it as a CAN bridge?
My Octopus board is still as it came out of the box, besides then that I flashed the klippper FW on it.

I just received my EBB42 today, but I canā€™t find a ā€œnoobā€ guide to get this done. BTT didnā€™t reply yet to my questions :slight_smile:

You do not need to change the boot loader. In my case not installing CANBoot would have reduced my problems.
Above are the klipper settings for my octopus board.

Two things: 1) You only need CanBoot on octopus board if you are (re)flashing Klipper frequently and cannot access boot pins easliy (I also wonder if it can be reflashed without jumping these pins after 1st Klipper flash like Diet WiFi). I personally didnā€™t bother as I can access these pins easily. 2) There is a noob guide on Octopus FB page (I hope it is OK to mention it here).

Thanks for the advice guys! Thatā€™s already a worry less.

On the Octopus Pro, is the RJ11 plug the only place where the pins PD0 & PD1 are available? Or is there like another JST plug or so where they are available? I couldnā€™t find it on the pinout from BTT.

If the RJ11 is the only place where the pins go, can I use this type of cable? itā€™s a old phone cord, twisted pair but not shielded. Itā€™s all I got for the moment with a RJ11 connector.

There are no extra connectors, which is a pain because getting power is also something which is needed.
Twisted pair cable will do the job as thats all CANBUS needs, not sure the telephone cable can handle the flexing.
You need to make sure the wires in the RJ plug are connected to the correct pins.
Mike

1 Like

Exactly. Twisted pair is good for CAN but these 2 pins need to match the board connector. The guide I mentioned describes this in details. For me simple RJ12 phone cable cut in half (to get it to the main cable that carries 24 and can to the printhead through the chain) did the job.

1 Like

Thanks again guys!

@AlexOr , for that guide you mention, I am not a facebook user, and I tried to search for it on google but with no succes, do you think you could download it for me or get some screenshots of it?

I think I quite understood how it should work now, but every piece of info is always welcomeā€¦

Iā€™m the one that made the guide and posted on Facebook. I donā€™t see a way to upload it here. Maybe message me and I can send it to you in email? 25 page PDF with wiring guide at bottom. For all Octopus boards and EBB toolhead boards.

3 Likes

Hi @tlmaclennan , Thatā€™s really awesome, I have sent you a PM with my mail address!

Please, show FB link. :slight_smile:

I think it would be great if you could share your documentation via github.

1 Like

Definitely need to work on that!