Need Help with Creating a Custom Board for STM32F437VI Microcontroller

Hello,

I am new to PlatformIO and I am trying to create a custom board for the STM32F437VI microcontroller. I followed the instructions for creating a custom board Custom Board Instructions and created a project which is linked in this GitHub directory (Project Link).

However, when I try to build the project, I am encountering an error.

  • Executing task in folder 231226-191725-zephyr-blink: C:\Users\asus.platformio\penv\Scripts\platformio.exe run --verbose --environment STM32F437VI

Processing STM32F437VI (platform: ststm32; framework: zephyr; board: stm32f437vi; upload_protocol: stlink)

CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/stm32f437vi.html
PLATFORM: ST STM32 (17.1.0) > STM32F437VI (Custom Board)
HARDWARE: STM32F437VIT6 180MHz, 256KB RAM, 2MB Flash
DEBUG: Current (blackmagic) External (blackmagic, jlink, stlink)
PACKAGES:

  • framework-zephyr @ 2.30500.231204 (3.5.0)
  • tool-cmake @ 3.21.3
  • tool-dtc @ 1.4.7
  • tool-ninja @ 1.9.0
  • toolchain-gccarmnoneeabi @ 1.120301.0 (12.3.1)
    Reading CMake configuration
    – Application: C:/Users/asus/OneDrive/Documents/PlatformIO/Projects/231226-191725-zephyr-blink/zephyr
    – CMake version: 3.21.3
    – Found Python3: C:/Users/asus/.platformio/penv/.zephyr-3.5.0/Scripts/python.exe (found suitable version “3.11.7”, minimum required is “3.8”) found components: Interpreter
    – Cache files will be written to: C:/Users/asus/.platformio/packages/framework-zephyr/.cache
    – Zephyr version: 3.5.0 (C:/Users/asus/.platformio/packages/framework-zephyr), build: zephyr-v30500
    – Board: stm32f437vi
    – Found toolchain: gnuarmemb (C:\Users\asus.platformio\packages\toolchain-gccarmnoneeabi)
    – Found Dtc: C:/Users/asus/.platformio/packages/tool-dtc/dtc.exe (found suitable version “1.4.7”, minimum required is “1.4.6”)
    – Found BOARD.dts: C:/Users/asus/OneDrive/Documents/PlatformIO/Projects/231226-191725-zephyr-blink/zephyr/boards/arm/stm32f437vi/stm32f437vi.dts
    – In: C:/Users/asus/OneDrive/Documents/PlatformIO/Projects/231226-191725-zephyr-blink/.pio/build/STM32F437VI/zephyr, command: C:/Users/asus/.platformio/penv/.zephyr-3.5.0/Scripts/python.exe;C:/Users/asus/.platformio/packages/framework-zephyr/scripts/dts/gen_defines.py;–dts;C:/Users/asus/OneDrive/Documents/PlatformIO/Projects/231226-191725-zephyr-blink/.pio/build/STM32F437VI/zephyr/zephyr.dts.pre;–dtc-flags;‘’;–bindings-dirs;C:/Users/asus/.platformio/packages/framework-zephyr/dts/bindings;–header-out;C:/Users/asus/OneDrive/Documents/PlatformIO/Projects/231226-191725-zephyr-blink/.pio/build/STM32F437VI/zephyr/include/generated/devicetree_generated.h.new;–dts-out;C:/Users/asus/OneDrive/Documents/PlatformIO/Projects/231226-191725-zephyr-blink/.pio/build/STM32F437VI/zephyr/zephyr.dts.new;–edt-pickle-out;C:/Users/asus/OneDrive/Documents/PlatformIO/Projects/231226-191725-zephyr-blink/.pio/build/STM32F437VI/zephyr/edt.pickle;–vendor-prefixes;C:/Users/asus/.platformio/packages/framework-zephyr/dts/bindings/vendor-prefixes.txt
    – Configuring incomplete, errors occurred!

