This article describes how to create, build and debug a Linux® user space application for STM32 MPU, using the standard Eclipse® CDT™ wizard.
Create a "user space" project[edit source]
- Open the new C project wizard: File -> New -> Project... C Project.
![New C project wizard New C project wizard](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/5/55/CDTExeCreation.png)
- In the first window, choose OpenSTLinux SDK
![New C project wizard New C project wizard](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/2/27/CDTExeCreationCProject.png)
- Then Next to set up configuration
![New C project wizard New C project wizard](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/e/e8/CDTExeCreationCProjectNext.png)
- and Next to choose the SDK version
![New C project wizard New C project wizard](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/7/72/CDTExeCreationCProjectNextNext.png)
- 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.
1. Build[edit source]
- Select your project, right-click and then Build Project.
![C project build C project build](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/3/34/CDTExeBuild.png)
2. Prepare Debug Configuration[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](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/0/0b/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 Target Status - green](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/2/2b/CubeIDE-UserSpace-Debug1.png)
Check How to set up proxy and P2P Ethernet connection with STM32CubeIDE if you have some proxy problem.
3. Set Debug Configuration[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 C Project debug](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/4/4d/CDTExeDebugCfg.png)
4. Debug[edit source]
Click on Debug:
- Executable is downloaded to the target,
- GDBServer is launched on the target,
- GDBClient is launched on the workstation and can exchange via network with GDBServer.
![C project debug C project debug](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/3/34/CDTExeDebug.png)