JoeTodes / BIQU-B1-Klipper-Settings

printer.cfg and other notes for installing Klipper and Mainsail on a stock BIQU B1 with a Pi Zero 2 W
20 stars 2 forks source link

Possible to work with SKR 2 (instead of SKR 1.4)? #4

Open DougJoseph opened 7 months ago

DougJoseph commented 7 months ago

Thanks for the great tutorial!

I had tried the wiring patch cable as shown, and had no power to the Pi, only to then later discover, the main board in the BIQU B1 I was working on, was an SKR2. I found a pinout diagram:

https://teamgloomy.github.io/images/skr_2.0_pins.png

skr_2 0_pins

...And in addition to showing that BTT reversed the order of the TFT pins, with 5v power and GND on the other end of the TFT block, it lists the (presumably Tx and Rx pins) as "PA9" and "PA10" instead of "Tx0" or "Rx0" — so I'm not sure whether the Tx and Rx functions were flipped or not, i.e. which is which.

I reoriented the wires in exactly the reverse order, in which my Tx and Rx wires are still being "flipped" with each other on the way to the main board, and I now have power, but the Klipper interface in the browser says:

mcu 'mcu': Unable to connect

So I guess next I could try flipping the Tx and Rx wires. ?

EDIT: OK, I flipped the Tx and Rx wires and tried again, and still no connection. I will retry both ways again, in case it was a connection issue.

DougJoseph commented 7 months ago

Also, I'm a little confused about this step in the directions:

config.txt - replace the last section with:

[pi0w] enable_uart=1 dtoverlay=pi3-miniuart-bt

My config file has the following near the end:

## Enable Hardware UART for Serial Communication
## This also disables Bluetooth!
enable_uart=1
dtoverlay=disable-bt

...However, the directions mention pi3, and I'm using pi4b.

Also, the above code from my config file, is in a section called "[all]"

..and it contains other info. I'm not sure if I am supposed to just change "dtoverlay=disable-bt" to "dtoverlay=pi3-miniuart-bt" or replace the whole "[all]" section. ?

Here's how the latter portion of my config.txt file currently reads, from line 83 through to line 152.

[all]

####################################################
####     MainsailOS specific configurations     ####
####################################################
####      DO NOT CHANGE SECTION BELOW !!!       ####
####   UNLESS YOU KNOW WHAT YOU ARE DOING !!!   ####
####################################################

## For more options and information see
## https://www.raspberrypi.com/documentation/computers/config_txt.html
## Some settings may impact device functionality. See link above for details

## For additional information about device filters see
## https://www.raspberrypi.com/documentation/computers/config_txt.html#model-filters

[pi0]
## This affects Pi Zero(W) and Pi Zero2
## Due lag of RAM, limit GPU RAM
gpu_mem=128

[pi2]
gpu_mem=256

[pi3]
## Use 256 if 1Gb Ram Model!
gpu_mem=128
# gpu_mem=256

[pi4]
## Do not use more than 256Mb on Pi Model 4, it uses its own Management.
gpu_mem=256

[all]

## SPI Interface is enabled by default for Input Shaper
## This colides with Hyperpixel Display!
## Hyperpixel Screen uses the same Pin for Backlight.
dtparam=spi=on

## Enable Hardware UART for Serial Communication
## This also disables Bluetooth!
enable_uart=1
#dtoverlay=disable-bt
dtoverlay=pi3-miniuart-bt

## Enable I2C by default.
## This is used by Klipper's Host MCU
## See https://www.klipper3d.org/RPi_microcontroller.html#optional-enabling-i2c
## for destails.
## For MPU Accelrometer please use
## dtparam=i2c_arm=on,i2c_arm_baudrate=400000
dtparam=i2c_arm=on

### EXPERIMENTAL - Enable 64bit Kernel
### The 64-bit kernel will only work on:
### Raspberry Pi 3, 3+, 4, 400, Zero 2 W and 2B rev 1.2
### and Raspberry Pi Compute Modules 3, 3+ and 4.
# arm_64bit=1

####################################################

[all]
DougJoseph commented 7 months ago

Another note on this effort. It dawned on me that the firmware.bin (klipper.bin) file may have needed other settings, and printer.cfg might need to be different. I located this sample file:

https://github.com/Klipper3d/klipper/blob/master/config/generic-bigtreetech-skr-2.cfg

And it mentions that some BigTreeTech SKR 2 boards use STM32F407, while some shipped in late 2021 use the STM32F429.

I took a look, and my board uses STM32F407, so the following from the sample file applies:

the firmware should be compiled for the
# STM32F407 with a "32KiB bootloader".

Also, regarding which pin is Tx and which is Rx, I found this:

https://github.com/bigtreetech/SKR-2/issues/13

https://github.com › bigtreetech › SKR-2 › issues Apr 29, 2021 — On SKR-2 PA9 is TX and PA10 is RX. So pin 10 (RXD0) of RPi would go to the middle pin (PA9) of tft connector on SKR-2 and pin 8 (TXD0)of RPI ...

So that means... for the pin table from this tutorial's readme, for SKR 2, it would be modified to:

Pi GPIO Pin Purpose SKR 2 TFT Pin
4 5V NPWR
6 GROUND GND
8 TX->RX PA10 (RX)
10 RX<-TX PA9 (TX)