Table of Contents
BTT Manta (CAN-Bridge)
Schrittweise Anleitung, um ein BTT Manta Board über die USB/CAN Bridge in Betrieb zu nehmen.
Diese Anleitung ist auf folgende Boards anwendbar:
- Manta M8P V2.0
- Manta M8P V1.x
- Manta M5P
Das Manta M4P hat keine CAN Port!
YouTube Video #89
Hinweise
- SBC bedeutet in der Anleitung Single Board Computer. Also meistens wohl ein Raspberry Pi.
- Es wird davon ausgegangen das auf dem SBC Klipper und MainSail eingerichtet ist.
- Ein Zugang zum SBC über SSH ist notwendig!
- In dieser Anleitung wird das BTT CB1 Modul verwendet. Inbetriebnahme siehe hier: BTT CB1
- Die Manta Boards lassen sich ebenfalls mit einem Raspberry Pi CM (Compute Module) betreiben. Damit funktionieren auch die CSI und DSI Ports!
Stromversorgung
- Im Betrieb wird das Board mit 12V oder 24V versorgt (Anschluss POWER + -)
- Das Board kann zum initialen Flashen alleine über den USB-C Port versorgt werden. Für diesen Fall muss der VUSB Jumper gesetzt werden!
- Das Board lässt sich auch mit der normalen Stromversorgung über POWER flashen.
- Für die Treiber gibt es einen extra Stromanschluss (HV, oder POWER MOTOR)
Verkabelung
- Stromversorgung über 24V / GND
- CAN Anschluss über die JST CAN Buchse
- Das Manta M8P V2.0 hat nur einen CAN Anschluss direkt am µController
https://github.com/bigtreetech/Manta-M8P/blob/master/V2.0/Hardware/BIGTREETECH%20MANTA%20M8P%20V2.0%20PinOut.png - Das Manta M8P V1.x hat 2 gleichwertige CAN Anschlüsse direkt am µController
https://github.com/bigtreetech/Manta-M8P/blob/master/V1.0_V1.1/Hardware/BIGTREETECH%20MANTA%20M8P%20V1.1%20PinOut.png - Das Manta M5P hat 2 gleichwertige CAN Anschlüsse unterhalb der 40er Pinleiste
https://github.com/bigtreetech/Manta-M5P/blob/master/Hardware/BIGTREETECH%20MANTA%20M5P%20V1.0-Pin.png
CAN Bus Terminierung
- Wenn das Board der erste oder letzte Busteilnehmer ist, dann muss der 120Ω Jumper gesetzt werden.
- Wer den CAN Bus überprüfen will, kann im ausgeschalteten Zustand den Buswiderstand mit einem Ohmmeter messen. Es müsste zwischen CAN H und CAN L ca. 60Ω ergeben. Vorausgesetzt es ist ein zweiter Busteilnehmer verkabelt und passend terminiert.
Bootloader sichern
Den Original Bootloader - falls man den überhaupt für etwas gebrauchen kann - findet man hier:
- Manta M5P
nicht verfügbar
Vorgehen Flashen
- Wer sein Board das erste mal mit Klipper einrichtet muss die folgenden Schritte durchgehen:
- Wer das Board schon nach dieser Anleitung eingerichtet hat kann das Klipper Update so durchführen …
DFU Modus
- Das Board in den DFU Modus bringen
- Im Terminal auf Meldungen warten
dmesg -HW
- Jetzt die Boot0 Taste gedrückt halten, kurz die Reset Taste drücken und dann auch die Boot0 Taste wieder loslassen.
- Hinweis: Die Tasten befinden sich jeweils direkt in der Nähe des µControllers.
- Das Board meldet sich mit
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
- Die Meldung mag je nach Manta Board etwas variieren. Allerdings sollte dort immer was mit DFU und oder BOOTLOADER zu lesen sein.
STRG+C
drücken, um die Meldungen zu beenden
Katapult flashen
Hinweis:
Katapult wird über USB (DFU-Mode) eingerichtet!
- Katapult laden wenn noch nicht vorhanden, sonst in den Katapult Ordner wechseln
[ ! -d "$HOME/katapult/" ] && cd ~ && git clone https://github.com/Arksine/katapult && cd katapult || cd ~/katapult
make menuconfig
- Manta M8P V2.0
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
- Manta M8P V1.x
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
- Manta M5P
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
- Wichtig: Hier wird als Communication interface USB ausgewählt, nicht CAN!
- Sonst ist später kein Update möglich!
- Katapult kompilieren
make -j4
- Katapult flashen (das Board muss im DFU Mode sein !)
dfu-util -R -a 0 -s 0x08000000:mass-erase:force -D ~/katapult/out/katapult.bin
- Wichtig ist am Ende
File downloaded successfully
bei der Ausgabe im Terminal
- Das Board einmal resetten
- Reset Taste (Reset) drücken
- oder das Board einmal stromlos machen
- Die Status LED sollte jetzt am Manta Board blinken
Port ermitteln
- Board stromlos machen
dmesg -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
- Wir brauchen die Information mit tty… also in diesem Fall ttyACM0
STRG+C
drücken, um die Meldungen zu beenden
Klipper flashen
cd ~/klipper
make menuconfig
- Manta M8P V2.0
[*] 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
- Manta M8P V1.x
[*] 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
- Manta M5P
[*] 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
- Es kann im folgenden Schritt zu einem Fehler kommen (vor allem mit dem CB1 Board):
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
- Klipper kompilieren und flashen (über USB / seriell!)
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
- Die LED sollte jetzt nicht mehr blinken!
SBC
- Interface einrichten
Achtung : die Bitrate von 1000000 muss auch in der Board Firmware eingestellt werden!
sudo nano /etc/network/interfaces.d/can0
folgendes eintragen, speichern und mitSTRG + x
, dannY
, dannEnter
beenden
allow-hotplug can0 iface can0 can static bitrate 1000000 up ifconfig $IFACE txqueuelen 1024
- Testen mit
ip a
can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP group default qlen 1024
- Sollte das Interface auf
DOWN
stehen hilft meist ein
sudo systemctl restart networking.service
oder ein
sudo ip link set can0 up type can bitrate 1000000
Can Query
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:
- Klipper Dienst stoppen
sudo systemctl stop klipper.service
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
Wenn ein Board gefunden wird, dann sollte folgende Ausgabe erscheinen:
biqu@BTT-CB1:~/klipper$ ~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0 Found canbus_uuid=fa5ad324b369, Application: Klipper Total 1 uuids found
- Die UUID (canbus_uuid=fa5ad324b369) notieren !
- Wird bei diesem Schritt kein Board gefunden, hilft oft ein Reset am Board (entweder über den Reset Taster oder 1x Strom weg und wieder dran)
kurzer Test
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.
Konfiguration
cd ~/printer_data/config
- Beispiel Konfiguration M8P V1.0
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
- Beispiel Konfiguration M8P V1.0 Voron
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
- Beispiel Konfiguration M8P V1.1
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
- Beispiel Konfiguration M8P V2.0
wget https://raw.githubusercontent.com/bigtreetech/Manta-M8P/master/V2.0/Firmware/generic-bigtreetech-manta-m8p-V2_0.cfg -O printer.cfg
- Beispiel Konfiguration M5P
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
- Unterhalb
[mcu]
die Zeile mitserial
löschen oder auskommentieren - Unterhalb
[mcu]
die Zeilecanbus_uuid
entsprechend mit der ermittelten UUID von oben einfügen
- Klipper starten
sudo systemctl start klipper.service
Klipper Update
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.
- Klipper Dienst stoppen
sudo systemctl stop klipper.service
- Alle CAN UUID's ermitteln
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
- Das Manta Board per flshtool.py resetten. Welche UUID das Manta Board hat kann man bei mehreren Busteilnehmern leider nicht ohne weitere erkennen.
~/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
- Die Status LED sollte jetzt anfangen zu blinken
- Den Port ermitteln
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
- Klipper flashen
make -j4 flash FLASH_DEVICE=/dev/ttyACM0
Den ermittelten Port halt am Ende ggf. anpassen. - Klipper starten
sudo systemctl start klipper.service
Sonstiges
Diese Punkte sind nicht immer Bestandteil vom YouTube Video, aber nützlich
STM32 Temperatur
Der interne Temperatur Sensor des STM32 kann mit folgendem Konfig Schnipsel ausgelesen werden:
[temperature_sensor Manta] sensor_type : temperature_mcu sensor_mcu : mcu
ADXL345 (Input Shaper)
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 |
- Konfiguration (cs_pin & spi_bus anpassen!)
[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
- Manta M8P V2.0
cs_pin : PA15 spi_bus : spi3a
- Manta M8P V1.x
cs_pin : PC4 spi_bus : spi2
- Manta M5P
cs_pin : PC9 spi_bus : spi2
- Manta M4P
cs_pin : PD9 spi_bus : spi1
- Test in der MainSail Konsole mittels
ACCELEROMETER_QUERY
Als Ergebnis sollte in etwa sowas kommen:
accelerometer values (x, y, z): -1110.308913, 1184.329507, 11414.822920
- Sollte der Test folgenden Fehler bringen ist die Verkabelung falsch!
Invalid adxl345 id (got 0 vs e5)
Links
- Github Repo
Manta M8P V2.0 https://github.com/bigtreetech/Manta-M8P/tree/master
Manta M8P V1.x https://github.com/bigtreetech/Manta-M8P/tree/master
Manta M5P https://github.com/bigtreetech/Manta-M5P/tree/master - Manual
Manta M8P V2.0 https://github.com/bigtreetech/Manta-M8P/blob/master/V2.0/BIGTREETECH%20MANTA%20M8P%20V2.0%20User%20Manual.pdf
Manta M8P V1.x https://github.com/bigtreetech/Manta-M8P/blob/master/V1.0_V1.1/BIGTREETECH%20MANTA%20M8P%20V1.0%26V1.1%20User%20Manual.pdf
Manta M5P https://github.com/bigtreetech/Manta-M5P/blob/master/BIGTREETECH%20MANTA%20M5P%20V1.0%20User%20Manual.pdf - Schaltplan
Manta M8P V2.0 https://github.com/bigtreetech/Manta-M8P/blob/master/V2.0/Hardware/BIGTREETECH%20MANTA%20M8P%20V2.0-SCH.pdf
Manta M8P V1.x https://github.com/bigtreetech/Manta-M8P/blob/master/V1.0_V1.1/Hardware/BIGTREETECH%20MANTA%20M8P%20V1.1-SCH.pdf
Manta M5P https://github.com/bigtreetech/Manta-M5P/blob/master/Hardware/BIGTREETECH%20MANTA%20M5P%20V1.0-SCH.pdf - Bootlader Entry bei Bridge Mode
https://github.com/Klipper3d/klipper/blob/master/docs/Bootloader_Entry.md