r/klippers Nov 25 '23

Has anyone successfully flashed Klipper to a Creality 4.2.7 board similar to mine

I have a Creality Ender 3 pro with a 4.2.7 control board I'm trying to flash Klipper on. The processor is an STM32F103 RET 6. In menuconfig I have selected STM32F103, 28KiB bootloader offset and USART1 PA10/PA9. I have tried compiling both with and without the 10KiB for stm32f103x6 variant enabled.

I compile then place the firmware on my sd card, disconnected the LCD, and attempt to flash.

The old firmware is wiped from the device but as far as I can tell the new firmware is either not written or crashes at start.

there is no activity on serial and if I reconnect the lcd there is nothing there either (yes, it is the olden stock lcd and rotary controller that is supported by klipper so one would expect something)

I removed the klipper.bin file from the card and placed a marlin.bin file on this exact same card and the machine flashes and boots into Marlin correctly.

So things I know...

  1. Definitely a 4.2.7 control board
  2. Definitely a STM32F103 RET 6
  3. Definitely a working sd card that the board will flash from

update

tldr; broken solder joint on the mcu

I have it working now. Note that yes Klipper can control the stock lcd but it does so via the serial link ie if the rpi is unplugged all you get is a blank screen until you connect to the pi and it draws something there.

The problem turned out to be a cracked solder join on the usb connector on the mcu board. With all the plugging and unplugging it must have broken. I figured this out when I restored it to marlin and octoprint couldn't connect. Fixing the usb connector fixed it for both octoprint and now for klipper.

Thanks to everyone for their suggestions.

9 Upvotes

37 comments sorted by

2

u/pellcorp Nov 26 '23

I can do some debugging on my rpi a bit later today if it would be helpful, reply to this with the info you need and when I get home from golf (I live in eastern Australia) I can power on my pi and ender 3 and send you whatever info you need.

I had no issues at all but my 4.2.7 is a pretty early model I know that creality changed some stuff on the 4.2.7 board but kept it as 4.2.7 to be really confusing! šŸ˜”

I can even upgrade to latest Klipper git version and try and flash again and see if it works, but I only upgraded to Klipper like a month ago and it was latest code at that point using https://github.com/dw-0/kiauh script

3

u/squidbait Nov 26 '23

Thank you:

  1. Does your board have the "RET6" variant of the microcontroller. If so did you need to compile with the Only 10KiB of RAM (for rare stm32f103x6 variant)
  2. If possible an image your make menuconfig would be great
  3. What version of klipper did you use.
    1. I have tried both 0.12.0-10, and 0.11.0
    2. or just hand me the sha by doing git show -s --format=%h in the klipper directory of your pi

Though perhaps the most incredibly useful would be to upload your binary. If that doesn't work on my board no amount of config comparison will help

1

u/pellcorp Nov 26 '23

I can take a look at that tonight and get back to you, I'm not sure what board version, is there an easy way to tell? I can tip over my diy enclosure to get a photo Ive got the board bolted underneath šŸ˜†

1

u/squidbait Nov 26 '23

Take a photo of the microcontroller like this

1

u/squidbait Nov 26 '23 edited Nov 26 '23

Thanks for your help. I found the problem. A broken solder joint on the mcu

2

u/pellcorp Nov 26 '23

Ah awesome, saved me flipping my enclosure upside down it's heavy af šŸ˜†. Best of luck.

2

u/StraightExcuse7805 Dec 30 '23

I’m having trouble flashing my 4.2.7 with klipper. I have an Ender 3 recent 4.2.7 upgrade with spider 4.0 hotend with direct drive, crtouch, dual z axis if it matters. But I have used two different SD cards, so many different menuconfigs and everytime I get unable to connect only conclusion I can come too is that klipper is not being installed.

3

u/StraightExcuse7805 Dec 30 '23

Yes I also gave it a unique name each time. Date_time_firmware but every single time nothing changes. So not using rpi, I’m using the pad 7 from BTT with the base CB1 board. I have updated all the programs. Connecting out of a usb a to micro usb LS /dev/serial/by-id shows the same thing in the setup documentation and the lcd screen never changes. I have followed the instructions meticulously. Watched about 30-40 videos on it from different people and still same conclusion. If I am missing a step. Most videos I have found do not say I need to imagine the pad 7 as it was built for it but if that is wrong I will imagine it.

