PlatformIO Community

Mbed: Failed to extract configuration for custom board (STM32H743IITx)

I try to create custom board for STM32H743IIT MCU.
I used this guide: https://os.mbed.com/teams/ST/wiki/steps-to-create-a-new-STM32-platform
So i create folder C:\Users\Username\.platformio\packages\framework-mbed\targets\TARGET_STM\TARGET_STM32H7\TARGET_STM32H743xI\TARGET_STM32H743IITx and put there three files:

  • PeripheralPins.c
  • PinNames.h
  • system_clock.c

Then i added board into this file: C:\Users\Username\.platformio\packages\framework-mbed\targets\targets.json

targets.json
"STM32H743IITx": {
    "inherits": [
        "MCU_STM32"
    ],
    "core": "Cortex-M7FD",
    "mbed_rom_start": "0x08000000",
    "mbed_rom_size": "0x200000",
    "mbed_ram_start": "0x24000000",
    "mbed_ram_size": "0x80000",
    "extra_labels_add": [
        "STM32H7",
        "STM32H743xI"
    ],
    "config": {
        "d11_configuration": {
            "help": "Value: PB_5 for the default board configuration, PA_7 in case of solder bridge update (SB33 on/ SB35 off)",
            "value": "PB_5",
            "macro_name": "STM32_D11_SPI_ETHERNET_PIN"
        },
        "clock_source": {
            "help": "Mask value : USE_PLL_HSE_EXTC | USE_PLL_HSE_XTAL (need HW patch) | USE_PLL_HSI",
            "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
            "macro_name": "CLOCK_SOURCE"
        },
        "lpticker_lptim": {
            "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
            "value": 1
        },
        "hse_value": {
            "help": "HSE default value is 25MHz in HAL",
            "value": "8000000",
            "macro_name": "HSE_VALUE"
        }
    },
    "components_add": [
        "FLASHIAP"
    ],
    "macros_add": [
        "STM32H743xx",
        "EXTRA_IDLE_STACK_REQUIRED",
        "MBED_TICKLESS"
    ],
    "overrides": {
        "lpticker_delay_ticks": 0,
        "network-default-interface-type": "ETHERNET"
    },
    "supported_form_factors": [
        "ARDUINO"
    ],
    "detect_code": [
        "0836"
    ],
    "device_has_add": [
        "ANALOGOUT",
        "CAN",
        "CRC",
        "TRNG",
        "FLASH",
        "MPU",
        "EMAC"
    ],
    "device_name": "STM32H743II",
    "bootloader_supported": true
},

I added stm32h743iitx.json file into C:\Users\Username.platformio\platforms\ststm32\boards

stm32h743iitx.json
{
  "build": {
    "core": "stm32",
    "cpu": "cortex-m7",
    "extra_flags": "-DSTM32H7xx -DSTM32H743xx",
    "f_cpu": "480000000L",
    "mcu": "stm32h743iit",
    "product_line": "STM32H743xx",
    "variant": "MCU_H743II"
  },
  "connectivity": [
    "can",
    "ethernet"
  ],
  "debug": {
    "default_tools": [
      "stlink"
     ],
    "jlink_device": "STM32H743II",
    "onboard_tools": [
      "stlink"
    ],
    "openocd_board": "st_nucleo_h743zi",
    "svd_path": "STM32H7x3.svd"
  },
  "frameworks": [
    "cmsis",
    "stm32cube",
    "mbed",
    "zephyr"
  ],
  "name": "MCU H743IITx",
  "upload": {
    "maximum_ram_size": 524288,
    "maximum_size": 2097152,
    "protocol": "stlink",
    "protocols": [
      "jlink",
      "stlink",
      "blackmagic",
      "mbed"
    ]
  },
  "vendor": "ST"
}

And when i try to build my project i get an error:

Processing stm32h743iitx (platform: ststm32; framework: mbed; board: stm32h743iitx)
----------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/stm32h743iitx.html
PLATFORM: ST STM32 (8.1.0) > MCU H743IITx
HARDWARE: STM32H743IIT 480MHz, 512KB RAM, 2MB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, jlink)
PACKAGES:
 - framework-mbed 6.60200.200722 (6.2.0)
 - toolchain-gccarmnoneeabi 1.90201.191206 (9.2.1)
Collecting mbed sources...
Failed to extract configuration for STM32H743IITX.
It might not be supported in the this Mbed release.

UPD: i made the same for Mbed Studio and it all works there. But i want to use platformio.

That’s unusual. Have you tried putting them into the project folder? The documentation and project at

will help you very much I think. Try layouting your project after that.

Also that might be a sign that the C:\Users\<user>\.platformio\packages\framework-mbed\platformio\variants_remap.json needs a new entry that maps your board name stm32h743iitx to its mbed-os variant name. I’m not sure anymore on whether that is necessary if you name the folders / variant a certain way, definitely try the example project first.

Yeah, I tried.
Project structure was like this:

