SDCard update mks robin nano printerboard via ssh

Basic Information:

Printer Model: Kingroon KP3S Pro
MCU / Printerboard: Kingroon KP3 V1.3 (MKS Robin nano like)

Describe your issue:

Hello.
I desided to flash my printer without removing SD Card.
So I modified ~/klipper/scripts/spi_flash/board_defs.py file
just made changes in mks-robin-e3 section

‘mks-robin-e3’: {
‘mcu’: “stm32f103xe”,
‘spi_bus’: “swspi”,
‘spi_pins’: “PC8,PD2,PC12”,
“cs_pin”: “PC11”,
“firmware_path”: “Robin_nano.bin”,
“current_firmware_path”: “Robin_nano.cur”
},
OK, there were some errors related wrong file name. A bit of research shows the problem in
8.3 Filename (MS DOS stile). After change name to Robin_na.bin all OK and firmware file copy on SD card but, of course, flahing procedure doesnt start due to wrong file name (Robin_nano.bin is correct). So may be anyone knows how to rename file on native SD card remotely from klipper host via ssh. OR modify spi_flash.py for correct work with long filenames?

I guess (I don’t own a Kingroon KP3 V1.3) the filename is wrong.
A very quick and dirty www search gave me ROBIN_MINI.BIN
…but I don’t know for sure :wink:

No, I can flash printer just copy firmware file named Robin_nano.bin on SD card on PC, without any issue.

Ok, sorry I misunderstood you.
I don’t get your problem. Can you explain

more clearly?

I guess you are using windows as OS on your machine connected to the SBC.

I’m using armbian as klipper host and want to flash pinter as describes here:
https://www.klipper3d.org/SDCard_Updates.html

Ok, so your setup is:
Windows PC → SBC (armbian)?
koconnor uses probably a mac or PC with linux. Somewhere there is the problem. I’m going to my favoured place to stop and think. There, I’ll read SDCard updates - Klipper documentation :wink:

No, problem does not depend of OS. I’ve done all the same on linux, windows machine and even android via ssh clients.

I would open an issue here Issues · Klipper3d/klipper · GitHub.

Nope. In general bugs on Github are not opened without explicit consent from a developer here. This is why the issue function on GH is disabled.

Also I do not see any Klipper bug here. I’m not even sure that this board type allows for this flashing method and even if it would, it is apparently not implemented and thus at maximum a feature request.

Edit: While not being a developer, according to my knowledge Python does support long filenames so the issues likely is somewhere else.

I’m sure it would be ok, just correct file appear on the SD card.
In this case Python code uses Fatfs c-language library (FatFs - Generic FAT Filesystem Module) without long names support ( FF_USE_LFN = 0 in options). So It would be nice to add that support.

1 Like

I don’t agree. I didn’t, know that the issue function on GH is disabled (that is sad, but I can understand why :disappointed_relieved:). I never tried to open an issue regarding Klipper. In my eyes, you should open an issue to start a conversation with the developers (but think about your question! Developers (and us) do it for free! Useless questions just waste time!)

That’s why, I would open an issue and not a feature request. Developers can decide, if it’s worth a feature request.

But where is the bug? That’s why, I would open an issue.

RomanVlg has a problem. Something in the Klipper procedure doesn’t work, like he expected. He asked here in the forum and didn’t get a solution. In my eyes, this is the point to open an issue.

The discussions here and everywhere should have the purpose to make Klipper better!

Sorry but this is the philosophy chosen in this project, it has been extensively discussed and decided. It would be rather pointless to start a discussion about it since it will not change (so don’t expect any further answers from me on this topic).

The place to exchange is here or on the Klipper discord. Both places are also followed by the developers and if they care to weigh in, they will do so.

I hope I get an answer :wink: . I totally agree with you.

D’accord. Can you post some links where it was discussed? That might be interesting.

They want everything about me. I don’t want to give anything to the www. It’s a bummer! I don’t trust the www. Sorry, I can’t be part of that community, too bad.

It’s not that much of a loss - Using Discord is like trying to find a coin lost on a beach.

Please refer to Contact - Klipper documentation

1 Like

Finally I found temparary solution.

  1. Add section in file ~/klipper/scripts/spi_flash/board_defs.py
    ‘mks-robin-e3-nano’: {
    ‘mcu’: “stm32f103xe”,
    ‘spi_bus’: “swspi”,
    ‘spi_pins’: “PC8,PD2,PC12”,
    “cs_pin”: “PC11”,
    “firmware_path”: “Robin_nano.bin”,
    “current_firmware_path”: “Robin_nano.cur”
    },

name of the section must beginning with mks-robin-e3! Name of firmware Robin_nano.bin or Robin_nano35.bin, Robin_nano43.bin if no screen attached.
2. Modify file ~/klipper/lib/fatfs/ffconf.h with parameters
#define FF_USE_LFN 1
#define FF_MAX_LFN 50
3. stop klipper ( sudo service klipper stop)
4. flash SDcard with flash-sdcard.sh script or kiauh choise mks-robin-e3-nano board.
My command for example is
./scripts/flash-sdcard.sh /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 mks-robin-e3-nano

in output the string
Building FatFS shared library…Done
should be present due to compile library with new parameters.
5. Theare some erorrs, but file Robin_nano.bin appear on the SD card. So, at last, hard reset printer (power switch off with button, printer start flasing from SD card) and start klipper.

I wanted to avoid pressing power button by
echo FIRMWARE_RESTART > ~/printer_data/comms/klippy.serial
command, but flashing doesnt started despite the printer reseting and beeping.

1 Like

cool :ok_hand:

I wrote something similar for Marlin.

I used M997 to update the firmware Firmware update | Marlin Firmware. It supports STM32F1 on Marlin. I don’t know if M997 is supported by Klipper. G-code - RepRap doesn’t know.

You may find the code here https://github.com/hcet14/auto_upload_marlin_skr2_stm32f429vtg6.py/blob/main/auto_upload_marlin_skr2_stm32f429vtg6.py line 176.

Have a look here (sorry it’s in French) Imprimante 3D Artillery Sidewinder X2 - 300 x 300 x 400 mm, ABL Auto Calibration + filament (Entrepôt Europe) – Dealabs.com WizardPC did the M997 with ssh. So that should work.

@RomanVlg

did you try M997? I would like to know if it worked.

Kind regards, hcet14