Request to add STM32F072VB target

We’re developing a couple of boards based on the STM32F072RB. We would like to use mbed-os for this work.

However, we chose to use a different dev board than the (mbed-supported) Nucleo F072RB because the Nucleo doesn’t provide a USB device connector.

STMicro has an eval board called the STM32072B-EVAL that uses the STM32F072VB MCU and provides a USB device connector. We’re using this board for development instead of the NUCLEO_F072RB because we need the USB device capability. This board has a STLINK-V2 debug port that is usable with pyocd (if you add --target STM32F051)

The STM32F072VB MCU is the 100-pin package version of the 64-pin STM32F072RB that is used in the existing NUCLEO_F072RB target. Other than the available pins, these processors are identical.

The NUCLEO_F072RB board doesn’t provide a USB device connector, although it has a USB PHY and controller. I assume that this is why the Nucleo board doesn’t define USB_DEVICE.

I would like to add a TARGET_STM32F072xB directory above TARGET_NUCLEO_F072RB and a TARGET_STM32F072VB directory parallel to the TARGET_NUCLEO_F072RB directory.

The resultant structure would look like this:

mbed-os/targets/TARGET_STM
├── TARGET_STM32F0
│   ├── device
│   │   ├── stm32f0xx_hal_*
│   │   ├── stm32f0xx_ll_*
│   │   ├── stm32_hal_legacy.h
│   │   └── system_stm32f0xx.c
│   ├── TARGET_STM32F072xB
│   │   ├── device
│   │   │   ├── TOOLCHAIN_ARM_MICRO
│   │   │   │   ├── startup_stm32f072xb.S
│   │   │   │   └── stm32f072rb.sct
│   │   │   ├── TOOLCHAIN_ARM_STD
│   │   │   │   ├── startup_stm32f072xb.S
│   │   │   │   └── stm32f072rb.sct
│   │   │   ├── TOOLCHAIN_GCC_ARM
│   │   │   │   ├── startup_stm32f072xb.S
│   │   │   │   └── STM32F072XB.ld
│   │   │   ├── TOOLCHAIN_IAR
│   │   │   │   ├── startup_stm32f072xb.S
│   │   │   │   └── stm32f072xb.icf
│   │   │   ├── cmsis_nvic.c
│   │   │   ├── cmsis_nvic.h
│   │   │   ├── stm32f072xb.h
│   │   │   ├── stm32f0xx.h
│   │   │   ├── system_clock.c
│   │   │   ├── system_stm32f0xx.h
│   │   │   └── us_ticker_data.h
│   │   ├── TARGET_NUCLEO_F072RB
│   │   │   ├── PeripheralNames.h
│   │   │   ├── PeripheralPins.c
│   │   │   └── PinNames.h
│   │   ├── TARGET_STM32F072VB
│   │   │   ├── PeripheralNames.h
│   │   │   ├── PeripheralPins.c
│   │   │   └── PinNames.h
│   │   └── objects.h
│   └── <files>
├── <files>
├── USBEndpoints_STM32.h
├── USBPhyHw.h
└── USBPhy_STM32.cpp

Alternatively, the TARGET_STM32F072VB directory could be called TARGET_STM32072B_EVAL and its pin definitions could reflect the usage on the STM32072B-EVAL board.

I would be willing to do this work and submit a PR, but don’t know whether this is something that the mbed team would be willing to merge.

I also don’t know what impact this would have on tests; there are existing USB device tests but I don’t know whether additional work would be needed for this new target.

@bikeNomad you may want to review the instructions published by ST on how to create a new platform:
https://os.mbed.com/teams/ST/wiki/steps-to-create-a-new-STM32-platform

FYI @LMESTM @jeromecoutant

Alternatively, if you want to create a configuration for a custom platform, you may want to review the docs (to be published in Introduction - Introduction to Mbed OS 6 | Mbed OS 6 Documentation in 5.15 soon):
mbed-os-5-docs/custom-target-porting.md at development · ARMmbed/mbed-os-5-docs · GitHub

Hello
As answered by Marcelo we fully support contributions of new targets, please feel free to submit a new PR that will be reviewed before merge.
Thanks for contributing !
Laurent