project_dir
├── include
├── boards
│⠀⠀⠀└── stm32h743ii.json
├── src
│⠀⠀⠀├── main.cpp
│⠀⠀⠀└── TARGET_STM32H743xI
│⠀⠀⠀⠀⠀⠀⠀⠀⠀├── device
│⠀⠀⠀⠀⠀⠀⠀⠀⠀│⠀⠀⠀⠀⠀├──TOOLCHAIN_GCC_ARM
│⠀⠀⠀⠀⠀⠀⠀⠀⠀│⠀⠀⠀⠀⠀├──cmsis_nvic.h
│⠀⠀⠀⠀⠀⠀⠀⠀⠀│⠀⠀⠀⠀⠀├──stm32h743xx.h
│⠀⠀⠀⠀⠀⠀⠀⠀⠀│⠀⠀⠀⠀⠀└──us_ticker_data.h
│⠀⠀⠀⠀⠀⠀⠀⠀⠀├── TARGET_STM32H743II
│⠀⠀⠀⠀⠀⠀⠀⠀⠀│⠀⠀⠀⠀⠀├──PeripheralNames.h
│⠀⠀⠀⠀⠀⠀⠀⠀⠀│⠀⠀⠀⠀⠀├──PeripheralPins.c
│⠀⠀⠀⠀⠀⠀⠀⠀⠀│⠀⠀⠀⠀⠀├──PinNames.h
│⠀⠀⠀⠀⠀⠀⠀⠀⠀│⠀⠀⠀⠀⠀└──system_clock.c
│⠀⠀⠀⠀⠀⠀⠀⠀⠀└── objects.h
├── custom_targets.json
└── platformio.ini
stm32h743ii.json
{
    "build": {
      "core": "stm32",
      "cpu": "cortex-m7",
      "extra_flags": "-DSTM32H7xx -DSTM32H743xx",
      "f_cpu": "480000000L",
      "mcu": "stm32h743iit6",
      "product_line": "STM32H743xx",
      "variant": "MCU_H743II"
    },
    "connectivity": [
      "can",
      "ethernet"
    ],
    "debug": {
      "default_tools": [
        "stlink"
      ],
      "jlink_device": "STM32H743II",
      "onboard_tools": [
        "stlink"
      ],
      "openocd_board": "st_nucleo_h743zi",
      "svd_path": "STM32H7x3.svd"
    },
    "frameworks": [
      "cmsis",
      "stm32cube",
      "mbed",
      "zephyr"
    ],
    "name": "MCU H743IITx",
    "upload": {
      "maximum_ram_size": 524288,
      "maximum_size": 2097152,
      "protocol": "stlink",
      "protocols": [
        "jlink",
        "stlink",
        "blackmagic",
        "mbed"
      ]
    },
    "url": "https://www.st.com/en/evaluation-tools/nucleo-h743zi.html",
    "vendor": "ST"
  }
custom_target.json
{
"STM32H743II": {
    "inherits": [
        "MCU_STM32"
    ],
    "core": "Cortex-M7FD",
    "mbed_rom_start": "0x08000000",
    "mbed_rom_size": "0x200000",
    "mbed_ram_start": "0x24000000",
    "mbed_ram_size": "0x80000",
    "extra_labels_add": [
        "STM32H7",
        "STM32H743xI"
    ],
    "config": {
        "d11_configuration": {
            "help": "Value: PB_5 for the default board configuration, PA_7 in case of solder bridge update (SB33 on/ SB35 off)",
            "value": "PB_5",
            "macro_name": "STM32_D11_SPI_ETHERNET_PIN"
        },
        "clock_source": {
            "help": "Mask value : USE_PLL_HSE_EXTC | USE_PLL_HSE_XTAL (need HW patch) | USE_PLL_HSI",
            "value": "USE_PLL_HSE_EXTC|USE_PLL_HSI",
            "macro_name": "CLOCK_SOURCE"
        },
        "lpticker_lptim": {
            "help": "This target supports LPTIM. Set value 1 to use LPTIM for LPTICKER, or 0 to use RTC wakeup timer",
            "value": 1
        },
        "hse_value": {
            "help": "HSE default value is 25MHz in HAL",
            "value": "8000000",
            "macro_name": "HSE_VALUE"
        }
    },
    "components_add": [
        "FLASHIAP"
    ],
    "macros_add": [
        "STM32H743xx",
        "EXTRA_IDLE_STACK_REQUIRED",
        "MBED_TICKLESS"
    ],
    "overrides": {
        "lpticker_delay_ticks": 0,
        "network-default-interface-type": "ETHERNET"
    },
    "supported_form_factors": [
        "ARDUINO"
    ],
    "detect_code": [
        "0836"
    ],
    "device_has_add": [
        "ANALOGOUT",
        "CAN",
        "CRC",
        "TRNG",
        "FLASH",
        "MPU",
        "EMAC"
    ],
    "device_name": "STM32H743II",
    "bootloader_supported": true
}

}

platformio.ini
[env:stm32h743ii]
platform = ststm32
framework = mbed
board = stm32h743ii
board_build.mbed.ldscript = $PROJECTSRC_DIR/TARGET_STM32H743xI/device/TOOLCHAIN_GCC_ARM/STM32H743zI.ld
build_flags = 
    -I$PROJECTSRC_DIR/TARGET_STM32H743xI
    -I$PROJECTSRC_DIR/TARGET_STM32H743xI/device
    -I$PROJECTSRC_DIR/TARGET_STM32H743xI/TARGET_STM32H743II

And

the same error
Processing stm32h743ii (platform: ststm32; framework: mbed; board: stm32h743ii)
------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/stm32h743ii.html
PLATFORM: ST STM32 (8.1.0) > MCU H743IITx
HARDWARE: STM32H743IIT6 480MHz, 512KB RAM, 2MB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, jlink)
PACKAGES:
 - framework-mbed 6.60200.200722 (6.2.0)
 - toolchain-gccarmnoneeabi 1.90201.191206 (9.2.1)
Collecting mbed sources...
Failed to extract configuration for STM32H743II.
It might not be supported in the this Mbed release.

Also I get error when I try to access PI port which is declarated in PinNames.h.
image
It looks like my custom target ignored.

Well, i’m not sure that mbed-os have support for any 176 pin versions MCU by default.