The main information source on how to configure Marlin would be at the Marlin repo and their docs. There are two main parts for this:
- for the
Configuration_adv.h settings, telling Marlin what exact hardware is on which exact pins and how the drivers and behavior is configured
- the PlatformIO part with creating a new environment in the
platformio.ini and building for that board / MCU
For the first part, I’ve already linked the config page, plus Marlin has an excessive example repository for configuration files for the supported 3D printers which you can have a look at.
For the latter part, building a firmware for the STM32F412RG, as I read in your repo, your microcontroller is already supported per
genericSTM32F412RG docs and can run the Arduino STM32 core so it should have no troubles there compiling and running basic Arduino firmwares. You should also test this first on your board, as a simple sanity check with like a simple
platform = ststm32
board = genericSTM32F412RG
framework = arduino
; default upload protocol is "serial",
; if STLink (SWD) is available, use this
upload_protocol = stlink
and blinky code.
(Possible caveat: if the firmware does nothing at all, it’s a possible clock configuration error. the Arduino variant will try to start up the HSE from a quartz-crystal with some default frequency (25MHz or 8MHz I think), and falls back to internal HSI if it fails. If you have a quarz on board, you may need to tell the core what frequency it is in hertz, with
build_flags = -D HSE_VALUE=<value> in the
platformio.ini. HSE is needed for USB functionality.)
You can then go ahead and look at existing STM32F4 environments for Marlin, like
and adapt them regarding the
board and macro values accordingly.
Marlin is quite “pimped out” and uses some
extra_scripts for extended functionality. These scripts might not be needed or may be needed to be adapted. I don’t know the specifics of that specific board and why they would need to do a
generic_create_variant.py here, since the board has a known + supported Arduino variant already… but for those questions, you can look at the code yourself and our docs, or also ask them in an issue at their github page or ask in forums spezialed for Marlin (https://reprap.org/forum/list.php?415). If anything purely PlatformIO specific comes up of course, here is the right place to ask.