Flash-sdcard.sh fails in recent releases

Basic Information:

Printer Model: Custom
MCU / Printerboard: BTT SKR-PRO 1.2 (stm32f407xx)
Host / SBC: Raspberry Pi 4
klippy.log: not applicable

Describe your issue:

Cannot update via flash-sdcard.sh anymore since 2 days. Might be connected to software_spi: set rate limiting ticks from the host · Klipper3d/klipper@abc76ee · GitHub

Command “./flash-sdcard.sh /dev/ttyAMA0 btt-skr-pro-v1.2” now fails with:

Flashing /home/someone/klipper/out/klipper.bin to /dev/ttyAMA0
Checking FatFS CFFI Build…
Connecting to MCU…Connected
Checking Current MCU Configuration…Done
MCU needs restart: is_config=1, is_shutdown=0
Attempting MCU Reset…Done
Waiting for device to reconnect…Done
Connecting to MCU…Connected
MCU configuration failed, attempting restart
Attempting MCU Reset…Done
Waiting for device to reconnect…Done
Connecting to MCU…Connected

SD Card Flash Error: Failed to configure MCU
Traceback (most recent call last):
File “/home/someone/klipper/scripts/spi_flash/spi_flash.py”, line 1659, in main
spiflash.run()
File “/home/someone/klipper/scripts/spi_flash/spi_flash.py”, line 1601, in run
self.run_reactor_task(self.run_verify)
File “/home/someone/klipper/scripts/spi_flash/spi_flash.py”, line 1582, in run_reactor_task
k_reactor.run()
File “/home/someone/klipper/klippy/reactor.py”, line 292, in run
g_next.switch()
File “/home/someone/klipper/klippy/reactor.py”, line 340, in _dispatch_loop
timeout = self._check_timers(eventtime, busy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/someone/klipper/klippy/reactor.py”, line 158, in _check_timers
t.waketime = waketime = t.callback(eventtime)
^^^^^^^^^^^^^^^^^^^^^
File “/home/someone/klipper/klippy/reactor.py”, line 48, in invoke
res = self.callback(eventtime)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/someone/klipper/scripts/spi_flash/spi_flash.py”, line 1569, in run_verify
self.mcu_conn.configure_mcu()
File “/home/someone/klipper/scripts/spi_flash/spi_flash.py”, line 1371, in configure_mcu
self._configure_mcu_spibus(printfunc=printfunc)
File “/home/someone/klipper/scripts/spi_flash/spi_flash.py”, line 1321, in _configure_mcu_spibus
raise MCUConfigError(“Failed to configure MCU”)
MCUConfigError: Failed to configure MCU

1 Like

I have the same issue and I can confirm, that reverting software_spi: set rate limiting ticks from the host · Klipper3d/klipper@abc76ee · GitHub fixes the issue.

1 Like

This is probably a fix.

Hope that helps.

1 Like

Indeed, that’s the fix. I experimented with those lines before too as is didn’t seem to make a lot of sense to add what’s been sent, but I didn’t remove that line. Silly me. Thank you!