Building firmware

Hey folks I just thought I’d throw down some instructions for building a firmware from the Sovol provided source. And show some changes I made for my particular setup.

So first things first. Download the source from Sovol and extract to a folder anywhere you’d like. Then download VSCode from Microsoft. It’s the easiest method to build with. Once it’s installed and opened you need to click the extensions icon it’s 4 square blocks in the upper left bar. Then search for auto build Marlin. Install it, and once it’s finished, close VSCode and reopen. Don’t skip this, VSCode can get buggy with newly installed plugins.

Now that we have an environment to build with, open the source folder you extracted. It will expand and populate a few things. Now here is where I made changes for my setup.

First thing we will open is platformio.ini and find default_envs =

If this line says ANYTHING other than STM32F103RET6_creality, change it to read that. So the line should read:

default_envs = STM32F103RET6_creality
Do not skip this step it’s vital for build time.

Now open Marlin subdirectory, then open file configuration.h and ctrl+F search for MOTHERBOARD. Make sure it says

#define MOTHERBOARD BOARD_CREALITY_V4
If it does not change it this is vital for build time.

Now here is where I made custom changes for my particular setup, modify these as you need.

In the same configuration.h I changed

#define TEMP_SENSOR_0 from 1 to 1047 because I’m using an E3D volcano block with a PT1000 sensor.

I also changed

#define HEATER_0_MAX_TEMP and all under it (0-7) to 305 because I have a bi-metal heatbreak instead of the Teflon tube lined one it comes with.

I then changed
#define BED_MAXTEMP from 125 to 140 for printing carbon fiber nylon parts.

Now if you’re going to run octoprint, or another raspberry pi or computer control platform, you’ll need to enable host action commands.

In the Marlin subdirectory open configuration_adv.h and ctrl+f search for HOST_ACTION_COMMANDS where this should appear.

#define HOST_ACTION_COMMANDS
#if ENABLED(HOST_ACTION_COMMANDS)
//#define HOST_PAUSE_M76
//#define HOST_PROMPT_SUPPORT
//#define HOST_START_MENU_ITEM

You will remove the comment // marks in front of the 3 #define lines so it will now look like this.

#define HOST_ACTION_COMMANDS
#if ENABLED(HOST_ACTION_COMMANDS)
#define HOST_PAUSE_M76
#define HOST_PROMPT_SUPPORT
#define HOST_START_MENU_ITEM

So now we are ready to build. Click the M icon on the left hand bar. In the next screen click Show ABM Panel. The next screen to show up should show the current build parameters. What we’re looking for are

Board: Creality V4
Pins: STM32F1/pins_CREALITY_V4.h
Architecture: STM32F1

If all these look like what I’ve listed click build for the STM32F103RET6_creality (512k). I tried the _maple version from reading some other creality forums, and mine wouldn’t extrude. From what I gather some boards with the GD32F303RET6 processor will only work with maple and some won’t. Mine didn’t work with _maple. So after a lot of swearing and head scratching I compiled as the first one and it worked for me.

Don’t worry about seeing some warnings in yellow. They don’t apply to our build at the moment. Maybe in the future if you want to upgrade your Marlin version. But that’s another can of worms we won’t get into now.

Now a new window should pop up with the .bin file we just built. It will be called firmware-xxxxxxxx-xxxxxx.bin. The first 8 x’s are the build date, the last 6x’s are the time of build. Leave this file alone, make a copy and call it new-firmware.bin. These creality 4.x.x boards have a bug/feature, lots of debate here, where if you flash a new firmware with a file that has the same name, or the first 10 characters the same, it will NOT flash the new file. The Sovol firmware was titled firmware-V1.2.0.bin, so by naming it new-firmware.bin ensures us it will flash, and we can flash back to the factory firmware if we have to without changing its name.

