Marlin icon indicating copy to clipboard operation
Marlin copied to clipboard

[WIP] Creality Ender-5 S1

Open thinkyhead opened this issue 2 years ago • 13 comments
trafficstars

Creality Ender-5 S1 adds support for a new Resistive Touch Screen controller and a new motherboard. Many code changes and a few new options are included to support the new controller.

The Ender-5 S1 is a cube-shaped machine with a standard X / Y gantry and Z bed, so it should be configurable with the existing firmware options, plus whatever is needed to interact with the UI on the RTS. This machine can have an optional Wi-Fi add-on, so there is some code to also support that component.

This PR is a work in progress, with the aim to make the Ender-5 S1 work with the basic Marlin firmware as closely as possible, and to fix up any eccentric or extraneous customizations to the firmware behavior.

At this time this code is not functioning correctly and the machine simply reboots. So, it needs to be fixed up, refined, and tested. The closer we can get to the basic Marlin code without the added customizations, the better. Some changes by Creality may actually fix or work around existing bugs, so may be worth keeping.

Calling all brave Ender-5 S1 users to help develop and test this implementation! It would be nice to improve the UI, which is definitely in a rough form. The machine also ships with aggressive acceleration so that should also be re-tuned in the configuration, along with enabling any other motion options that make it perform fast, but reliably.

Configurations (also work-in-progress) are posted at https://github.com/MarlinFirmware/Configurations/tree/import-2.1.x/config/examples/Creality/Ender-5%20S1

The TODO on this can be seen by looking at the code changes. The ultimate aim is to get any required behavioral changes to be conditional so they only apply to this machine (and any others that want those changes), and to integrate any required bug-fixes or behavioral improvements that make sense for all.

thinkyhead avatar Feb 14 '23 07:02 thinkyhead

I don't have one, tiny machines is not planning on carrying them currently so they didn't send me one, my marketing contacts that have sent me machines direct in the past from Creality have all moved on, so even though it looks trivial I don't have any reason to put time into it. The code shown here is nearly identical to the problematic code I eliminated in the past from prior iterations. If someone provides a machine ill get it done but im not buying a machine to add to my workload and im not putting time into a machine i have no reason to.

InsanityAutomation avatar Mar 02 '23 14:03 InsanityAutomation

Did you get the printer booting? I'm not a developer but am generally able to modify examples and compile custom firmware; I have a machine I'm happy to test with, the stock firmware is rubbish

sbur83 avatar Mar 17 '23 23:03 sbur83

just for fun tried to compile this today. after adding several missing commits i end up on

c:/users/master/.platformio/packages/[email protected]/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: .pio/build/STM32F401RE_CREALITY/src/src/gcode/feature/leds/M224_M225.cpp.o: in function `GcodeSuite::M224()':
C:\Users\master\Downloads\Marlin-port_creality_ender5_s1_bugfix-2.1.x\Marlin-port_creality_ender5_s1_bugfix-2.1.x/Marlin\src\gcode\feature\leds/M224_M225.cpp:33: undefined reference to `RTSSHOW::RTS_SetLED(bool)'
c:/users/master/.platformio/packages/[email protected]/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: .pio/build/STM32F401RE_CREALITY/src/src/gcode/feature/leds/M224_M225.cpp.o: in function `GcodeSuite::M225()':
C:\Users\master\Downloads\Marlin-port_creality_ender5_s1_bugfix-2.1.x\Marlin-port_creality_ender5_s1_bugfix-2.1.x/Marlin\src\gcode\feature\leds/M224_M225.cpp:39: undefined reference to `RTSSHOW::RTS_SetLED(bool)'

Seems like RTS_SetLED is missing in leds gcode.

Do you have something in the works for this which maybe is a bit more recent to bugfix-2.1.x ?

ThomasToka avatar Mar 27 '23 13:03 ThomasToka

hej @thinkyhead .

this time is was able to get a bit further. as i dont have the board here i tried to compile it on #define MOTHERBOARD BOARD_CREALITY_V24S1_301F4.

installing binary and watching on terminal i see this:

Log Output
Recv: //action:notification Hardcoded Default Settings Loaded
Recv: echo:Hardcoded Default Settings Loaded
Recv: echo:Settings Stored (624 bytes; crc 44421)
Recv: //action:notification Settings Stored
Recv: //action:notification Settings Stored
Recv: echo:EEPROM Initialized
Recv: //action:prompt_end
Recv: BL24CXX Check succeeded!
Recv: Error:EEPROM datasize error.
WARNING! Received an error from the printer's firmware, ignoring that as configured but you might want to investigate what happened here! Error: EEPROM datasize error.
Recv: echo:Index: 618 Size: 624
Recv: //action:notification Hardcoded Default Settings Loaded
Recv: echo:Hardcoded Default Settings Loaded
Recv: echo:Settings Stored (624 bytes; crc 44421)
Recv: //action:notification Settings Stored
Recv: //action:notification Settings Stored
Recv: echo:EEPROM Initialized
Recv: bootloader SD card...
Recv: 
Recv: SD¿¨ÖÐûÓÐupdate.binÎļþ
Recv: IAP_UpdateAppName is firmware-20230404-204716.bin
Recv: BIN data can use ...
Recv: IAP_CurrentAppName firmware-20230404-204716.bin
Recv: IAP_UpdateAppName firmware-20230404-204716.bin
Recv: Don not Need to updata app...
Recv: start
Recv:  Watchdog Reset
Recv: Marlin bugfix-2.1.x
Recv: 
Recv: echo: Last Updated: 2023-04-01 | Author: (none, default config)
Recv: echo: Compiled: Apr  4 2023 20:37:44
Recv: echo: Free Memory: 55735  PlannerBufferBytes: 1792
Recv: Error:EEPROM datasize error.
WARNING! Received an error from the printer's firmware, ignoring that as configured but you might want to investigate what happened here! Error: EEPROM datasize error.
Recv: echo:Index: 618 Size: 624

