SKR Pico: pin gpio3 is reserved for spi0a

Printer Model: Voron 0.2
MCU / Printerboard: BTT Pi v1.2 + BTT SKR Pico

I’m having trouble getting my SKR Pico to work with klipper.

Firmware is compiled as advised ( github → bigtreetech/SKR-Pico/tree/master/Klipper && SKR Pico Klipper Firmware | Voron Documentation):

[*] Enable extra low-level configuration options
Micro-controller Architecture = Raspberry Pi RP2040
Communication interface = USB

Device pops up in serial so far everything seems ok.

Via Mainsail, printer.cfg is a copy of https://github.com/VoronDesign/Voron-0/blob/Voron0.2r1/Firmware/bigtreetech-skr-pico-v1.0.cfg + edits for the motor currents and sensors.
It contains this part where gpio3 is set for the diag_pin.


[stepper_y]
step_pin: gpio6
## Refer to <snip>docs.vorondesign.com/build/startup/#v0
dir_pin: gpio5                                                      # Check motor direction in link above. If inverted, add a ! before gpio5
enable_pin: !gpio7
rotation_distance: 40
microsteps: 32
full_steps_per_rotation: 200                                        # Set to 400 for 0.9° degree stepper motor, 200 is for 1.8° stepper motors
endstop_pin: tmc2209_stepper_y:virtual_endstop
position_endstop: 120
position_max: 120
homing_speed: 20                                                    # for sensorless homing it is recommended not to go above 40mm/s   
homing_retract_dist: 0
homing_positive_dir: true

[tmc2209 stepper_y]
uart_pin: gpio9
tx_pin: gpio8
uart_address: 2
interpolate: False
run_current: 1.0            
# you need to calculate the run_current value using the equation (rated_motor_current * 0.707 = Maximum_run_current) start with a value that is about 60%-70% of your maximum value.
sense_resistor: 0.110
stealthchop_threshold: 0                                            # Set to 999999 to turn stealthchop on, and 0 to use spreadcycle
diag_pin: ^gpio3   												# YOU NEED TO JUMP THIS DIAG PIN ON YOUR BOARD FOR SENSORLESS HOMING TO WORK 
driver_SGTHRS: 255

klippy.log contains:

mcu 'mcu': Starting serial connect
webhooks client 281473193290576: New connection
webhooks client 281473193290576: Client info {'program': 'Moonraker', 'version': 'v0.8.0-92-g504a3a7'}
mcu 'mcu': got {'count': 348, 'sum': 37474, 'sumsq': 38153, '#name': 'stats', '#sent_time': 181.332097835, '#receive_time': 181.348853252}
Loaded MCU 'mcu' 112 commands (v0.11.0-275-g8ef0f7d7 / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2)
MCU 'mcu' config: ADC_MAX=4095 BUS_PINS_i2c0a=gpio0,gpio1 BUS_PINS_i2c0b=gpio4,gpio5 BUS_PINS_i2c0c=gpio8,gpio9 BUS_PINS_i2c0d=gpio12,gpio13 BUS_PINS_i2c0e=gpio16,gpio17 BUS_PINS_i2c0f=gpio20,gpio21 BUS_PINS_i2c0g=gpio24,gpio25 BUS_PINS_i2c0h=gpio28,gpio29 BUS_PINS_i2c1a=gpio2,gpio3 BUS_PINS_i2c1b=gpio6,gpio7 BUS_PINS_i2c1c=gpio10,gpio11 BUS_PINS_i2c1d=gpio14,gpio15 BUS_PINS_i2c1e=gpio18,gpio19 BUS_PINS_i2c1f=gpio22,gpio23 BUS_PINS_i2c1g=gpio26,gpio27 BUS_PINS_spi0a=gpio0,gpio3,gpio2 BUS_PINS_spi0b=gpio4,gpio7,gpio6 BUS_PINS_spi0c=gpio16,gpio19,gpio18 BUS_PINS_spi0d=gpio20,gpio23,gpio22 BUS_PINS_spi1a=gpio8,gpio11,gpio10 BUS_PINS_spi1b=gpio12,gpio15,gpio14 BUS_PINS_spi1c=gpio24,gpio27,gpio26 CLOCK_FREQ=12000000 MCU=rp2040 PWM_MAX=255 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
mcu 'CB1': Starting connect
mcu 'CB1': got {'count': 133, 'sum': 153513, 'sumsq': 981359, '#name': 'stats', '#sent_time': 181.959230794, '#receive_time': 181.997795586}
Loaded MCU 'CB1' 113 commands (v0.11.0-241-gffb5105b / gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2)
MCU 'CB1' config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256
Config error
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 180, in _connect
    cb()
  File "/home/biqu/klipper/klippy/mcu.py", line 753, in _connect
    self._send_config(None)
  File "/home/biqu/klipper/klippy/mcu.py", line 692, in _send_config
    cmdlist[i] = pin_resolver.update_command(cmd)
  File "/home/biqu/klipper/klippy/pins.py", line 53, in update_command
    return re_pin.sub(pin_fixup, cmd)
  File "/home/biqu/klipper/klippy/pins.py", line 50, in pin_fixup
    raise error("pin %s is reserved for %s" % (
pins.error: pin gpio3 is reserved for spi0a

Is there something I’m overlooking here?

Definitively! Posting your klippy.log as requested quite obviously when you opened this topic. Instead, you posted useless excerpts

Fair point. My apologies, you can find the file below.

klippy.log (30.4 KB)

This is quite strange.
Did you make sure

  • to jumper the board correctly for sensorless homing?
  • to have followed the build instructions for the firmware, e.g. nothing set except

Jumpers on x-diag and y-diag are set (two middle ones according to the doc)

No extra options have been set during firmware creation.

On a side note an probably totally unrelated: I do see gpio3 (among others) being assigned to spi0a in file “klipper/src/rp2040/spi.c” this matches the spi0 pinout of the “Raspberry Pi PICO RP2040” and I’m wondering if this is goes to for the BTT SKR Pico.

Your [extruder] config section is set to use the MAX31865 for temperature measurements. It looks like you will also need to set an explicit spi_bus (or similar) parameter as described at Configuration reference - Klipper documentation . Otherwise, Klipper is defaulting to spi bus spi0a which doesn’t look correct for your board.

Cheers,
-Kevin

2 Likes

Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.