How to debug a user space application with STM32CubeIDE

Revision as of 18:24, 23 November 2020 by Registered User

This article provides guidelines to setup environment for developing and debugging User Space application within STM32CubeIDE version 1.4 or 1.5.

1. Prerequisites[edit source]

Minimum hardware:

  • STM32MP15x-based board
  • Linux console
  • Ethernet (or Ethernet over USB) for connection to Linux CA7

Minimum software:

  • STM32CubeIDE 1.4.2 installed
    • STM32MP15 project created
    • Yocto SDk installed thanks to "Setup OpenSTLinux" CA7 contextual menu

2. Create User Space project[edit source]

Open new C Project wizard: File -> New -> Project... C Project.
In first window choose OpenSTLinux SDK

then Next and Advanced settings...

Purpose is to setup SDKPATH variable: Project Properties > C/C++ Build > Environment > Edi variable > Variables
Here the SDK is Embedded inside STM32CubeIDE, toolchain is located under .../plugins/com.st.openstlinux.sdk.openstlinux_5.4_dunfell_mp1_20_06_24_5.4.0.202007020712/tools/

Populate this project with main.c file: select project, right click: New -> File -> main.c Fill it with some C code:

void main() { int i;

for (i=0;i<10;i++); i++; i++; i++;

return 33; }