I have a well functioning printer with a little older version of klipper.bin flashed. Everything runs smooth and I am a “happy camper” - for now.
However the SD-card reader is broken om my MCU and I wonder if a new firmware can be flashed via the USB port?
I searched Google and found a good YouTube video how to compile and send new firmware from the Pi to the MCU, but it will try to write to an inserted SD card, which is not working for me.
So is it possible to flash an already running MCU with a fresh version of klipper.bin without a SD-card?
At first glance it looks easy enough. However the guides on YouTube only show how to flash a bootloader to the board and then explain how to use the SD-card to reflash new firmware. A quick search does not show how to flash i.e… klipper.bin through the SWD port. Can it be done?
As I’m not the expert here, I would defer this question to more knowledgeable people like @koconnor or @Arksine.
I assume it should work the same as for the bootloader and the necessary offset is already chosen during make menuconfig process. But again, you know “to assume makes an ass out of you and me”
I think the best you may try, is fixing the root cause.
Did you try different SD cards? Is the card recognized in your common PC? If you own just one card, you may try to clean the contacts. Use a smooth rubber or eraser for erasing pencil marks.
SD card readers on 3d printer mainboards are usually cheap. So no “push push” variants with a spring. Have a close look at the contacts, if possible. Maybe you are able to bend the contacts to get a better connection to the card. If not, replace the socket. Do you have “very good” soldering experience? If yes, this should be possible with a common solder iron and some helpers.
Hmm, since there are alternative ways to flash, I would not start soldering to be honest. I would consider myself to be quite experienced in soldering but if possible I’ll avoid doing it on crammed boards with 0603 SMDs
If I have a problem with electronics and want to fix it, I choose the “replacement way”. If not possible, I look for for an alternative.
We are not talking about 0603. We are talking about an SD card socket. Pretty huge
Don’t think about it, if you don’t have “very good” soldering experience!!!
The short answer is “Yes”, using the SWD port as Sineos indicated BUT buying an SWD programmer and making up a cable for your SKR Mini will cost more than the board. Then you’ll have to figure out how to configure your Klipper.bin file which will be a bit of work but if you screw things up, it’s no big whoop as you can reprogram the SKR Mini anytime you want to.
As for soldering. Interesting conversation as I can do 0603s all day without any issue, for SD Cards I need to use microscope.
Honestly, the easiest and cheapest solution to your problem is to buy a replacement SKR Mini E3 V3 when you feel the need to update Klipper.
0603 width is 0.85mm, SD Card pin width is 0.30mm on 1.10mm spacing. I just can’t do SD Card leads without a microscope (I’ve done more than a few and that’s why I bought a microscope for home).
I’ve found over the years that different people can do different parts differently - I remember watching a friend (not a trained technician) put down a 208 lead LQFP without a microscope in less than two minutes with perfect quality yet couldn’t solder PTH hole parts properly to save his life.
I mean a ST-Link (clone) is like 10 to 15 USD and something I consider to be part of every serious tinkerer’s tool-box. Even if most of us (especially myself) do only have a rudimentary clue what can be done with it. But: It can flash custom firmware on my daughter’s e-scooter, so the invest is already amortized.
The biggest problem that somebody will have doing is figuring the right connector to use with the SKR Mini. I just did a quick Google search on it and I see at least a dozen different SWD pinouts.
Clearly you have the skills to do this and if I was presented with the board I could do it but I’d be hesitant to recommend it to somebody that I don’t know their capabilities are when the connector on the board doesn’t match any kind of standard for the required functionality.
0603 pitch (which is distance between centers) can be as small as 1.3mm but is generally 2.5mm to 3mm in most cases.
It’s generally not the lead/component width that’s the problem but it’s the space between it and the adjacent lead/component when you’re going to do rework (ie removal/replacement) that makes things challenging.
Thats why we are here to support and honestly, flashing Klipper is more difficult:
If you power the board by USB, usually no need for +3.3
RST usually not needed as well
Remove Power from the board
Connect:
GND to GND
DIO to SWDIO
CLK to SWCLK
Press and hold the BOOT button
Power the board
Release the BOOT button
Flash with the flasher of your choice
The only thing I’m unsure about if you need to specify an offset in the flashing tool or if the offset chosen in make menuconfig is already taking care of it. Also not even 100% sure if you need to use BOOT when using the SWD interface.
If it was my board, I’d simply back it up and try it but I do not want to give any half baked advice.
Edit:
You might even be able to flash it with stmflash directly by connecting the RPi TX / RX pins to the STM/GD RX / TX pins or use an USB TTL adapter like described here: CanBoot: Flash BTT SKR 1.3 / 1.4 / 1.4 Turbo
I agree that the purpose of the forum is to support, but it’s important to understand the capabilities, equipment and limitations of the person looking for the support.
We haven’t heard from @VagnPetersen in a while and I’m curious to know whether he did the basic cleaning of the pins as suggested by @hcet14 - that’s probably a very good first step and then he can say how comfortable he is replacing the SD Card connector or buying something that provides ST-Link functionality and wiring his own connector to the board.
From there we can suggest the most appropriate course of action for him rather than argue over how we would solve the problem if we were in his place.
Thank you everybody for some very precise information.
The SD-card reader metal housing got bend when I installed the MCU and when I tried to fix it, the metal housing simply broke off. I can psychically presse an SD-card onto the connectors, but this is not a very stabel procedure, however that was how I managed to flash the present version of klipper.bin.
I don’t feel comfortable soldering a new connector to the board so I guess I will live the the present configuration until it is absolutely necessary to re-flash the klipper firmware.
I just hoped it was possible to utilize the USB connection to “update” an already functioning installation, but I guess that is not the case.
Thank you again for clarifying my options.
It may be more of an industry term - I worked at IBM/Celestica in manufacturing for over 20 years and I never heard the term “THT” used. I worked another five years at Logitech and RIM in engineering and only PTH was used. In any case, there shouldn’t be any confusion.
As for SD Card spacing vs 0603, we all have our skills.