Schrittweise Anleitung, um ein BTT Manta Board über die USB/CAN Bridge in Betrieb zu nehmen.
Diese Anleitung ist auf folgende Boards anwendbar:
Das Manta M4P hat keine CAN Port!
Den Original Bootloader - falls man den überhaupt für etwas gebrauchen kann - findet man hier:
dmesg -HW
Product: DFU in FS Mode
biqu@BTT-CB1:~$ dmesg -HW [Feb10 04:48] usb 2-1.4: USB disconnect, device number 3 [ +0.000558] gs_usb 2-1.4:1.0 can0: Couldnt shutdown device (err=-19) [ +0.632135] usb 2-1.4: new full-speed USB device number 4 using ehci-platform [ +0.216530] usb 2-1.4: not running at top speed; connect to a high speed hub [ +0.001484] usb 2-1.4: New USB device found, idVendor=0483, idProduct=df11, bcdDevice= 2.00 [ +0.000019] usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ +0.000006] usb 2-1.4: Product: DFU in FS Mode [ +0.000006] usb 2-1.4: Manufacturer: STMicroelectronics [ +0.000004] usb 2-1.4: SerialNumber: 307734543231
STRG+C
drücken, um die Meldungen zu beendenHinweis:
Katapult wird über USB (DFU-Mode) eingerichtet!
[ ! -d "$HOME/katapult/" ] && cd ~ && git clone https://github.com/Arksine/katapult && cd katapult || cd ~/katapult
make menuconfig
Micro-controller Architecture (STMicroelectronics STM32) ---> Processor model (STM32H723) ---> Build Katapult deployment application (Do not build) ---> Clock Reference (25 MHz crystal) ---> Communication interface (USB (on PA11/PA12)) ---> Application start offset (128KiB offset) ---> USB ids ---> () 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 (!PC3) Status LED GPIO Pin
Micro-controller Architecture (STMicroelectronics STM32) ---> Processor model (STM32G0B1) ---> Build Katapult deployment application (Do not build) ---> Clock Reference (8 MHz crystal) ---> Communication interface (USB (on PA11/PA12)) ---> Application start offset (8KiB offset) ---> USB ids ---> () 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 (!PA13) Status LED GPIO Pin
Micro-controller Architecture (STMicroelectronics STM32) ---> Processor model (STM32G0B1) ---> Build Katapult deployment application (Do not build) ---> Clock Reference (8 MHz crystal) ---> Communication interface (USB (on PA11/PA12)) ---> Application start offset (8KiB offset) ---> USB ids ---> () 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 (!PC14) Status LED GPIO Pin
make -j4
dfu-util -R -a 0 -s 0x08000000:mass-erase:force -D ~/katapult/out/katapult.bin
File downloaded successfully
bei der Ausgabe im Terminaldmesg -HW
starten und wieder Strom auf das Board geben biqu@BTT-CB1:~/katapult$ dmesg -HW [Feb10 05:38] usb 2-1.4: USB disconnect, device number 5 [ +0.344916] usb 2-1.4: new full-speed USB device number 6 using ehci-platform [ +0.230326] usb 2-1.4: New USB device found, idVendor=1d50, idProduct=6177, bcdDevice= 1.00 [ +0.000041] usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ +0.000015] usb 2-1.4: Product: stm32h723xx [ +0.000013] usb 2-1.4: Manufacturer: katapult [ +0.000012] usb 2-1.4: SerialNumber: 1E0043001051313236343430 [ +0.001680] cdc_acm 2-1.4:1.0: ttyACM0: USB ACM device
STRG+C
drücken, um die Meldungen zu beendencd ~/klipper
make menuconfig
[*] Enable extra low-level configuration options Micro-controller Architecture (STMicroelectronics STM32) ---> Processor model (STM32H723) ---> Bootloader offset (128KiB bootloader) ---> 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
[*] 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 to CAN bus bridge (USB on PA11/PA12)) ---> CAN bus interface (CAN bus (on PD12/PD13)) ---> USB ids ---> (1000000) CAN bus speed () GPIO pins to set at micro-controller startup
[*] 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 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
Python´s pyserial module is required to update. Install with the following command: /usr/bin/python3 -m pip install pyserial make: *** [src/stm32/Makefile:111: flash] Error 255
In dem Fall einfach folgendes ausführen
/usr/bin/python3 -m pip install pyserial
make -j4 flash FLASH_DEVICE=/dev/ttyACM0
biqu@BTT-CB1:~/klipper $ make -j4 flash FLASH_DEVICE=/dev/ttyACM0 Creating symbolic link out/board Building out/autoconf.h Compiling out/src/sched.o ... Compiling out/src/stm32/hard_pwm.o Preprocessing out/src/generic/armcm_link.ld Building out/compile_time_request.o Version: v0.12.0-102-g9f41f53c Linking out/klipper.elf Creating hex file out/klipper.bin Flashing out/klipper.bin to /dev/ttyACM0 Entering bootloader on /dev/ttyACM0 Device reconnect on /sys/devices/platform/soc/5200000.usb/usb2/2-1/2-1.4/2-1.4:1.0 /usr/bin/python3 lib/canboot/flash_can.py -d /dev/serial/by-path/platform-5200000.usb-usb-0:1.4:1.0 -f out/klipper.bin Attempting to connect to bootloader CanBoot Connected Protocol Version: 1.0.0 Block Size: 64 bytes Application Start: 0x8020000 MCU type: stm32h723xx Flashing '/home/biqu/klipper/out/klipper.bin'... [##################################################] Write complete: 1 pages Verifying (block count = 477)... [##################################################] Verification Complete: SHA = 381BC7BAE3D7B8717F7169CEDB8EA08E4D59A4CA CAN Flash Success
sudo nano /etc/network/interfaces.d/can0
STRG + x
, dann Y
, dann Enter
beenden allow-hotplug can0 iface can0 can static bitrate 1000000 up ifconfig $IFACE txqueuelen 1024
ip a
can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 1024
DOWN
stehen hilft meist ein sudo systemctl restart networking.service
sudo ip link set can0 up type can bitrate 1000000
Hinweis
Die folgenden Schritte setzen natürlich voraus, das der CAN Bus korrekt im Vorfeld eingerichtet wurde!
Wenn das Board über CAN verbunden ist, dann kann man mit den folgenden Schritten prüfen, ob Katapult geflasht wurde:
sudo systemctl stop klipper.service
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
biqu@BTT-CB1:~/klipper$ ~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0 Found canbus_uuid=fa5ad324b369, Application: Klipper Total 1 uuids found
Ob das Board korrekt mit Klipper läuft, lässt sich mit folgendem Befehl schnell testen:
~/klippy-env/bin/python ~/klipper/klippy/console.py -c can0 fa5ad324b369
Der Pfad am Ende muss natürlich mit dem übereinstimmen, was ihr im vorherigen Schritt ermittelt habt!
Wenn ihr ein connected
am Anfang des Textes seht, ist das Board richtig geflasht.
cd ~/printer_data/config
wget https://raw.githubusercontent.com/bigtreetech/Manta-M8P/master/V1.0_V1.1/Firmware/Klipper/generic-bigtreetech-manta-m8p-V1_0.cfg -O printer.cfg
wget https://raw.githubusercontent.com/bigtreetech/Manta-M8P/master/V1.0_V1.1/Firmware/Klipper/generic-bigtreetech-manta-m8p-v1_0-voron2.cfg -O printer.cfg
wget https://raw.githubusercontent.com/bigtreetech/Manta-M8P/master/V1.0_V1.1/Firmware/Klipper/generic-bigtreetech-manta-m8p-V1_1.cfg -O printer.cfg
wget https://raw.githubusercontent.com/bigtreetech/Manta-M8P/master/V2.0/Firmware/generic-bigtreetech-manta-m8p-V2_0.cfg -O printer.cfg
wget https://raw.githubusercontent.com/bigtreetech/Manta-M5P/master/Firmware/Klipper/generic-bigtreetech-manta-m5p.cfg -O printer.cfg
nano ~/printer_data/config/printer.cfg
[mcu] canbus_uuid: fa5ad324b369
[mcu]
die Zeile mit serial
löschen oder auskommentieren[mcu]
die Zeile canbus_uuid
entsprechend mit der ermittelten UUID von oben einfügensudo systemctl start klipper.service
Hinweis:
Das Klipper Update wird über USB eingespielt! Über den CAN-Bus ist ein Update nicht möglich wenn das Board als USB/Can Bridge arbeitet.
sudo systemctl stop klipper.service
grep canbus_uuid ~/printer_data/config/* -n
biqu@BTT-CB1:~$ grep canbus_uuid ~/printer_data/config/* -n /home/biqu/printer_data/config/BTT_EBB.cfg:10:canbus_uuid: 44d860c9632b /home/biqu/printer_data/config/printer.cfg:162:canbus_uuid: fa5ad324b369
~/klippy-env/bin/python ~/katapult/scripts/flashtool.py -i can0 -u <MANTA UUID> -r
biqu@BTT-CB1:~$ ~/klippy-env/bin/python ~/katapult/scripts/flashtool.py -i can0 -u fa5ad324b369 -r Sending bootloader jump command... Bootloader request command sent Flash Success
dmesg |tail -n 10
biqu@BTT-CB1:~$ dmesg |tail -n 10 [ 296.579125] gs_usb 2-1.4:1.0 can0: Couldn`t shutdown device (err=-19) [ 296.959524] usb 2-1.4: new full-speed USB device number 5 using ehci-platform [ 297.190002] usb 2-1.4: New USB device found, idVendor=1d50, idProduct=6177, bcdDevice= 1.00 [ 297.190028] usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 297.190034] usb 2-1.4: Product: stm32h723xx [ 297.190040] usb 2-1.4: Manufacturer: katapult [ 297.190045] usb 2-1.4: SerialNumber: 1E0043001051313236343430 [ 297.208551] cdc_acm 2-1.4:1.0: ttyACM0: USB ACM device [ 297.208666] usbcore: registered new interface driver cdc_acm [ 297.208673] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
Wie immer brauchen wir die tty… Angabe. In diesem Fall ist is ttyACM0 wie man in der drittletzten Zeile sehen kann.
cd ~/klipper
make -j4 flash FLASH_DEVICE=/dev/ttyACM0
sudo systemctl start klipper.service
Diese Punkte sind nicht immer Bestandteil vom YouTube Video, aber nützlich
Der interne Temperatur Sensor des STM32 kann mit folgendem Konfig Schnipsel ausgelesen werden:
[temperature_sensor Manta] sensor_type : temperature_mcu sensor_mcu : mcu
Alle Manta Boards haben einen 8-poligen SPI Anschluss an dem z.B. ein ADXL345 Sensor für Input Shaper betrieben werden kann. Der 8 polige Anschluss ist bei allen Boards gleich beschaltet, lediglich die Konfiguration unterscheidet sich in Klipper etwas.
ADXL345 Pin | Manta M8P V2.0 | Manta M8P V1.x | Manta M5P | Manta M4P | Pin Nr Stecker |
---|---|---|---|---|---|
GND | GND | GND | GND | GND Zeichen | 2, 8 |
VCC | 3.3 V | 3.3 V | 3.3 V | STM_3V3 | 7 |
CS | 345SPI-CS (PA15) | SPI2-CS (PC4) | SPI2-CS (PC9) | SPI_CS (PD9) | 3 |
INT1 | - | - | - | - | - |
INT2 | - | - | - | - | - |
SDO | 345SPI-MISO | MOT-MISO | LCDSD-MISO | SD-TF MISO | 6 |
SDA | 345SPI-MOSI | MOT-MOSI | LCDSD-MOSI | SD-TF MOSI | 5 |
SCL | 345SPI-SCK | MOT-SCK | LCDSD-SCK | SD-TF SCK | 4 |
[adxl345] axes_map : x,y,z cs_pin : <siehe Liste> spi_bus : <siehe Liste> [resonance_tester] accel_chip : adxl345 probe_points : 150, 150, 20 # Center of your bed, raised up a little
cs_pin : PA15 spi_bus : spi3a
cs_pin : PC4 spi_bus : spi2
cs_pin : PC9 spi_bus : spi2
cs_pin : PD9 spi_bus : spi1
ACCELEROMETER_QUERY
accelerometer values (x, y, z): -1110.308913, 1184.329507, 11414.822920
Invalid adxl345 id (got 0 vs e5)