What is this about​

This post will give guidelines on how to flash your own marlin onto a Eryone Thinker S V2 (NOT the V1) or ER20 printer.

I will go into as much detail as possible but please keep in mind that marlin is constantly being developed and changes can lead to a setting being named differently, a file being renamed and so on.
I am in no way liable for any damages to you, your property or anything else that might result from following the steps outlined in this article!

Why should i go through the trouble?​

You can always use a precompiled version of marlin but i prefer to have the latest version available. It also comes in handy in case you want to make changes to the bed leveling algorithm or switch to a new hotend to name just a few of the cases where your own firmware will be needed.


You will need the following things/software:
– Latest Marlin Bugfix from https://marlinfw.org/meta/download/

– Eryone Marlin as reference ( ER20 or Thinker S V2 )

– Notepad++ ( download )

– Visual Studio Code ( download )

– Python (https://docs.platformio.org/en/latest/faq.html#install-python-interpreter)


All screenshots are made on a windows system, the interface might look a bit different on a linux or OSX system!
That being said: Let’s go.

Install Notepad++

Install Python and tick the box “Add to path” during installation.

Install Visual Studio Code and open it.
Select the little 4 Blocks on the left to get into the extension menu and search for Platformio. Install it.
Search for Auto Build Marlin and install it.
Restart Visual Studio Code

Visual Studio Code

Taking Eryone specific settings over to marlin​

Some settings in the marlin version downloaded from eryone are specific for the respective printer.
If you own an ER20, open the config.h file from the ER20 marlin folder ( on my system it is located in the STM32-master folder in STM32-master\Marlin_ER20\Marlin ) with notepad++, if you own a Thinker S please use the config.h from the Thinker S folder.

Marlin configuration and preparation​

Open the config.h from the marlin bugfix folder which you downloaded earlier as an extra window in Notepad++.
In now both config.h files should be open in Notepad++.
Select the one from the Eryone folder as an active window.

Click onto Plugins in the navigation bar at the top and select Compare -> Set as First to Compare. As an alternative you can use the shortcut Ctrl+Alt+1. If the compare plugin is not yet available click Plugins -> Plugins Admin and search for compare, install it.


Now switch to the second, new config.h from the marlin bugfix version which you just downloaded.
Use Ctrl+Alt+C to compare it to the other file or navigate to Plugins -> Compare and click Compare.
Your screen should now look similar to the screenshot below

Comparing configs

Lines highlighted in yellow are lines with differences, red ones are missing in the file on the right, green ones are extra lines in the file on the right which are missing in the file on the left.
Interesting for us are the yellow lines as these might contain printer specific settings which we want to take over to the new marlin version.

Remember: Your OLD Config is on the left, the one we are editing on the right

The first line that is of minor interest is the version line


Your version number will be different! Just make sure that your new marlin has a higher version than the one we are taking the settings from. There is no sense in downgrading 😉

I will go through the ER20 config in detail below. For the Thinker S just follow the same steps but compare it to your old config.

ER20 config.h

These are the changes i needed to make for the ER20. Please keep in mind that you might have to make different changes! This is why we have the files open in compare mode so you can check which values are needed!

#define SERIAL_PORT 0

needed to be changed to

#define SERIAL_PORT 2

The baud rate needs to be set at 115200

#define BAUDRATE 115200

Now we need to be careful:
The motherboard is an eryone specific development and is NOT included in the standard marlin. So we need to copy the file into our new marlin. In order to do that simply minimize Notepad++ (but leave the windows open)
Use your Windows File Explorer and navigate to


inside the eryone firmware folder.



and paste it into the same folder in the marlin bugfix folder which contains our new firmware


Now we switch back to Notepad++ and change the line #define Motherboard to


In case you want to name your printer uncomment

#define CUSTOM_MACHINE_NAME "3D Printer"

and put any name between the “.

I called mine Junior as it is the smallest of my printers 😉

#define CUSTOM_MACHINE_NAME "Junior"

Make sure the filament diameter is set to 1.75


The temp sensors need to be defined like this:

#define TEMP_SENSOR_0 13
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_3 0
#define TEMP_SENSOR_4 0
#define TEMP_SENSOR_5 0
#define TEMP_SENSOR_6 0
#define TEMP_SENSOR_7 0
#define TEMP_SENSOR_BED 13

Change the maximum temperature for the bed to 110

#define BED_MAXTEMP      110

Uncomment define PIDTEMPBED to enable PID Control of the bed


Change the bed pid values to the following:

  #define DEFAULT_bedKp 100.12
  #define DEFAULT_bedKi 5
  #define DEFAULT_bedKd 305

Invert the endstops for Z by setting them to true




Next we need to define the stepper drivers used. The ER20 uses TMC2209 so we define them as follows:

#define X_DRIVER_TYPE  TMC2209
#define Y_DRIVER_TYPE  TMC2209
#define Z_DRIVER_TYPE  TMC2209
//#define X2_DRIVER_TYPE A4988
//#define Y2_DRIVER_TYPE A4988
//#define Z2_DRIVER_TYPE A4988
//#define Z3_DRIVER_TYPE A4988
//#define Z4_DRIVER_TYPE A4988
#define E0_DRIVER_TYPE TMC2209
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
//#define E3_DRIVER_TYPE A4988
//#define E4_DRIVER_TYPE A4988
//#define E5_DRIVER_TYPE A4988
//#define E6_DRIVER_TYPE A4988
//#define E7_DRIVER_TYPE A4988

In order for the printer to move the exact distance that we want it to we need to set the steps per unit to the following values:

#define DEFAULT_AXIS_STEPS_PER_UNIT   { 80, 80, 400, 93 }

The feedrate needs to be adjusted as well

#define DEFAULT_MAX_FEEDRATE          { 200, 200, 10, 100 }

Jerk is set to 1000

#define DEFAULT_ACCELERATION          1000    // X, Y, Z and E acceleration for printing moves
#define DEFAULT_RETRACT_ACCELERATION  1000    // E acceleration for retracts

Jerk for z is set to 0.4

#define DEFAULT_ZJERK  0.4

As the ER20 comes with a BLTouch we need to uncomment the following line to enable it:

#define BLTOUCH

In order for the printer to “know” where it is probing we need to define the Offset

#define NOZZLE_TO_PROBE_OFFSET { 30, 0 ,-2.6 }

Also make sure to adjust the probing margin. This value defines how close to the edge the probe will measure.


Eryone also sets the low point to -3, so we simply take that setting over to our new config

#define Z_PROBE_LOW_POINT          -3

Invert the z stepper. If you forget this your z axis will move into the wrong direction

#define INVERT_Z_DIR true

We also need to change the bed size to the right values

#define X_BED_SIZE 250
#define Y_BED_SIZE 230 

Uncomment define Z_SAFE_HOMING. This makes sure that the printer probes at a point which we define


Eryone wants the BLTouch to probe at the left front corner. The default is probing at the center of the bed.
If you prefer the eryone setting change

  #define Z_SAFE_HOMING_X_POINT X_CENTER  // X point for Z homing
  #define Z_SAFE_HOMING_Y_POINT Y_CENTER  // Y point for Z homing


  #define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE) / 8) //((X_BED_SIZE) / 2)    // X point for Z homing when homing all axes (G28).
  #define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE) / 8)//((Y_BED_SIZE) / 2)    

Eryone also ups to feedrate to

#define HOMING_FEEDRATE_Z  (100*60)





to enable the EEPROM Storage

Change the define PREHEAT_1_TEMP_HOTEND and define PREHEAT_1_TEMP_BED to the values you need for your PLA
I use the eryone default values

#define PREHEAT_1_TEMP_BED     60

Uncomment define NOZZLE_PARK_FEATURE


and change the line to

#define NOZZLE_PARK_POINT { (X_MIN_POS + 10), (Y_MAX_POS - 10), 10 }

Comment the following display line. This is the wrong display, eryone uses another.


Enable SD Support by uncommenting the line


In order to set the right display uncomment

#define ULTRA_LCD



Those were all the important changes i needed to make. Save and close.

ER20 Configuration_adv.h

Now open the configuration_adv.h and enter compare mode again.

Make the following changes to the heated chamber options

  #define CHAMBER_MINTEMP             32
  #define CHAMBER_MAXTEMP            70
  #define TEMP_CHAMBER_HYSTERESIS     1   // (°C) Temperature proximity considered "close enough" to the target
  #define HEATER_CHAMBER_PIN       PB8   // Chamber heater on/off pin

This is the mainboard temp sensor 😉

Next we need to set the thermal runaway settings. This is the feature that shuts of your printer in case a thermal runaway (eg a loose heating cartridge) is detected

  #define THERMAL_PROTECTION_PERIOD 60        // Seconds

Eryone also sets the watch periode to 40

 #define WATCH_TEMP_PERIOD 40 

The protection periode for the bed is set to the following

  #define THERMAL_PROTECTION_BED_PERIOD        60 // Seconds

Due to the fact that eryone built their own mainboard we need to adjust a few pins:

#define E0_AUTO_FAN_PIN PB4
#define E1_AUTO_FAN_PIN -1
#define E2_AUTO_FAN_PIN -1
#define E3_AUTO_FAN_PIN -1
#define E4_AUTO_FAN_PIN -1
#define E5_AUTO_FAN_PIN -1
#define E6_AUTO_FAN_PIN -1
#define E7_AUTO_FAN_PIN -1

#define EXTRUDER_AUTO_FAN_SPEED 255   // 255 == full speed

Uncomment the l2c lines

  #define DIGIPOT_I2C_ADDRESS_A 0x2C  // Unshifted slave address for first DIGIPOT
  #define DIGIPOT_I2C_ADDRESS_B 0x2D

and change the line

#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 }


#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 60 }

Uncomment the following line to show a printer info menu


To enable the power loss resume feature uncomment


and change define PLR_ENABLED_DEFAULT false to

#define PLR_ENABLED_DEFAULT   true 

Enable babystepping by uncommenting




Set define PROBING_MARGIN_RIGHT Probing_Margin to


Eryone seems to have altered the buffer for serial input. So make sure to change the corresponding line to

#define BUFSIZE 4*8

Uncomment define ADVANCED_PAUSE_FEATURE to enable the advanced pause feature


In order to make sure that the printhead is moved to the park position during pause uncomment


IMPORTANT: The next few lines define the current that is used on the drivers. Setting a high value might burn your stepper drivers. Make sure to use the right values for your drivers/ motors

The X Stepper Moter gets 0.6A.

#define X_CURRENT       600 

Y gets a bit more

 #define Y_CURRENT       700

Z gets the same as Y

#define Z_CURRENT       700

E0 gets 700mA

#define E0_CURRENT      700

In order for the TMC Drivers to report back to the mainboard we need to set the slave addresses

  #define  X_SLAVE_ADDRESS 2
  #define  Y_SLAVE_ADDRESS 3
  #define  Z_SLAVE_ADDRESS 1

As the ER20 uses no endstops we need to configure sensorless homing

  #define SENSORLESS_HOMING // StallGuard capable drivers only

    // TMC2209: 0...255. TMC2130: -64...63
    #define X_STALL_SENSITIVITY  70
    #define Y_STALL_SENSITIVITY  92

Last but not least we set the filament load speed

      {  7.2, 562 }, \

Save and close Notepad++

Compiling the firmware

Open Visual Studio and go to file, open folder and select the bugfix marlin folder.
From the left side select platformio.ini and replace the [platformio] part with

src_dir      = Marlin
boards_dir   = buildroot/share/PlatformIO/boards
default_envs = ERYONE_MINI_STM32F103V

if you are compiling for the ER20.

Search for [env:ARMED] and add the following code after the src_filter = ${common.default_src_filter} +

platform        = ststm32
board           = genericSTM32F103VE
build_flags     = !python Marlin/src/HAL/STM32F1/build_flags.py
  ${common.build_flags} -DDEBUG_LEVEL=DEBUG_NONE  -DHAVE_SW_SERIAL -std=gnu++14 -MMD -ffunction-sections -fdata-sections -nostdlib
build_unflags = -std=gnu++11   
extra_scripts = buildroot/share/PlatformIO/scripts/eryone_mini_STM32f103.py
src_filter      = ${common.default_src_filter} +<src/HAL/STM32F1>
lib_deps          = ${common.lib_deps}
lib_ignore      = Adafruit NeoPixel, SPI
debug_tool        = stlink
upload_protocol   = stlink

Copy the file eryone_mini_STM32f103.py from STM32-master\Marlin_ER20\buildroot\share\PlatformIO\scripts to Marlin-bugfix-2.0.x\buildroot\share\PlatformIO\scripts.


Issue 1: You get this error.

Marlin\src\HAL\STM32F1\dogm\../../../inc/../HAL/./STM32F1/fastio.h:30:10: fatal error: libmaple/gpio.h: No such file or directory:

The reason for this error is that the ST STM32 framework was updated to version 7. Marlin was built for version 6 and seems to be having a problem with version 7.
Update your platformio.ini file to resolve this ussie
Find and replace the line “platform = ststm32” with “platform = ststm32@<6.2.0”

Issue 2: You get this error.

Adafruit BusIO_ID6214\Adafruit_I2CDevice.cpp:160:79: error: no matching function for call to 'TwoWire::requestFrom(uint8_t, uint8_t, uint8_t)'

Again you need to update your platformio.ini file
Find the line “Adafruit_MAX31865=https://github.com/adafruit/Adafruit_MAX31865/archive/master.zip” and replace it with
“Adafruit MAX31865 library@~1.1.0”

Issue 3: X_Home_Bump_MM error

error: 'X_HOME_BUMP_MM' was not declared in this scope
error: 'Y_HOME_BUMP_MM' was not declared in this scope
error: 'Z_HOME_BUMP_MM' was not declared in this scope

your Configuration_adv.h has the following new lines
#define HOMING_BUMP_MM { 5, 5, 2 }

For some reason it will work when using the old format:

#define X_HOME_BUMP_MM 5
#define Y_HOME_BUMP_MM 5
#define Z_HOME_BUMP_MM 2
Simply replace the first line with these 3 lines.

Issue 4: You get these warnings.

	Cannot find "Marlin-2.0.x/include"
	Cannot find "Marlin-2.0.x/include"

These are just warnings and should be ignored.

Issue 5: Neopixel.h error

Marlin\src\feature/leds/neopixel.h:34:10: fatal error: Adafruit_NeoPixel.h: No such file or directory

In platformio.ini, some platforms have Adafruit NeoPixel disabled using the line
lib_ignore = Adafruit NeoPixel, SPI
remove the Adafruit NeoPixel part to make it “lib_ignore = SPI” to activate Neopixel Support.

Issue 6: Neopixel Error 2

"NeoPixel_ID28/Adafruit_NeoPixel.h:361:3: error: 'GPIO_TypeDef' does not name a type"

In the [common] section of platformio.ini you need to change
Adafruit NeoPixel to Adafruit NeoPixel@<=1.2.4

Categories: 3D PrintingFDM


Leave a Reply

Your email address will not be published. Required fields are marked *