STM32CubeIDE:Tips&Tricks

This page is your go-to destination for quick and practical advice across various Tips and Tricks related to STM32CubeIDE.

1. STM32CubeIDE Tips & Tricks

1.1. Authentication issue

If you have encountered an authentication problem while using STM32CubeIDE, do not worry. You simply need to set your connection parameters.

For more details see this link: https://community.st.com/t5/stm32-mcus/how-to-set-the-network-connection-parameters-for-stm32cubeide/ta-p/585694

1.2. Perspectives

1.2.1. Reset perspectives

The user can reset the perspective back to the default configuration using the menu Window > Perspective > Reset Perspective…

Reset perspective


1.2.2. Customize perspectives

The user can customize the perspectives using the menu Window > Perspective > Customize Perspective… and choosing which toolbars and menus visibilities and action set and shortcuts availabilities.

Customize perspective


1.2.3. Create an own perspective

The user can create a customized perspective after selecting or moving some views and using the menu Window > Perspective > Save Perspective As…, and then choosing a name to save it.

Save perspective


1.3. Quick access to views, menus, preferences

A quick-access menu is available to search for views, menus, and preferences by clicking on the magnifying glass at the top right and type the name of the view on the dialog.

Quick Access


1.4. Key bindings

Select the menu Window > Preferences then select the category General > Keys

Choose between three different key binding schemes: Eclipse®, GNU Emacs, Microsoft Visual Studio®.

Use the search filter to find a command and learn or configure its specific key binding.

For example, use Ctrl+B to Build All:

Quick Access


1.5. Shortcuts

1.5.1. Shortcuts to debug

Use shortcuts to run, debug and control code execution.

  • CTRL+F11 to run the last application launched.
  • F11 to debug the last application launched.
  • F5 to step into.
  • F6 to step over, i.e. go to next line.
  • F7 to step return to caller.
  • F8 to resume until next breakpoint.
1.5.2. Shortcuts to code

Use shortcuts to code.

  • CTRL+SPACE to auto complete.
  • CTRL+H to search workspace resources with useful filters.
  • ALT+SHIFT+A to select blocks. It is very useful to modify several lines at a time. For example, change all selected vars from uint32_t to uint16_t.
  • CTRL+O to open the quick outline. Useful for content navigation in file.
  • CTRL+SHIFT+R to open resources.
  • CTRL+SHIFT+T to open elements.

1.6. Dark theme

The dark theme is a very popular preference. A restart is needed for the theme change to come into effect. Select the menu Window > Preferences then select the category General > Appearance and turn the theme to dark.

Quick Access


1.7. Workspace path

STM32CubeIDE is always launched inside a workspace. A workspace contains projects. It is easy to open a file explorer inside the workspace folder. Select a project inside the Project Explorer, click right to open the menu and then select Properties.

Quick Access


1.8. Link with editor

To know where a file is located, activate the link with editor feature. By default, this feature is toggled off. The link with editor feature is very convenient to find a file inside a large folder hierarchy. It is recommended to toggle it on only when needed.

Link with Editor


1.9. Task tags

Define your own task tags to keep track of your selections. Select the menu Window > Preferences then select the category C/C++ > Task Tags and click on the New button. Enter a tag name and a priority (High/Normal/Low). Tags may contain any character string.

Quick Access


Add several tags into the code. Open the Tasks view: Window > Show views > Tasks to have access and to navigate it your list of tags.

Quick Access


1.10. Code templates

To simplify and standardize the source files, the usage of code templates is very useful. Select the menu File > New > Source File and select the template or configure a new default template or modify an existing one by clicking on Configure….

Quick Access


1.11. Include browser

Open the Include Browser view with the menu Window > Show View > Include Browser to visualize the include dependencies between files. Drag and drop a file into the view.

Quick Access


1.12. Eclipse Marketplace

The Eclipse Marketplace is an interface for browsing and installing some additional tools or features. Open the menu Help > Eclipse Marketplace. Search for a keyword. For example, enter egit for the related solutions available in the marketplace.

Quick Access


1.13. Cyclic redundancy check - An error detection method

Cyclic redundancy check (CRC) is an error detection method used for digital data, which is based on binary division.
The CRC algorithm generates a fixed checksum code length. The CRC algorithm generates a fixed-length checksum code.
The post referenced below describes how to implement the CRC mechanism in your project:
CRC computation in STM32 MCUs and post-build creation

The following GitHub repository contains an example of how to generate the CRC for your projects:
ethanhuanginst/STM32CubeIDE-Workshop-2019 GitHub

1.14. Project migration from IAR Embedded Workbench® for Arm or Keil® MDK-ARM to STM32CubeIDE

Create an empty project in STM32CubeIDE based on the same MCU as the EWARM or MDK-ARM project.

Quick Access

The empty project contains the basic necessary items to make the MCU work:

  • Startup file
  • Linker file

Manually import the source files from the original project by dragging and dropping them into the STM32CubeIDE workspace. During this operation, a pop-up message appears. Select the adequate option for your application:

  • “Copy files”: This creates a copy of the file under the project folder
  • “Link to files”: This creates a link between the STM32CubeIDE project in the workspace and the original project folder
Quick Access


Set the “Include paths” from the STM32CubeIDE settings:

  • Option 1: Right-click on the folder inside the workspace and select Add/remove include path...
Quick Access
  • Option 2: Under Properties>C/C++ Build>Settings>MCU/MPU GCC Compiler>Include paths, add the include files folder.
Quick Access

The remaining options (such as compilation and linker) are described in the STM32CubeIDE user guide.

At the end, the user obtains an STM32CubeIDE project.