Utilizing the Build Analyzer in STM32CubeIDE

ST’s latest tool, STM32CubeIDE, is an Eclipse based IDE which provides an all-in-one development experience by integrating their previous TrueSTUDIO IDE with the STM32CubeMX code configurator. Among its many features are build and stack analyzers which help the developer keep an eye on memory consumption. These are very useful and provide vital information, but unfortunately are are not entirely straightforward to use.

I started by importing my project into STM32CubeIDE and building it. It built successfully, as shown below. Notice that the build output provides code size information, though not in a human-readable format. This is where the Build Analyzer comes in handy.

Unfortunately, after building the project, the Build Analyzer (the Memory Regions tab in particular) is not automatically populated with any code size information.

To get this information, we have to select the <project_name>.map file in the Debug folder. In the Project Explorer, expand the Debug folder and single-click on the .map file. If this file is not present, right-click on the Debug folder and chose Refresh.


The Memory Regions tab should now be populated with memory usage statistics for the FLASH and RAM regions. Most useful is the Usage (%) column which visually shows how much memory is being consumed.