Klipper mainline on the Ender 3v3 KE

I am considering porting Klipper mainline to my rooted Ender 3v3 KE.
The version on the printer is outdated and not directly updateable, because
Creality made some changes and did not merge them into mainline klipper.

So far, I am aware of the following difficulties:

  • PRTouch (Probe Z-Offset) via load cell at the front left is not included in the standard Klipper
  • Possibly binaries for the MCU, no sources from Creality
  • Unknown commit at which Creality split off the development of Klipper
  • Nebulapad (standard display on the Ender) may no longer be usable

Do you have any ideas about what else might need to be done and how hard this can be, or is there already a project in the works?

Load cells connected to HX711 ADC are now supported in Klipper


Pin diagrams at

ah ok, thanks for the info! @cardoc

Link: Klipper for Creality Ender 3 V3 - #2 by Sineos

That link doesn’t apply to the KE.

The KE has an embedded SBC (nebula board) that runs an unknown Linux distro that hosts Klipper. That board is connected to the motherboard with a proprietary 10 wire ribbon cable.

I ASSUME they include 2 USB data lines (could be RS232), 4 pass through GPIO pins for the accelerometer, 5V power and ground from the MCU board to power the nebula board.

The nebula board does have boot and reset switches which should allow the OS to be updated easily. I can’t determine what CPU is on the board and ARM distros are usually chip specific.

I can see 4 paths to “Kick creality to the curb” and take control.

  1. Root the nebula board, use kiauh to uninstall Klipper and associated modules, update the OS as best you can, use Kiauh to reinstall klipper, build and flash klipper to the MCU
  2. Install a clean distro on the Nebula, Kiauh, Flash (I have no idea if a compatible distro exists)
  3. Decode the 10 pin cable and install a “better” SBC with OS, Kiauh, Flash.
  4. Decode the umbilical cable and replace the SBC and mainboard with a 5+ driver Klipper friendly board (so you can enable Z tilt).

Any of the 4 should allow the loadcell to be used for setting the Z offset. There is always the “paper test” as a fallback while you get the loadcell online.

#2 is quite elegant and I’m sure it would be VERY popular with other KE owners. It is however WAY beyond my skillset.

The ender 3v3 ke uses a build root based linux installation:

root@Ender3V3KE-CE0D /root [#] cat /etc/os-release
NAME=Buildroot
VERSION=2020.02.1-g712caadd73-dirty
ID=buildroot
VERSION_ID=2020.02.1
PRETTY_NAME=“Buildroot 2020.02.1”

running on a MIPS processor:

root@Ender3V3KE-CE0D /root [#] cat /proc/cpuinfo
system type		: xburst2-based
machine			: ingenic,x2000_module_base
processor		: 0
cpu model		: Ingenic XBurst@II.V2 V0.0  FPU V0.0
BogoMIPS		: 2390.01
wait instruction	: yes
microsecond timers	: no
tlb_entries		: 288
extra interrupt vector	: yes
hardware watchpoint	: yes, count: 1, address/irw mask: [0x0fff]
isa			: mips1 mips2 mips32r2
ASEs implemented	: msa
shadow register sets	: 1
kscratch registers	: 6
package			: 0
core			: 0
VCED exceptions		: not available
VCEI exceptions		: not available

processor		: 1
cpu model		: Ingenic XBurst@II.V2 V0.0  FPU V0.0
BogoMIPS		: 2390.01
wait instruction	: yes
microsecond timers	: no
tlb_entries		: 288
extra interrupt vector	: yes
hardware watchpoint	: yes, count: 1, address/irw mask: [0x0fff]
isa			: mips1 mips2 mips32r2
ASEs implemented	: msa
shadow register sets	: 1
kscratch registers	: 6
package			: 0
core			: 1
VCED exceptions		: not available
VCEI exceptions		: not available

current state of development: GitHub - salami738/ender3-v3-ke-klipper-mainline: Klipper mainline on Creality Ender 3v3 KE

feedback welcome!

Hey, it’s already been done – GitHub - 0xD34D/klipper_ender3_v3_se: Klipper is a 3d-printer firmware

but if you want to get us up to current, that’d be great..

Also, there’s a branch that enables the screen on the SE, I recommend bringing that code in as well!

1 Like

I have a few questions about this:

  • Is your approach also suitable for the Ender 3v3 KE?
  • The Ender 3v3 KE has the Nebula display, for example, but as far as I know, the SE uses a different one.
  • Why did you port the Creality PR touch instead of using the Mainline Klipper version?
  • How did you solve the problem that the c_helper.so and klipper host mcu code has to be built for the MIPS architecture?

For the MIPS topics, I have documented scripts and build environments, for example.

I can answer these, even though neither is my fork.

  • 0xd34d’s branch was originally for the KE, jpcurti added screen support for the se
  • the se does use a different display which requires different communication, I am not that familiar with the nebula display
  • I think you’re confusing the pr-touch with the cr-touch, the pr-touch is the loadcell in the bed for auto-z height, 0xd34d’s branch uses creality’s pr-touch v1 implementation as they have not provided anything but binary blobs for v2
  • I’m not sure exactly what you mean, but you can cross-compile for most targets on most hosts

Thanks for the information!

About the Nebula Display: It is essentially an SBC with a MIPS CPU (Ingenic XBurst@II.V2) and 256 MiB RAM (200 MiB usable). It runs Buildroot Linux with an outdated C library and various Creality customizations, e.g., an init script that can update the MCU (of course with Creality bootloader and no katapult, SIGH).
Therefore, you cannot simply cross-compile with a current gcc, but need a special environment.
Since it took me several days to get this up and running, I have published it here:

The following must be compiled for MIPS: c_helper.so and the klipper host mcu.
See: ender3-v3-ke-klipper-mainline/klipper/c_helper at main · salami738/ender3-v3-ke-klipper-mainline · GitHub and

Furthermore, a GD32 (STM32 clone) is installed on the MCU board, for which you have to use a special baud rate, otherwise it will not start: ender3-v3-ke-klipper-mainline/mcu-firmware at main · salami738/ender3-v3-ke-klipper-mainline · GitHub

Yes, I mean the PR Touch (i.e., auto nozzle-to-probe offset with load cell).
There is the Creality implementation (prtouch.py) for this, and there is a load_cell implementation in Klipper mainline. I would prefer to use the one from Klipper mainline, possibly combined with a macro. But I’m not done with that yet.

The Creality CR Touch (auto bed levelling) can be used in Klipper mainline simply as a BlTouch.

My current clipper configuration can be found at: ender3-v3-ke-klipper-mainline/klipper/printer-config-files at main · salami738/ender3-v3-ke-klipper-mainline · GitHub .

I will take a closer look at the adjustments from the 0xD34D repo over the next few days.

YEAH!

Klipper mainline (master) is working on my ender 3v3 ke with adaptive bed mesh and some tunings.

mcu(stm32f103xe)
Version: v0.13.0-454-ge60fe3d99
Load: 0.02, Awake: 0.01, Freq: 72 MHz, Temp: 33°C

mcu rpi(linux)
Version: v0.13.0-454-ge60fe3d99
Load: 0.01, Awake: 0.00, Freq: 50 MHz,

Host(mips, 32bit)
Version: v0.13.0-454-ge60fe3d99
OS: Buildroot 2020.02.1
Load: 0.49, Mem: 71.0 MB / 197.0 MB