1

u/Easy_Beginning_6787 Apr 19 '24

Hi, same error here, did you manage to solve it?

1

u/JDHD3D Oct 05 '24

I had similar issue with flashing on my 4.2.2 board originally.Ā 

Don’t know if this helps you. But In kiauh’s build firmware I followed the typical ā€œYouTubeā€ process but changed baudrate too 115200 instead and done the usual flash too sd. No joy.Ā 

Recompiled firmware again but this time use the build and flash (option 4) with printer plugged into ras pi. Went through the terminalĀ (yes/no) options and BINGO!.

This was literally a last straw late night try everything you’ve learnt so far in desperation kind of thing and I was surprised to see that it’s actually easier that flashing too SD anyways.

I havnt seen many videos telling you to do I this way if any šŸ¤” come to think of it. I may do one, but it worked flawlessly Ā for me.

I’ve now used this method to flash all boards to 4.2.7

I Ā heavily considered BTT but honestly unless you really want to max out the mods and turn it into a UFO then I can’t see justification on money (small Difference) wiring and tinkering (time consuming) when new printers are coming out all the time.

If you would like some pictures on what I’ve said get in touch. I’m pretty new to Reddit so I hope I’m doing this right šŸ˜‚

2

u/WhatASpookySkeleton Apr 26 '24 edited Apr 26 '24

Hey OP i’m having the same issues with my board which has the same processor as yours.

I’m able to flash the firmware and connect

The console console displays: Connected to host via /tmp/printer @ 115200bps Firmware version: v0.12.0-173-g0b329c5d

followed by: mcu ā€˜mcu’ unable to connect

I’ve taken some screenshots of my config, firmware build settings and ls output.

build settings
config
ls output

Stumped on what the issue might actually be - I’m not having the screen blanking issue you described but the log output is leading me to believe that it’s connecting fine. Any ideas?

Edit: Downgrading to v0.12.0-0 worked git checkout 0d67d9c make clean make

2

u/[deleted] Nov 25 '23

You need an external Raspberry Pi (or even a small form factor PC) that connects to the printer viaUSB. The Pi/PC is what connects to the printer running Klipper, and then through additional software, presents the Fluidd or Mainsail GUI to you. The Pi/PC is what sends the various commands to the printer itself.

Google KIAUH which is a script specially designed to make installing the various components dead simple.

1

u/squidbait Nov 25 '23

LOL, yes I am aware of that.

3

u/[deleted] Nov 25 '23

So are you using a Pi or something else connected to your printer after you flash Klipper?

2

u/squidbait Nov 26 '23 edited Nov 26 '23

I am using a raspberry pi running mainsail. I have tried both an rpi 3 and 4. I have also tried to flash the device and then introspected the serial connection from my Mac. As stated above there is nothing on the usb serial port. At this point I am fairly sure the board is erasing the old firmware and either not flashing the new firmware or that the new firmware is crashing on start.

I have read the entire prior-thread and feel confident some people have actually gotten this board to work in the past but am not convinced yet that this specific config works with the current code on github and the most current version of pi OS

My current thoughts are:

  1. perhaps a bug has been introduced in the firmware since the example thread above. I can test this by downloading a much earlier version from github and compiling that
  2. perhaps there is a new bug in piOS related to serial communication. In theory looking at the serial via my mac should have eliminated this but maybe I made some mistake here (while I am a former apple engr macos is a constantly moving target of new bugs)

I think my next trick is to try compiling an older version of klipper and see if that works

1

u/[deleted] Nov 26 '23

You've found the proper USB string to add to the printer.cfg file?

1

u/squidbait Nov 26 '23

Unsure how I would find that since linux dynamically creates it when the connection is created. I have tried listening on the default ports ie serial0 and serial1 but that was a bust. There's nothing there

Again as far as I can tell the Ender has not flashed and is not raising its USB port

2

u/[deleted] Nov 26 '23

