Target Multiple STM Chips in One project

Sysprogs forums Forums VisualGDB Target Multiple STM Chips in One project

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12704
    dabramson
    Participant

    I have a single set of code that I would like to run on some custom hardware, and on a discovery board. The custom hardware has an STM32F407VE and the discovery board has the STMF407VG. I was think I could single add a configuration to the project and set the chip types differently, but changing the chip type in the vgbdsettings changes it for ALL configurations. Is what I’m looking to do possible? Or do I need two VS projects that both include the same source files and are setup for different chip types in the vgdbsettings?

     

    Ideally, I’d be able to have single project and just switch the configuration in visual studio to change which chip the build will target. For instance a configuration called “Debug-407VE” would build for the custom hardware board and “Debug-407VG” for the discovery board.

    #12709
    support
    Keymaster

    Hi,

    Unfortunately this is not supported out-of-the-box as different devices often include different SDK files (e.g. STM32F4 SDK vs STM32F7 SDK). You could, however, achieve the same effect manually in one of 2 ways:

    • Convert the project to a stand-alone one, then remove MCU-specific macros and include directories from the first page of VisualGDB Project Properties and move them to the per-configuration “MSBuild Settings” page. Then create another configuration and edit the settings there.
    • Create 2 VS projects targeting different devices and a shared project with your actual code. Reference the shared project from both binary projects.
    • Create 2 versions of stm32.props file for both devices and modify the .vcxproj file to explicitly include one of them based on the configuration name (VisualGDB would overwrite the original file if you try changing MCU configuration though).

    Let us know if you need any further details.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.