This article explains how to create, build and debug a Linux® user space application for STM32 MPU.
1. Create a user space executable project[edit source]
In the Cortex®-A7 sub-project context, named here MP157C-DK2_CA7, right-click and select Create a userspace Project...
![User space project wizard shortcut User space project wizard shortcut](/stm32mpu/nsfr_img_auth.php/8/8d/UserSpaceShortCut.png)
In the example, an executable project type in C language is selected.
Note that the user space project uses by default the SDK version associated to Cortex®-A7 sub-project.
![User space project creation wizard User space project creation wizard](/stm32mpu/nsfr_img_auth.php/d/dd/UserSpaceProjectCreationWizard.png)
2. Build[edit source]
- Select your project, right-click and then Build Project.
![Executable Build Executable Build](/stm32mpu/nsfr_img_auth.php/f/f5/UserSpaceExeBuild.png)
3. 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/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/nsfr_img_auth.php/2/2b/CubeIDE-UserSpace-Debug1.png)
Check also How to set up proxy and P2P Ethernet connection with STM32CubeIDE if you have some proxy problem.
4. Set Debug Configuration[edit source]
- Select your project, right-click Debug as... > Debug Configurations,
- select STM32 Cortex-A Remote Application.
![Debug configuration shortcut Debug configuration shortcut](/stm32mpu/nsfr_img_auth.php/2/27/CubeIDEUserSpaceDebugShortCut.png)
The default connection proposed is "MPU SSH", corresponding to the target IP address discovered by Target Status. The default destination directory is /home/root.
![User space debug configuration - main tab User space debug configuration - main tab](/stm32mpu/nsfr_img_auth.php/e/ed/CubeIDEUserSpaceDebugMainTab.png)
5. Debug[edit source]
Click Debug :
- Executable is downloaded to the target,
- GDBServer is launched on the target,
- GDBClient is launched on the workstation and can exchange via the network with GDBServer.
![User space debug User space debug](/stm32mpu/nsfr_img_auth.php/4/4e/CubeIDEUserSpaceExeDebugLaunch.png)