Can't build Marlin 2.0.7.2 (PlatformIO/VSCode)

Hello! I’m trying to build Marlin firmware for my 3d printer. Downloaded .zip from the official Marlin page, extracted files, opened folder in VSCode/Platformio, in platformio.ini changed default_envs to:

default_envs = chitu_f103

Then I clicked on “Build All” in PlatformIO tab ->Project Tasks → Default → General

Then in the terminal I see this:


Compiling .pio\build\chitu_f103\src\src\HAL\STM32F1\dogm\u8g_com_stm32duino_swspi.cpp.o
Compiling .pio\build\chitu_f103\src\src\HAL\STM32F1\eeprom_bl24cxx.cpp.o
Compiling .pio\build\chitu_f103\src\src\HAL\STM32F1\eeprom_flash.cpp.o
In file included from Marlin\src\HAL\STM32F1../…/inc/…/HAL/HAL.h:26:0,
from Marlin\src\HAL\STM32F1../…/inc/MarlinConfig.h:31,
from Marlin\src\HAL\STM32F1\HAL.cpp:30:
Marlin\src\HAL\STM32F1../…/inc/…/HAL/./STM32F1/HAL.h:85:4: error: #error “SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration.”
#error “SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration.”
^~~~~
In file included from Marlin\src\HAL\STM32F1../…/inc/…/pins/pins.h:78:0,
from Marlin\src\HAL\STM32F1../…/inc/MarlinConfig.h:34,
from Marlin\src\HAL\STM32F1\HAL.cpp:30:
Marlin\src\HAL\STM32F1../…/inc/…/pins/ramps/pins_RAMPS.h:51:4: error: #error “Oops! Set MOTHERBOARD to an STM32F1-based board when building for STM32F1.”
#error “Oops! Set MOTHERBOARD to an STM32F1-based board when building for STM32F1.”
^~~~~
Marlin\src\HAL\STM32F1../…/inc/…/pins/ramps/pins_RAMPS.h:55:4: error: #error “Oops! Select ‘Arduino/Genuino Mega or Mega 2560’ in ‘Tools > Board.’”
#error “Oops! Select ‘Arduino/Genuino Mega or Mega 2560’ in ‘Tools > Board.’”
^~~~~
In file included from Marlin\src\HAL\STM32F1../…/inc/…/HAL/HAL.h:26:0,
from Marlin\src\HAL\STM32F1../…/inc/MarlinConfig.h:31,
from Marlin\src\HAL\STM32F1\HAL_SPI.cpp:32:
Marlin\src\HAL\STM32F1../…/inc/…/HAL/./STM32F1/HAL.h:85:4: error: #error “SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration.”
#error “SERIAL_PORT must be -1 or from 1 to 5. Please update your configuration.”
----etc etc -----

============================================================================================= [FAILED] Took 17.52 seconds =============================================================================================

Environment Status Duration


chitu_f103 FAILED 00:00:17.523
======================================================================================== 1 failed, 0 succeeded in 00:00:17.523

Oh well. Please tell me, what am I doing wrong? Thanks for reading all this!

P.S. I’ve tried the nightly, still without success.

Was that the only thing you changed? What about the configuration header files for your specific 3d printer? (GitHub - MarlinFirmware/Configurations: Configurations for Marlin Firmware plus must be from the same branch as the marlin version).

It looks to me like there’s still the default config files for some AVR based motherboard in there.

1 Like

Oh, thanks for the advice! I’ve tried specifiyng the board in marlin configs, but it didn’t help at all. At last I found the Marlin fork already configured for my specific printer and board, successfully compiled it and flashed to printer. The printer bug (spontaneous disabling of Z stepper while printing) remained, so I reverted to stock firmware and now everything works flawlessly. Thank you nevertrheless!

Printer: TronXY XY-2 Pro
Control Board: Chitu F103 V6