SystemWorkbench Logo

SystemWorkbench for STM32

Import CubeMX generated Projects

Generate and import the CubeMX project

Since version 4.7.0, STM32CubeMX has been generating projects for SystemWorkbench for STM32. There are several ways to import these STM32CubeMX generated projects into SystemWorkbench.

Import Projects - New fashion

Import Projects - Classic trend

  1. Create a working directory (myworkspace for example). It will be the common directory between SystemWorkbench and STM32CubeMX.
  2. On STM32CubeMX, go in the settings, Project > Settings ... then enter a Project Name (such as myproject). Change the Project Location into the location of the previous working directory. The Toolchain Folder Location should be myworkspace\myproject. Reminder : select SW4STM32 as the Toolchain / IDE before generating the code.
    CubeMX Settings
  3. Open SystemWorkbench for STM32 using myworkspace as workspace. The project explorer should not contain the STM32CubeMX generated code as project.
    Workspace selection
  4. Import the STM32CubeMX generated project as following

Rename the generated files (prior to CubeMX-4.13.0)

While using old CubeMX versions (up to 4.12), blank spaces could have been inserted in the project name. The user can rename it with the following steps:

  1. Right click on project and select Properties
  2. Go to C/C++ Build > Settings > Build Artifact
  3. Suppress Configuration from the artifact name (or give it a more significant name)
    Rename project


Do not rename a project from the Project Explorer
The linked resources pointing to project-relative paths can be broken while renaming a project from the Project Explorer.

Setting up a project for debug

A project must be successfully compiled before launching a debug session.

While using CubeMX-4.7.0 or while using CubeMX-4.8.0 without any selected evaluation board, then the generated project does not include a board description with full debug connection information: the debug probe and debug link information could be missing.

In such cases, the user has to launch the debug by a right-click on the project and select Debug as > Ac6 STM32 C/C++ Application..., then update the following dialog with the debugging characteristics of the board:

Define a board

The user can then either select an existing board or create a new one.

The user can also create a debug configuration and provide the debug configuration manually:

  1. Debug As > Debug Configurations...
  2. Create an new Ac6 STM32 Debugging configuration
  3. Choose the project and executable (if needed)
  4. Select the Debugger tab
  5. If a NO SCRIPT FOUND message is displayed, select the Manual spec radio button and provide the debug configuration by:
  6. Then launch the debugger
    Debug Configuration


Another solution is to create a debug configuration then select the appropriate debug script manually by

  1. Debug As > Debug Configurations...
  2. Create an new Ac6 STM32 Debugging configuration
  3. Choose the project and executable (if needed)
  4. Select the Debugger tab
  5. If a NO SCRIPT FOUND message is displayed, select the Use local script radio button. Provide a debug script by one of these three means:
    1. Browse to the SystemWorkbench install directory, then check for the board script in the plugins\fr.ac6.mcu.debug_LATEST_VERSION\resources\openocd\scripts\board folder (the user may find also some st-specific scripts in st_board). This is usually the way to use for a standard ST board (eval, disco or nucleo)
    2. Manually search for a similar board in the directory above then manually copy it to the project main directory, then browse to it and select it.This is usually a good way to go for a custom board that is very close to an ST board (often an EVAL board), including the same debug interface
    3. Get a custom board debug script created when creating a project using a custom board (may be a no-firmware project with an empty main program). Copy the SystemWorkbench-generated debug script in the project and browse to it. This is usually convenient if the user defines his own board, create a custom board in a SystemWorkbench-generated test project and want to reuse it in his STM32CubeMX-generated project. For more information, refer to the following chapter Creating a custom board.
  6. Once the configuration is done, the user can launch it by using the Debug As... button in the top toolbar (or use the small arrow on its right to see the last valid debug configurations used).

In all cases the user will find a debug script in his project directory; for some complex boards, the user may have to edit it or re-create it like in the last solution above.

Creating a custom board

If the user has designed his own board based on a STM32 chip, SystemWorkbench for STM32 offers a way to create a custom board definition.

Create Custom Board


To create a new board, click on Create a new custom board on the new project wizard third screen instead of selecting an existing board. A new window is then displayed.

The user can import new boards from existing board definitions (xml format) or create a new board. While creating a project with a custom board, the definition file (*.xml) and the OpenOCD script (*.cfg) are generated into the project directory. Share these files to export the board into another workstation. The generated OpenOCD script can be edited to match with the specificities of the custom board.

From definition file

  1. Select Import from definition file to import a new board
  2. Select the new board definition file and the OpenOCD script. If the board definition is valid, the field below are filled
    Create Custom Board

Define Custom board

  1. Select Define new board to create your new board
  2. Enter the new board name (special characters and underscore are forbidden)
  3. Select the STM32 chip serie
  4. Select the MCU used on the custom board
  5. Select the debug device and interface
    Create Custom Board


For more information about C/C++ development tools in Eclipse, please see C/C++ Development User Guide.