Lost CAN uuid after reboot Manta M8P V2

I have a Manta M8P with a CB1 Emmc board. I installed Klipper and everything was fine, I configured it to USB to CAN bus bridge (USB on PA11/PA12) and CAN bus interface (CAN bus (on PD0/PD1))
After flashing Klipper I run:
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
and it gives me a CAN bus uuid. I enter it in my printer.cfg
[mcu]
canbus_uuid: b264b1ec7c2f
and restart.
I get an error mcu ‘mcu’: Unable to connect.
I remove the uuid from my printer.cfg and restart. Then in Putty I run the:
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
and I get this error:

Traceback (most recent call last):
File “/home/biqu/klipper/scripts/canbus_query.py”, line 64, in
main()
File “/home/biqu/klipper/scripts/canbus_query.py”, line 61, in main
query_unassigned(canbus_iface)
File “/home/biqu/klipper/scripts/canbus_query.py”, line 20, in query_unassigned
bus = can.interface.Bus(channel=canbus_iface, can_filters=filters,
File “/home/biqu/klippy-env/lib/python3.9/site-packages/can/interface.py”, line 127, in new
return cls(channel, *args, **kwargs)
File “/home/biqu/klippy-env/lib/python3.9/site-packages/can/interfaces/socketcan/socketcan.py”, line 594, in init
bind_socket(self.socket, channel)
File “/home/biqu/klippy-env/lib/python3.9/site-packages/can/interfaces/socketcan/socketcan.py”, line 459, in bind_socket
sock.bind((channel,))
OSError: [Errno 19] No such device

If I flash Klipper again I get the uuid, but after restart it’s gone.

I have re-flashed the CB1 and erased everything and started over, spend countless of hours to get this to work.

Could this be a bad Manta board?
Thanks for any help.

First off, always attach your klippy.log.

Regardless, things are a bit confused in terms of what is your history. Was this set up working previous?

You indicated that the Can bus you set is PD0/PD1 - but it should be PD12/PD13 as I use:

Are you connecting your Manta M8P to a toolhead or other CAN controller? If not, you probably shouldn’t use it.

This is a new board that I was going to use on my Raptor 2.
When I first got it, I tried to get a serial port, but I always got “No such device”.
Then I change it to CAN and I got the CAN uuid.
This is a Manta M8P V2.0 and here is BIQU generic printer.cfg:

This file contains common pin mappings for the BIGTREETECH Manta M8P V2.0
To use this config, the firmware should be compiled for the
STM32H723 with a “128KiB bootloader” “25 MHz crystal”
and “USB (on PA11/PA12)”, “CAN bus (on PD0/PD1)” or Serial (on USART1 PA10/PA9).

I original did have a SB2900 and it was all working with CAN. I by accident shorted the SB2900 and I removed it and the board was working fine with Klipper.
After I got the EBB36 and added it, I start having the problems first time I restarted after have the two uuid’s.

I did setup a EBB36 with CAN and it shows in Mainsails, but the mcu doesn’t show. I removed it now so I could re-flash everything and get the Manta working with Klipper.

klippy.log (367.4 KB)

Sorry, regarding the Manta M8P V2.0 you say “This is a new board” - was there one previous to this?

Also, with the SB2900 that had the short - are you using the same Manta M8P?

Final question; what is your host system?

Could you go through the process you are doing for setting up your system? I want to know if you are using DFU and what kind of responses are you getting on SSH.

I know it’s frustrating but usually there’s something simple that is the problem, we just have to work through the process and make sure we understand exactly what’s happening.

Thanx for attaching the klippy.log.

This is the first BIQU board I have. I have a Vivedino Raptor 2 that I’m rebuilding. New H12 rail, new extruder and expanded the size from 400 x 400 x 700 to 800 x 400 x 700 since I have a lot of request for old cars dashboard.

The plan is to replace the Raptor 2 board with the Manta M8P V2 and run Klipper with a CB1 Emmc on it.

Yes this is the same Manta I used when the SB2900 was fried, I was putting jumpers on to set it to 24V fans and I didn’t noticed that the last pins was for the Proximity. So I turned it on and everything was working perfectly with CAN, I still had it on my work table and I was moving the SB2900 and found it very hot, then I turned everything off and checked it, that was when I found the jumper on the pins for the Proximity. I removed the jumper and turn everything back on it was still working, but the SB2900 was still getting to hot, I then removed it and since I had bought a BIQU Extruder I bought the EBB36. The board was still working running Klipper with no problems after I removed the SB2900.

I download the CB1_Debian11_Klipper_kernel5.16_202300712.img.xz and used Raspberry PI Imager for the CB1 Emmc. Using a USB cable and two switch RPI-BOOT and USB-OTG turned on. After I turned off the two switch.

Then I used Putty to create the Klipper file for the M8P and put the board in DFU mode. Used make “flash FLASH_DEVICE=0483:df11” to write it to the M8P then I did a “~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0” and it shows one uuid found.

I restart the board and the uuid is gone.

Here is the Putty screen, as you can see I get a uuid.

biqu@BTT-CB1:~/klipper$ make flash FLASH_DEVICE=0483:df11
Flashing out/klipper.bin to 0483:df11
sudo dfu-util -d ,0483:df11 -R -a 0 -s 0x8020000:leave -D out/klipper.bin

dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util / Tickets

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device…
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface…
Setting Alternate Setting #0
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 1024
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08020000, size = 31464
Download [=========================] 100% 31464 bytes
Download done.
File downloaded successfully
dfu-util: Error during download get_status

Failed to flash to 0483:df11: Error running dfu-util

If the device is already in bootloader mode it can be flashed with the
following command:
make flash FLASH_DEVICE=0483:df11
OR
make flash FLASH_DEVICE=1209:beba

If attempting to flash via 3.3V serial, then use:
make serialflash FLASH_DEVICE=0483:df11

make: *** [src/stm32/Makefile:111: flash] Error 255
biqu@BTT-CB1:~/klipper$ ~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Found canbus_uuid=b264b1ec7c2f, Application: Klipper
Total 1 uuids found
biqu@BTT-CB1:~/klipper$

Here is the klipper log after I Flash and click Klipper restart, I see the MCU in Mainsail, but Klipper never connect.
klippy.log (484.8 KB)

I just Flashed it again and I got Klipper running, I can control the fans, the extruder, but as soon I shut it down and turn it on again I get mcu unable to connect. Some how it is not holding the information.

Okay, I need to confirm something.

Your first reply ends with:

Then in your second reply you start with:

Which dfu-util command did you use?

In the first reply, you state it’s:

flash FLASH_DEVICE=0483:df11

and in the second, you are using:

sudo dfu-util -d ,0483:df11 -R -a 0 -s 0x8020000:leave -D out/klipper.bin

Now, if it’s the second, you are flashing to the wrong address. The address you are listing is very much above the end of the bootloader and probably outside the Flash address range.

It should be 0x8002000.

In your last post, you state:

I believe that is because you are not telling dfu-util to leave which means finalize the Flashing operation and reset the MCU.

Could you try the following dfu-util command:

sudo dfu-util -a 0 -D ~/Katapult/out/katapult.bin --dfuse-address 0x8002000:force:leave -d 0483:df11

This will place the Klipper firmware after the bootloader and reset the MCU.

Let me know how this works.

I only type this: FLASH_DEVICE=0483:df11
Anything after is comming up after i hit enter.

Should I enter DFU mode before I run the dfu- util command?

Entering “DFU mode” just means pressing the “BOOT” button on the Manta while pressing “RESET”.

You can check that you are in it by using the lsusb command from SSH. You should see 0483:DF11 as one of the presented USB connections.

I would suggest that you use the

sudo dfu-util -a 0 -D ~/Katapult/out/katapult.bin --dfuse-address 0x8002000:force:leave -d 0483:df11

command rather than FLASH_DEVICE=0483:df11 if it produces the wrong address in the MCU.

Since it is the Manta M8P I’m flashing I changed the katapult to klipper and it flashed fine and after restarting klipper everything works. I did a shutdown in Mainsail and power off the Manta board.
When I power back on the uuid is gone as you can see on the putty.

biqu@BTT-CB1:~$ ~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Traceback (most recent call last):
File “/home/biqu/klipper/scripts/canbus_query.py”, line 64, in
main()
File “/home/biqu/klipper/scripts/canbus_query.py”, line 61, in main
query_unassigned(canbus_iface)
File “/home/biqu/klipper/scripts/canbus_query.py”, line 20, in query_unassigned
bus = can.interface.Bus(channel=canbus_iface, can_filters=filters,
File “/home/biqu/klippy-env/lib/python3.9/site-packages/can/interface.py”, line 127, in new
return cls(channel, *args, **kwargs)
File “/home/biqu/klippy-env/lib/python3.9/site-packages/can/interfaces/socketcan/socketcan.py”, line 594, in init
bind_socket(self.socket, channel)
File “/home/biqu/klippy-env/lib/python3.9/site-packages/can/interfaces/socketcan/socketcan.py”, line 459, in bind_socket
sock.bind((channel,))
OSError: [Errno 19] No such device
biqu@BTT-CB1:~$

1 Like

Now, you didn’t say you were using Katapult before. Also, you haven’t listed the commands you used before generating the canbus_query so I can’t comment.

If we’re going to get you working, I need you to be clear on everything you are doing and document each step as accurately as possible. Otherwise, I’m going to be asking you to provide me with that information until I am confident of what is being done.

Now, my approach to installing Katapult and then Klipper on a Manta M8P V1.1 is as follows:

  1. Boot the Manta M8P in DFU mode (Press BOOT followed by RESET)
  2. Check to see that the Manta M8P is in DFU mode by issuing the lsusb command in SSH - you should get back an ID with: 0483:df11
  3. In SSH, go into the Katapult folder, execute make menuconfig and set your parameters for the Manta M8P. When you respond, please post what you’re putting in here. I just set the board type and leave the communications default as USB PA11/PA12
  4. In SSH, execute make clean followed by make
  5. Next Flash the MCU with the following command (which will erase the programmed in bootloader, but that should be okay because you are using DFU):
sudo dfu-util -a 0 -D ~/Katapult/out/katapult.bin --dfuse-address 0x08000000:force:mass-erase:leave -d 0483:df11
  1. In SSH, do another lsusb command and you should see a device named OpenMoko
  2. In the klipper folder , execute make menuconfig and set your parameters for the Manta M8P V2. When you respond, please post what you’re putting in here. I just set the board type and leave the communications default as CAN over USB as discussed above
  3. In SSH, execute make clean followed by make. This should take considerably longer than the Katapult make
  4. In SSH, execute ls /dev/serial/by-id/ and record the UUID value returned. This should be the b264b1ec7c2f value you quoted above
  5. In SSH, execute python3 ~/Katapult/scripts/flash_can.py -d /dev/serial/by-id/<UUID> where <UUID> is the UUID produced in the previous step. This will flash Klipper into the MCU
  6. In SSH, execute sudo nano /etc/network/interfaces.d/can0 and make sure the file contains:
"allow-hotplug 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 "

This sets the CAN datarate to 500kbps which should be good for a start.
12. In SSH reboot the system using sudo reboot
13. Rebot the Manta M8P but do not put it in DFU mode (leave the BOOT button alone)
14. Login to the host with SSH
15. In SSH execute ~/Katapult/scripts/flash_can.py -i can0 -q and you should see your UUID.

Could you work through these steps and let me know how they work?

As I said, this is literally my process for the Manta M8P V1.1 so I’m fairly confident that it will work for you.

After this, we’ll see about your toolhead controller.

The only thing I used Katapult for was the EBB36.

I will try the steps and let you know.

biqu@BTT-CB1:~$ cd katapult
biqu@BTT-CB1:~/katapult$ lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 004: ID 0483:df11 STMicroelectronics STM Device in DFU Mode
Bus 001 Device 003: ID 8440:2004 wch.cn USB2IIC_CTP_CONTROL
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
image

I had to change into the katapult out folder and change the:
sudo dfu-util -a 0 -D ~/Katapult/out/katapult.bin --dfuse-address 0x08000000:force:mass-erase:leave -d 0483:df11
to
sudo dfu-util -a 0 -D katapult.bin --dfuse-address 0x08000000:force:mass-erase:leave -d 0483:df11
I was getting: dfu-util: Could not open file /home/biqu/Katapult/out/katapult.bin for reading: No such file or directory

Here is the result from flashing:

This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util / Tickets

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device…
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface…
Setting Alternate Setting #0
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 1024
DfuSe interface name: "Internal Flash "
Performing mass erase, this can take a moment
Downloading to address = 0x08000000, size = 5668
Download [=========================] 100% 5668 bytes
Download done.
File downloaded successfully
dfu-util: Error during download get_status
biqu@BTT-CB1:~/katapult/out$ lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 1d50:6177 OpenMoko, Inc. stm32h723xx
Bus 001 Device 003: ID 8440:2004 wch.cn USB2IIC_CTP_CONTROL
Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

image

biqu@BTT-CB1:~/klipper$ ls /dev/serial/by-id/
usb-katapult_stm32h723xx_370025001951313434373135-if00

This is what I get no uuid

Just to let you know I do not have the EBB36 connected.

I just Flashed it again and I got a uuid. Then I turned of the board and back on again and it kept the settings. I did it one more time just to be sure and klipper started right up.

Thanks, now I can sleep at night.

Just one question that I can’t find answer to on the internet. On the Manta V2.0 they marked the CAN pin with TX and RX instead of H and L on everything. Do you know if TX = H or L?
I know I have to connect H to H and L to L on the Manta and EBB36.

Thanks again.

I found that RX=H and TX=L

I hook up my EBB36 and did expected it to work, but it says it can’t connect.

I see two uuid’s
b264b1ec7c2f Klipper
b0020cac4219 CanBoot

Here is the klipper.log

klippy.log (271.6 KB)

That’s good news that you’re connected to the Manta M8P.

Where did you get the information that “RX-H” and “TX=L”? I just went searching and couldn’t find it. There doesn’t seem to be a published schematic for the board.

Thank you for posting the klippy.log and it doesn’t look like it can connect.

What is the process you used for connecting the EBB?

Here is mine - note that $username should be “biqu” for your system.

  1. Connect the EBB to your host using a USB cable
  2. Put the EBB into DFU mode by pressing the BOOT button and then the RESET button.
  3. In SSH, confirm that the EBB is in DFU mode and can be accessed by the host by executing the lsusb command. You should get back an ID with: 0483:df11
  4. In SSH, go into the Katapult folder, execute make menuconfig and set your parameters for the EBB. I presume that you are using an EBB36 V1.1 so set the MCU to STM32G0B1, Crystal speed to 8Mhz, communication interface is CAN bus (on PB0/PB1) and a 500000 CAN bus speed
  5. In SSH, execute make clean followed by make
  6. Next Flash the MCU with the following command (which will erase the programmed in bootloader, but that should be okay because you are using DFU):
sudo dfu-util -a 0 -D ~/Katapult/out/katapult.bin --dfuse-address 0x08000000:force:mass-erase:leave -d 0483:df11
  1. In the klipper folder, execute make menuconfig and put in the same parameters as step 4. (STM32G0B1 running at 8MHz and using a CAN bus on PB0/PB1 with a speed of 500000 CAN bus speed)
  2. In SSH, execute make clean followed by make
  3. In SSH execute sudo shutdown -P +0 (immediate shutdown, you don’t have to wait a minute like the one you used for the Manta M8P).
  4. Power down the printer
  5. Disconnect the USB cable from the EBB36 to the host
  6. Connect the CAN cable between the EBB38 and Manta M8P
  7. Power up the printer and the host (if it’s separate - I believe you’re using a CB1 that’s plugged into the Manta M8P so there’s no host to power up)
  8. SSH into the host and get the Katapult device UUID (which you will record) with the command:
/home/$userName/Katapult/scripts/flash_can.py -i can0 -q
  1. Program the EBB36 with klipper using the command (where is the value recorded from the previous step):
sudo python3 /home/$userName/Katapult/scripts/flashtool.py -u <UUID> -f /home/$userName/klipper/out/klipper.bin
  1. Add the UUID that you set up to your printer.cfg
  2. Restart Klipper and start printing

With what you’ve written here, I suspect the issue is that you didn’t properly set up Katapult or Klipper for the EBB36.

I’m a bit concerned about the CAN RX/TX vs H/L connection - if things don’t work out the first time, try swapping the RX/TX pins on the Manta M8P (which should be the easier end to do). Remember to power down before doing this (and use the shutdown command either from SSH or the Mainsail web page).

Let me know how you make out.

Thanks, I will try tomorrow.
The way I found out about TX and RX, I looked at some Video where I could see which color cable was connected to the board and to the EBB36, I then connected it that way as above and I got a CanBoot uuid. When It couldn’t connect I swapped the cables around, but then I no longer had a CanBoot uuid.
So I assumed the one where I got the CanBoot uuid must be the right connection.
Here is the pin layout for Manta M8P V2.0
https://github.com/bigtreetech/Manta-M8P/blob/master/V2.0/Hardware/BIGTREETECH%20MANTA%20M8P%20V2.0%20PinOut.png

1 Like