User space static library project

Revision as of 12:21, 30 May 2021 by Registered User

This article proposes to manage a static library linked with a Linux® user space application for STM32 MPU.

BackToNavigationTree button.png

1. Create a user space static library 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

Here, the Static Library project type, in C language, is selected. Note that the user space project uses by default the SDK version associated to the Cortex®-A7 sub-project.

User space project creation wizard

2. Build[edit source]

  • Select your project, right-click and then Build Project.
Static Library Build


3. Update myExe project sources and properties to use myStaticLib[edit source]

Hereafter is an updated code for main() to call myStaticLib function say_hello().
You must also reference myStaticLib project inside myExe properties: C/C++ General > Paths and Symbols > References as depicted below.

Executable source & properties update

4. Preparing Debug Configuration[edit source]

Your target must be Linux® booted and network connected. Start the Target Status widget in the bottom right corner and check for the green light. Remember that the Linux® console cannot be shared outside STM32CubeIDE: butterfly icon.


Target Status - green


Check also How to set up proxy and P2P Ethernet connection with STM32CubeIDE if you are in that case.

5. Debug Configuration[edit source]

Select your project, right-click Debug as... > Debug Configurations, then select STM32 Cortex-A Remote Application'.

Debug configuration shortcut


The default connection proposed is "MPU SSH", corresponding to the target IP address discovered by the Target Status widget. The default destination directory is /home/root.

User space debug configuration - main tab

6. Debug: stepping into myStaticLib[edit source]

Click 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 the network with GDBServer.
User space static library debug
Info white.png Information
In case of error, stop any GDBServer running on the target before launching a new debug session.


BackToNavigationTree button.png



No categories assignedEdit