User space CDT project

Applicable for STM32MP13x lines, STM32MP15x lines, STM32MP23x lines, STM32MP25x lines

This article describes how to create, build and debug a Linux® user space application for STM32 MPU, using the standard Eclipse® CDT™ wizard.

Warning DB.png Important
This article is based onto STM32MP15x lines More info.png but it is also applicable to any STM32 MPU device.

BackToNavigationTree button.png

1. Create a "user space" project[edit | edit source]

  • Open the new C project wizard: File -> New -> Project... C Project.
New C project wizard


  • In the first window, choose OpenSTLinux SDK
New C project wizard


  • Then Next to set up configuration
New C project wizard


  • and Next to choose the SDK version
New C project wizard


  • To populate this project with file "main.c", first select project, then right-click New -> File -> main.c, and then fill it with some C code.

2. Build[edit | edit source]

  • Select your project, right-click and then Build Project.
C project build


3. Prepare Debug Configuration[edit | edit source]

You can check boot messages via Linux® console opened with butterfly icon (shown below), but remember this console cannot be shared outside STM32CubeIDE (minicom,...).

CubeIDELinuxConsole.png


In order to debug user space application, your target must be Linux® booted and network connected.

To check network connection, start the Target Status widget in the bottom right corner of the window.

Target Status - green


Check How to set up proxy and P2P Ethernet connection with STM32CubeIDE if you have some proxy problem.


4. Set Debug Configuration[edit | edit source]

  • Select your project, right-click Debug as... > Debug Configurations.
  • Then create an STM32 Cortex-A Remote Application debug configuration, and double-click on it.
C Project debug


64-bit SDK set-up

Warning white.png Warning
For STM32MP23x lines More info.png and STM32MP25x lines More info.png absolute path to 64-bit SDK (MP2) GDB client is needed.

/local/home/<username>/SDK_6.0.0_mp2/sysroots/x86_64-ostl_sdk-linux/usr/bin/aarch64-ostl-linux/aarch64-ostl-linux-gdb

User space debug configuration - main tab Debugger


5. Debug[edit | edit source]

Click on Debug:

  1. Executable is downloaded to the target,
  2. GDBServer is launched on the target,
  3. GDBClient is launched on the workstation and can exchange via network with GDBServer.
C project debug
Info white.png Information
In case of error; check if GDBServer is still running on the target.



BackToNavigationTree button.png