STM32Cube target framework

Trying to set up a simple project for the NUCLEO-F413AH board with Platformio and Deviot plugin for sublime text. I’m wanting to use the STM32Cube framework, which https://docs.platformio.org/en/latest/boards/ststm32/nucleo_f413zh.html indicates would be supported. I change the “framework” setting in the platformio.ini file for my project to “STM32Cube” and when I build I get

Processing nucleo_f413zh (platform: ststm32; board: nucleo_f413zh; framework: STM32Cube)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
Error: This board doesn’t support STM32Cube framework!
PLATFORM: ST STM32 (14.1.0) > ST Nucleo F413ZH
HARDWARE: STM32F413ZHT6 100MHz, 128KB RAM, 512KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:

  • toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)

i’ve built the basic project code from STM32CubeMX for the appropriate target board.

Any suggestions?

I’m not certain what I did, but now I’m fine. I did start by creating a new project in CubeMX and generating code into a new directory. After, I created the platformio project and symbolically linked the project root include and src directories to the Core/Inc and Core/Src directories that CubeMX created. Now I can compile, but I’m having issues uploading.
I’m using the Tools->build with-> PlatformIO:Upload and it is failing with

Processing debug (platform: ststm32; board: nucleo_f413zh; framework: stm32cube)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: httpzz://docs.platformio.org/page/boards/ststm32/nucleo_f413zh.html
PLATFORM: ST STM32 (14.1.0) > ST Nucleo F413ZH
HARDWARE: STM32F413ZHT6 100MHz, 128KB RAM, 512KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:

  • framework-stm32cubef4 1.25.2
  • tool-dfuutil 1.9.200310
  • tool-ldscripts-ststm32 0.1.0
  • tool-openocd 2.1100.0 (11.0)
  • tool-stm32duino 1.0.1
  • toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
    LDF: Library Dependency Finder → httpzz://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 48 compatible libraries
    Scanning dependencies…
    No dependencies
    Building in debug mode
    Checking size .pio/build/debug/firmware.elf
    Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
    RAM: [ ] 0.9% (used 1140 bytes from 131072 bytes)
    Flash: [ ] 1.4% (used 7108 bytes from 524288 bytes)
    Configuring upload protocol…
    AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, stlink
    CURRENT: upload_protocol = stlink
    Uploading .pio/build/debug/firmware.elf
    xPack OpenOCD, x86_64 Open On-Chip Debugger 0.11.0-00155-ge392e485e (2021-03-15-18:44)
    Licensed under GNU GPL v2
    For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
    debug_level: 1

srst_only separate srst_nogate srst_open_drain connect_deassert_srst

Error: open failed
in procedure ‘program’
** OpenOCD init failed **
shutdown command invoked

Any suggestions would be appreciated

AH or ZH?

Either OpenOCD can’t find the ST-Link adapter (because of no drivers installed e.g., or you did not install the udev rules on Linux) or the on-board ST-Link isn’t connected properly to the microcontroller (there are certain jumpers on the board, explained in the Nucleo User manual, that need to be closed).

Does it work when you download and use STM32CubeProg to connect to the chip?

I just figured it out. I added upload_port to the platformio.ini file and it uploads fine now.