Now toss that bin file onto an empty fat32 or exfat formatted SD card, unplug any USB cables if you’re using octoprint, insert the SD card and power on. The LCD screen should turn on with the Sovol logo, and it will “stall” here for up to 30 seconds. Mine is usually under 20, then the animation will play and drop you to the main menu.

Now you should re level your bed and enjoy. I also advise running the M303 PID Autotune Marlin feature through the terminal in octoprint. The examples they show are enough to get good PID’s. The factory PID’s are a “safe for all units produced” setting. We can do better. Watch the terminal in octoprint and when it completes punch the numbers it’s shown in on your LCD manually in the advanced settings PID menu. By tuning the extruder and bed, you’ll notice they heat up faster, and don’t over/undershoot very much. If you’ve changed the temp sensor like I have this is a must so you’re not printing at the wrong temps.

Hope this wall of text helps folks out. Have a good one.

3 Likes

Thank you for the excellent tutorial. :pray:

Does this procedure work on all Sovol models?
I have the SV06.
Also, Do you know if “relative extrusion” is supported?

This method should work on all of the creality 4.2.x based printers. But you’ll need to open the case where the board is and check what ARM chip is installed. On my SV01 PRO it’s a GD32F303 RET6, which seems like a mostly compatible chip with the STM32F103 RET6. And you’ll need the source files for the specific printer. Not sure if relative extrusion is supported by the creality boards or not. Only made the changes I needed for my setup.

Thanks for the info. Sovol has the source files for the SV06 on their download page, so I would think that if I edit the files by removing the comment field for any feature I want too try to enable that the process will be similar to your instructions, but using the default printer name listed in the official firmware source.
Might be worth a try, I could always flash back the official firmware if it doesn’t work… assuming I don’t manage to somehow brick the printer. :joy:

@roadshow If you’ll install Platform.io (an extension in VS Code), you shouldn’t need to do anything else other than run a build command for the SV06. I didn’t try flashing my machine with it, but I did try building it the other day. I don’t know if the other machines build without changes, but the SV06 source on Github did build “out of the box” for me. They have some Platform.io config files in there already that pre-configure a lot of this stuff which is why it skips some steps.

1 Like

Yeah they definitely changed stuff in platformio.ini with the source they post making it easier. But auto build Marlin is much easier to use than platformio by itself. If you want to build Marlin from scratch you’re gonna be spending a lot of time doing a bunch more work. I might be going that route for Martin 2.1.1. If I do I’ll document everything I do along the way to make things easier for others in the future. Right now I’m just running the 2.0.9.2 Sovol posted source.

I’m happy for now, the only bug I’m aware of at the moment is printing in spiral mode, you must disable resume on power loss with M413 S0 in slicer settings or it pauses every few seconds from memory being full, and extrudes a blob while it waits for memory to clear for the next instructions. I think that was fixed in 2.0.9.4/5.

Yep, this works for the SV06 as well. I enabled the M73 command to display print progress on the LCD screen since disabling power loss recovery also disables the built in progress tracking.

1 Like

Thanks for the info.
Did you enable or change any other options that weren’t on the official SV06 firmware?
I’m new to 3D Printing, so not familiar with GCode or which options are worthwhile to enable. I did see a video where someone enabled showing “remaining time” on the display in addition to the percentage complete, but it wasn’t the SV06.

Thank you.
Does using platform.io load the same settings as the released SV06 firmware, or can you make changes before it’s built?

I only changed the display name for the firmware so I could tell when the update was successful.

Cura has post processing scripts that can display current layer and remaining time on the LCD but these use the M117 command which is enabled out of the box.

JimboJones have you thought about putting your changes up on github as a fork of GitHub - Sovol3d/SV01-Pro-Source-Code: Sovol SV01 PRO is a budget printer with compact functions and printing size of 280*240*300 is larger than other printers at the same price level. It’s with All Metal Direct Drive Extruder, supporting more materials including soft TPU, PETG, ABS, PLA and Wood. Auto Leveling, Intuitive Touch Screen, Flexible Plate, Filament sensor, etc are available.