CMake Warning at C:/Users/asus/.platformio/packages/framework-zephyr/cmake/app/boilerplate.cmake:20 (message):
Loading of Zephyr boilerplate.cmake directly is deprecated, please use
‘find_package(Zephyr)’
Call Stack (most recent call first):
CMakeLists.txt:15 (include)

Loading Zephyr default modules (Zephyr base).
CMake Deprecation Warning at C:/Users/asus/.platformio/packages/framework-zephyr/cmake/modules/FindDeprecated.cmake:121 (message):
‘PYTHON_PREFER’ variable is deprecated. Please use Python3_EXECUTABLE
instead.
Call Stack (most recent call first):
C:/Users/asus/.platformio/packages/framework-zephyr/cmake/modules/python.cmake:16 (find_package)
C:/Users/asus/.platformio/packages/framework-zephyr/cmake/modules/zephyr_default.cmake:129 (include)
C:/Users/asus/.platformio/packages/framework-zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
C:/Users/asus/.platformio/packages/framework-zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
C:/Users/asus/.platformio/packages/framework-zephyr/cmake/app/boilerplate.cmake:25 (find_package)
CMakeLists.txt:15 (include)

devicetree error: C:/Users/asus/.platformio/packages/framework-zephyr/dts/arm/st/f4/stm32f405.dtsi:240 (column 22): parse error: expected number or parenthesized expression

CMake Error at C:/Users/asus/.platformio/packages/framework-zephyr/cmake/modules/dts.cmake:279 (message):
gen_defines.py failed with return code: 1
Call Stack (most recent call first):
C:/Users/asus/.platformio/packages/framework-zephyr/cmake/modules/zephyr_default.cmake:129 (include)
C:/Users/asus/.platformio/packages/framework-zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
C:/Users/asus/.platformio/packages/framework-zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
C:/Users/asus/.platformio/packages/framework-zephyr/cmake/app/boilerplate.cmake:25 (find_package)
CMakeLists.txt:15 (include)

================================== [FAILED] Took 3.81 seconds ==================================

Environment Status Duration


nucleo_l432kc IGNORED
STM32F437VI FAILED 00:00:03.813
disco_f407vg IGNORED
============================ 1 failed, 0 succeeded in 00:00:03.813 ============================

It error says that in file stm32f405.dtsi:240 (column 22) there is a parse error: expected number or parenthesized expression. I am not sure what the problem is and how to resolve it. The file is not called directly.

As a beginner, I started making a custom board by copying an ST STM32F469I Discovery board in the PaltformIO Zephyr directory. And modifying some files according to the instructions and my understandings. I am not sure if this is the correct approach or if there are additional steps I need to take.

I created the board json file like this:

{
“build”: {
“core”: “stm32”,
“cpu”: “cortex-m4”,
“extra_flags”: “-DSTM32F437xx -DSTM32F4xx”,
“f_cpu”: “180000000L”,
“mcu”: “stm32f437vit6”,
“product_line”: “STM32F437xx”,
“variant”: “STM32F4xx/F437VI”
},
“debug”: {
“jlink_device”: “STM32F437VI”,
“openocd_target”: “stm32f4x”,
“svd_path”: “STM32F437x.svd”
},
“frameworks”: [
“arduino”,
“cmsis”,
“stm32cube”,
“libopencm3”,
“zephyr”
],
“name”: “STM32F437VI (Custom Board)”,
“upload”: {
“maximum_ram_size”: 262144,
“maximum_size”: 2097152,
“protocol”: “serial”,
“protocols”: [
“blackmagic”,
“dfu”,
“jlink”,
“serial”,
“stlink”
]
},
“url”: “STM32F437VI - High-performance advanced line, Arm Cortex-M4 core with DSP and FPU, 2 Mbytes of Flash memory, 180 MHz CPU, ART Accelerator, Chrom-ART Accelerator, FSMC, HW crypto - STMicroelectronics”,
“vendor”: “Generic”
}

Am I correct in these steps. Could anyone provide some guidance on how to resolve this issue? Why might I be getting this error and what steps should I take to fix it?

Any help would be greatly appreciated!