Skip to main content

General instruction for recompiling the firmware to enable HOST_ACTION_COMMANDS for printers with a 32-bit mainboard

Step 1: Install required software

First, lets install all of the necessary programs. All of these programs have Mac and Windows versions available.

  1. Install Python.

  2. Install Microsoft Visual Studio Code and open it.

  3. In VSCode, install the Auto Build Marlin extension.

  4. Click the extensions button on the left side of VSCode and type ‘Auto Build Marlin’ and click to install it. Platform.io will also be installed at this time.

  5. Close and reopen VSCode to ensure the extensions you just installed are active.

Open Platform.io

Step 2: Download the latest Marlin source code and configure it

  1. Download Marlin. Most likely, you will want the latest version, which is 2.0.9.3 at this time. Make sure you download the both “Marlin-2.0.x.zip” and “Configurations-release-2.0.x.x.zip”.

  2. After downloading, extract the zip file.

  3. Find the configuration.h and configuration.adv files for your printer.

  4. Copy and paste the files into the .\Marlin folder that is in the Marlin 2.xx folder that you unzipped in the previous step.

  5. When prompted, choose to overwrite the two files that are already there.

Step 3: Set the correct Environment

  1. Click the home symbol on the bottom left of the screen to open Platform.io.

Open Project Platform.io

  1. Click the Open Project button.

  2. Find the unzipped Marlin folder and click Open

  3. Click the Explorer button on the left side, and click the platform.ini menu

  4. Navigate to the Marlin Folder on the left side of the screen.

Find pins.h

  1. Select the Marlin folder. Select pins. Select pins.h

  2. Type control-f and then search for your mainboard manufacturer and find the name of the mainboard on your printer. If you do not know which mainboard is equipped with your printer, reach out to the manufacturer and ask them which mainboard your printer has and which environment you need to use to recompile Marlin. For example, the creality ender 3V2 uses the Creality 4.2.2 mainboard but every printer is different.

Find the environment for your mainboard

  1. Copy the environment corresponding to your board.

  2. Replace the default_envs with the environment you found in the previous step.

Step 4: Enable HOST_ACTION_COMMANDS and M600

  1. Click the home symbol on the bottom left of the screen to open Platform.io.

Open Project Platform.io

  1. Click the Open Project button.

  2. Find the unzipped Marlin folder and click Open

  3. Click the Explorer button on the left side and edit the configuration_adv file in the Marlin folder.

  4. To enable the M600 command, type control-f on your keyboard, and search for M600 to find where it is listed in the file.

  5. Delete the two / symbols in front of #define ADVANCED_PAUSE_FEATURE

Enable M600

  1. To enable Host Action Commands Type control-f again and search for host action command. Scroll down until you see Host Action Commands

  2. Delete the / symbol in front of #define HOST_ACTION_COMMANDS

Host Action Commands

  1. Save the file

Step 5: Compile the firmware

  1. Hover over the build section on the top left side of the screen and you will see a hammer icon. Click this icon and click Build on the right to start building the firmware.
note

Be patient, compiling the firmware can take as long as ten minutes.

  1. At the end of the terminal, you should see a list of boards, with most of them saying Ignored, and your board listed as Success.

Step 6: Flash the new firmware

  1. Go to the folder where you extracted Marlin, and under, ..pio\build\TheNameOfYourBoard. You should see a firmware.bin file. This is the file you will flash to your 3D printer.

  2. As flashing the actual firmware varies from printer to printer, we will not cover this process, but google searching “How to flash [your printer’s name] firmware” should yield plenty of applicable tutorials.