MCU firmware update using flash-sdcard.sh

Basic Information:

Printer Model: Ender 3
MCU / Printerboard: BTT SKR Mini E3 V3

Describe your issue:

“flash-sdcard.sh” script works well with a 8Gb SD card but it doesn’t recognize 64Gb sd card:

~/klipper$ ./scripts/flash-sdcard.sh /dev/serial/by-id/usb-Klipper_stm32g0b1xx_280049000550414235393120-if00 btt-skr-mini-e3-v3
Flashing /home/orangepi/klipper/out/klipper.bin to /dev/serial/by-id/usb-Klipper_stm32g0b1xx_280049000550414235393120-if00
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
Initializing SD Card and Mounting file system…

SD Card Flash Error: Failed to Initialize SD Card. Is it inserted?
Traceback (most recent call last):
File “/home/orangepi/klipper/scripts/spi_flash/spi_flash.py”, line 1324, in _configure_mcu_spibus
self.fatfs.mount(printfunc)
File “/home/orangepi/klipper/scripts/spi_flash/spi_flash.py”, line 327, in mount
raise OSError(“flash_sdcard: failed to mount SD Card, returned %s”
OSError: flash_sdcard: failed to mount SD Card, returned FR_NO_FILESYSTEM

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/orangepi/klipper/scripts/spi_flash/spi_flash.py”, line 1647, in main
spiflash.run()
File “/home/orangepi/klipper/scripts/spi_flash/spi_flash.py”, line 1587, in run
self.run_reactor_task(self.run_sdcard_upload)
File “/home/orangepi/klipper/scripts/spi_flash/spi_flash.py”, line 1570, in run_reactor_task
k_reactor.run()
File “/home/orangepi/klipper/klippy/reactor.py”, line 292, in run
g_next.switch()
File “/home/orangepi/klipper/klippy/reactor.py”, line 340, in _dispatch_loop
timeout = self._check_timers(eventtime, busy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/orangepi/klipper/klippy/reactor.py”, line 158, in _check_timers
t.waketime = waketime = t.callback(eventtime)
^^^^^^^^^^^^^^^^^^^^^
File “/home/orangepi/klipper/klippy/reactor.py”, line 48, in invoke
res = self.callback(eventtime)
^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/orangepi/klipper/scripts/spi_flash/spi_flash.py”, line 1542, in run_sdcard_upload
self.mcu_conn.configure_mcu(printfunc=output_line)
File “/home/orangepi/klipper/scripts/spi_flash/spi_flash.py”, line 1359, in configure_mcu
self._configure_mcu_spibus(printfunc=printfunc)
File “/home/orangepi/klipper/scripts/spi_flash/spi_flash.py”, line 1327, in _configure_mcu_spibus
raise SPIFlashError(
SPIFlashError: Failed to Initialize SD Card. Is it inserted?

Simple solution: Do not use a 64GB card. It is known that not all cards are working.

I’ve had similar issues, I just partitioned the SD card with an 8GB partition and left the rest unpartitioned. Then I flashed the MCU with it and restored the full size partition when it was done.

To add: This is not a bug. This depends on the combination of SD card and the reader on the board.

I tried to use 64gb first and it didn’t work so I decided that my SD card socket spring mechanism is broken. so I bought a bunch of SD/TF card sockets, heat gun and some consumables. I desoldered old socket and soldered in a new one but it still wasn’t working. so then I took a 8gb SD card and surprisingly it is working well

I don’t regret that I tried so many things in order to flush firmware as I’ll find other use for them and it is a lesson at the end. however I think it could be useful for other people just to mention this feature in Klipper’s wiki that high capacity SD cards won’t work. just as a hint

I never thought of it as a bug, just a bit of a quirk in the way the MCU on some of the printers mount the card. It’s got nothing to do with Klipper.

alright I got the idea. so it’s not Klipper’s issue but hardware property

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