This article proposes to address the creation of a simple hello-world application with STM32CubeIDE.
1. Create GtkHelloWorld user space project[edit source]
In context of Cortex-A7 sub-project, MP157C-DK2_CA7 here, right click and select Create a userspace Project..
We select here Executable project type, in C language. Note that our user space project will use by default the SDK version associated to Cortex-A7 sub-project.
2. Update GtkHelloWorld project sources & properties[edit source]
Hereafter we update main.c source code with gtk_hello_world.c as defined in Create a simple hello-world application article.
Proposal in order to reference Gtk library is to use pkg-config command to update compiler & linker flags, just like it is done in Makefile of article Create a simple hello-world application. This properties update is done inside menu GtkHelloWorld properties: C/C++ Build > Settings > Tool Settings.
- main.c update and C flag: `pkg-config --cflags gtk+-3.0`
![GtkHelloWorld project source & properties update GtkHelloWorld project source & properties update](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/0/0d/CubeIDEUserSpaceGtkBuildSetup.png)
- linker flags update: `pkg-config --libs gtk+-3.0`
![GtkHelloWorld project source & properties update GtkHelloWorld project source & properties update](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/6/6c/CubeIDEUserSpaceGtkBuildSetup2.png)
- Now you can build GtKHelloWorld project, right-click on it and then Build Project.
![GtkHelloWorld project source & properties update GtkHelloWorld project source & properties update](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/f/fb/CubeIDEUserSpaceGtkBuild.png)
3. Preparing Debug Configuration[edit source]
Your target must be Linux booted and network connected. Please, start Target Status widget on the bottom right and check for the green light. Remember that Linux console cannot be shared outside STM32CubeIDE: butterfly icon.
Please also check How to set up proxy and P2P Ethernet connection with STM32CubeIDE if you are in that case.
4. Debug Configuration[edit source]
Select your project, right-click Debug as... > Debug Configurations, then select STM32 Cortex-A Remote Application'.
In the main tabulation, the default Connection proposed is "MPU SSH", corresponding to the target IP address discovered by Target Status. The default destination directory is /home/root.
![Debug setup Debug setup](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/f/f3/CubeIDEUserSpaceGtkDebugSetup.png)
5. Debug launch[edit source]
Click Debug :
- GtkHelloWorld is downloaded to the target,
- GDBServer is launched on the target,
- GDBClient is launched on the workstation and can exchange via network with GDBServer,
![GtkHelloWorld debug GtkHelloWorld debug](/stm32mpu-ecosystem-v4/nsfr_img_auth.php/4/41/CubeIDEUserSpaceGtkDebug.png)