hardware failure or can i or you adjust something in order to make it work?

ThomasToka avatar Apr 04 '23 18:04 ThomasToka

EEPROM datasize error.

Nothing abnormal about that. You have to write the EEPROM anew after any update that alters the EEPROM data structure, and in this case the defaults are used in place of the EEPROM data. A failure to continue, or a crash leading to reboot must originate elsewhere.

I have cleaned up the code so it fits with the latest bugfix-2.1.x but have not yet flashed it onto the machine. There is still quite a lot of cleanup to be done to properly adapt it to our open source model. There is also news of an updated screen firmware, which likely comes with firmware code changes as well, so we'll need to get a hold of that and the updated Marlin code and apply those changes to this PR also.

In general, vendors are free to make whatever changes are required to adapt Marlin to their machines without any consideration whether those modifications will prevent the firmware from running on other machines. When we want to bring over their changes, we have to take a much more careful approach, converting their ad hoc modifications into new options and new features, so that is the bulk of the work that remains here.

thinkyhead avatar May 02 '23 04:05 thinkyhead

#ifdef TARGET_STM32F4
  #define DWIN_SERIAL Serial1
#else
  #define DWIN_SERIAL LCD_SERIAL
#endif

@InsanityAutomation — I'm curious about the LCD_SERIAL port used on the STM32F4 versus the F1. It would be good to remove the override that forces it to be Serial1 on the F4 and just make it a Configuration.h setting for the LCD when we know the board is going to have Serial1 on the LCD connector. At the moment we have this in Conditionals_adv.h

/**
 * LCD_SERIAL_PORT must be defined ahead of HAL.h and
 * currently HAL.h must be included ahead of pins.h.
 */
#if LCD_IS_SERIAL_HOST && !defined(LCD_SERIAL_PORT)
  #if MB(BTT_SKR_MINI_E3_V1_0, BTT_SKR_MINI_E3_V1_2, BTT_SKR_MINI_E3_V2_0, BTT_SKR_MINI_E3_V3_0, BTT_SKR_E3_TURBO, BTT_OCTOPUS_V1_1)
    #define LCD_SERIAL_PORT 1
  #elif MB(CREALITY_V24S1_301, CREALITY_V24S1_301F4, CREALITY_V423, MKS_ROBIN, PANOWIN_CUTLASS, KODAMA_BARDO)
    #define LCD_SERIAL_PORT 2
  #else
    #define LCD_SERIAL_PORT 3
  #endif
  #ifdef LCD_SERIAL_PORT
    #define AUTO_ASSIGNED_LCD_SERIAL 1
  #endif
#endif

…so we can modify or extend that as needed to account for certain boards. In the long run it will be good to move the LCD serial port definitions to a new header that comes later in the MarlinConfig.h ordering so that all the serial ports (or their defaults) can be pre-defined in the pins files. But for the moment they're set up in HAL.h so we don't have that flexibility just yet.

thinkyhead avatar May 03 '23 00:05 thinkyhead

I see there is a newer version of Ender-5 S1 firmware over at https://github.com/CrealityOfficial/Ender-5S1 … So we'll have compare that and bring over any updates. Pretty soon….

thinkyhead avatar May 09 '23 00:05 thinkyhead

Just wondering what the current status of this is?

Are we at least at a point to boot and be able to flash the machine if there's issues?

I saw from the README in the configs directory that there's weird bootloader interactions that might essentially brick a board without strange sketches... Is there a known / shareable recovery method if they do have issues?

I was going to start building daily builds with notes etc - but looks like things are still a bit up in the air on this particular printer...

CRCinAU avatar Jun 13 '23 02:06 CRCinAU

Just wondering what the current status of this is?

Are we at least at a point to boot and be able to flash the machine if there's issues?

I saw from the README in the configs directory that there's weird bootloader interactions that might essentially brick a board without strange sketches... Is there a known / shareable recovery method if they do have issues?

I was going to start building daily builds with notes etc - but looks like things are still a bit up in the air on this particular printer...

Good luck getting any response, love thinkyheads work, some detail of progress would be nice

sbur83 avatar Jun 19 '23 09:06 sbur83

Hello, how are you? Do you have any news? I would like to have a modified Marlin firmware, especially to exploit some features of Octoprint, since the printer does not deliver or refresh the screen at all.

fvalladaresg1975 avatar Oct 17 '23 01:10 fvalladaresg1975