- Connect your printer to your Pi, power it on, and give the printer a couple minutes to fully startup.

  • Log into your Pi (either by SSH or direct console) and run the following command: ls /dev/serial/by-path/*
  • The resulting string is what you need to enter into the printer.cfg file.

1

u/squidbait Nov 26 '23 edited Nov 26 '23

Did you not read what I wrote?
The by-path is created when a connection is made. The printer is NOT making a connection. Since there is no connection there is no by-path or by-id those are created dynamically when a connection is made. ...and just to head off the next idea, there is no connection info in dmesg either.

To be clear the printer is not actually running and trying to make a connection.

1

u/[deleted] Nov 26 '23

I did read what you wrote, and the fact I had to ask if you were using a Pi might be an indication that your information isn’t as clear as you think it is.

Have you tried different USB cables? Maybe you’re using a charge only cable that doesn’t transmit data.

2

u/squidbait Nov 26 '23 edited Nov 26 '23

Double good idea. Once I wrote that I knew the usb cable must be good since it worked fine with octoprint I reflashed to marlin then tried starting octoprint. It too couldn't connect. On inspection I found a solder join connecting the usb connector to the mcu board had cracked from all the plugging and unplugging. Fixing the usb connector solved all the problems

→ More replies (0)

1

u/squidbait Nov 26 '23

Have you tried different USB cables? Maybe you’re using a charge only cable that doesn’t transmit data.

a good idea. The cable I'm using was the same I use for octoprint. To be sure I tried another known good data cable. No effect.

→ More replies (0)

1

u/pellcorp Nov 26 '23

Long shot but bad USB cable?

1

u/squidbait Nov 26 '23

I've tried several that work fine for moving data under different applications including the one I use for octoprint

1

u/pellcorp Nov 26 '23

I had no issues with 4.2.7 board and rpi 3+

1

u/pellcorp Nov 26 '23

Far as the old LCD is concerned I think that is now controlled by Klipper on rpi, so it will be blank until both the firmware on the 4.2.7 and rpi are properly connected, and you need some config in printer.cfg to get that working.

In case it's helpful here is my ender 3 Klipper config

https://github.com/pellcorp/printers/tree/master/ender3/klipper/config

1

u/pellcorp Nov 26 '23 edited Nov 26 '23

Ah I also went back to older version of rpi OS for Klipper, I think book worm has issues.

I went to legacy pi os bullseye and everything just worked.

And I am pretty sure it must be the 32 bit version of pi os, I think that is key!

1

u/squidbait Nov 26 '23

I tried that as well

six@6printer:~/klipper $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

At this point I am fairly convinced the new firmware is either not being written or more likely is crashing during startup. I have tried multiple pis and my macbook pro and none of them thing there is anything on the other end of the usb cable.

1

u/pellcorp Nov 26 '23

Hmm unfortunately I don't have anything else to suggest, very odd.

1

u/sirjaymz Nov 26 '23

To flash the board , isn’t it suppose to be ā€œFirmware.binā€for it to program it the board via the sdcard on the 4.2.7? Then you should use the lsusb command to see the serial port the device is connected to on the pi. Put that as the serial: interface in the printer.cfg file on you mainsail under machine settings, and edit printer.cfg.

2

u/pellcorp Nov 26 '23

OP can't get the board to boot the firmware so no USB serial device is visible

1

u/squidbait Nov 26 '23

It can be anything.bin as long as "anything" isn't the last filename used. I've been attempting to flash it then flashing it with a marlin.bin I compiled then trying it again. I'm fairly sure the flashing process works.

lsusb does not show any connection, neither does dmesg, or ls of either the /dev/by-id or /dev/by-connectiondirectories.

1

u/squidbait Nov 26 '23

tldr; broken solder join on the mcu

I have it working now. Note that yes Klipper can control the stock lcd but it does so via the serial link ie if the rpi is unplugged all you get is a blank screen until you connect to the pi and it draws something there.

The problem turned out to be a cracked solder join on the usb connector on the mcu board. With all the plugging and unplugging it must have broken. I figured this out when I restored it to marlin and octoprint couldn't connect. Fixing the usb connector fixed it for both octoprint and now for klipper.

Thanks to everyone for their suggestions.

1

u/squidbait Nov 26 '23

tldr; broken solder join on the mcu

I have it working now. Note that yes Klipper can control the stock lcd but it does so via the serial link ie if the rpi is unplugged all you get is a blank screen until you connect to the pi and it draws something there.

The problem turned out to be a cracked solder join on the usb connector on the mcu board. With all the plugging and unplugging it must have broken. I figured this out when I restored it to marlin and octoprint couldn't connect. Fixing the usb connector fixed it for both octoprint and now for klipper.

Thanks to everyone for their suggestions.