Skip to main content
Visitor II
October 26, 2020
Solved

Using STM32CubeIDE for developing linux user space applications

  • October 26, 2020
  • 7 replies
  • 4098 views

We are using the latest STM32CubeIDE (1.4.0) and are trying to develop applications for linux user space on our STM32MP157 board. Our goal is to use the cross compiler toolchain for developing and debugging with the IDE.

When we create a new project, it seems the IDE doesn't create any ready to compile main.cpp files for the A7 processor like for the M4. See this screenshot:0693W0000059HpiQAE.jpg 

For the M4, the project compiles with the template main.c just fine. But for the A7, nothing is there.

So my question is, is there any documentation on how to develop linux user space application with the STM32CubeIDE for the A7?

Thank you.

Best regards,

Kevin

    This topic has been closed for replies.
    Best answer by Olivier GALLIEN

    Hi @EWalt.1​ , @Community member​ , @Ludovic Feltz​ ,

    FYI, as per announced earlier we have published a page in wiki in order to guide whoever want to build and debug a user space application in STM32CubeIDE :

    https://wiki.st.com/stm32mpu/wiki/How_to_debug_a_user_space_application_with_STM32CubeIDE

    Hope it help,

    Olivier

    7 replies

    Visitor II
    November 3, 2020

    Hello @Community member​ 

    Did you find a solution to your issue?

    I'm stuck here too... Just a little bit further, i managed to get OpenSTLinux source generated.

    1) Right click CA7 project, then click Setup OpenSTLinux

    2) Linux sources is now available in CA7 project folder and compile well.

    See screenshot:

    0693W000005ADM0QAO.png 

    But here i don't know what to do...

    It looks like there is a source folder in build folder, trying to add some file in there but how to compile and execute it?

    Does somebody know what to do next?

    NOTE: The documentation page on How to manage OpenSTLinux project in STM32CubeIDE is under construction a this moment...:loudly_crying_face:

    0693W000005ADWyQAO.pngHow_to_manage_OpenSTLinux_project_in_STM32CubeIDE 

    Thanks,

    Ludovic.

    KKett.2Author
    Visitor II
    November 3, 2020

    Hello @Ludovic Feltz​ 

    we have not found a solution with STM32CubeIDE.

    As we are using our custom yocto build (based on OpenSTLinux), we have found a solution:

    1. Generate a SDK with bitbake (or use the OpenSTLinux SDK, which should work too) and install it
    2. Install Eclipse Oxygen (latest version with support for the yocto plugin)
    3. Install the Yocto Plugin
    4. Configure the Yocto Plugin for your SDK

    Together with the TCF (Target Communication Framework) of Eclipse we now can develop, deploy, run and debug our linux user space application directly on the stm32mp1 target.

    Everything is nicely described in the book "Embedded Linux Systems with the Yocto Project" from Rudolf J. Streif, so i recommend you to get the book.

    Best regards,

    Kevin

    Visitor II
    November 3, 2020

    Thank you for your reply @Community member​ 

    I will do some more tests as i really want to use STM32CubeIDE but if i do not find any solution i will try yours.

    In case i find a solution with STM32CubeIDE i will post the process here.

    Thank you :)

    Ludovic.

    Technical Moderator
    November 4, 2020

    Hi @Community member​ , @Ludovic Feltz​ 

    Thanks for you post and participation.

    Apology for difficulties you are encountering.

    @Community member​  nice you build solution by yourself for User application and thanks to share.

    Note that something is possible in STM32CubeIDE and we are close to document it.

    We are also working to publish How_to_manage_OpenSTLinux_project_in_STM32CubeIDE  ASAP.

    I will keep you posted in coming days.

    Olivier

    Technical Moderator
    November 6, 2020

    Hi @Community member​ , @Ludovic Feltz​ ,

    I put here a kind of draft of a coming wiki article to explain how to create a Linux Userspace application project .

    1.Article purpose

    This article provides guidelines to setup environment for STM32CubeIDE and explain steps that allow concurrent debug of both A7 and M4 cores.

    2.HARDWARE Prerequisites

    STM32MP15x board

    STLink connection for debug & Linux console

    Ethernet (or Ethernet over USB) for connection to A7 core

    3.SOFTWARE Prerequisites

    STM32CubeIDE 1.4.2 installed on a Linux station

    SDK toolset installed on your Linux Station or SDK install through CubeIDE using “Setup OpenSTLinux�? CA7 contextual menu

    4 - Create a new STM32 A7 project

    Open wizard for creating a new C Project : File -> New -> Project .. C project

    In first wizard window choose OpenSTLinux SDK

    Then Next & Finish

    0693W000005Adv6QAC.png 

    5 -Create or add main.c ( and all needed project file )

    •Select project, right click: New > File > “main.c�?

    •Fill it with for example:

    void main() {

     int i;

     for (i=0;i<10;i++);

     i++;

     i++;

     i++;

     return 33;

    }

    6 - Setup SDKPATH variable:

    Project Properties > C/C++ Build > Environment > Edit variable > Variables

    SDK path depends if you proceed with "internal " installation using IDE

    -> it's then somewhere in a path like [CUBEIDE_INSTALLTION_PATH]/plugins/com.st.openstlinux.sdk.openstlinux_5.4_dunfell_mp1_20_06_24_5.4.0.202007020712/tools/ 

    Or "external" SDK installation ( legacy Developper Package ) :

    -> it's then

    [Developper_Package_installation_PATH]/SDK

    7 - Build your project

    Olivier

    Visitor II
    November 15, 2020

    Hi Oliver,

    Can you please elaborate How to build and run the application you showed in your last comment?

    Thanks!

    Technical Moderator
    December 2, 2020

    Hi @EWalt.1​ , @Community member​ , @Ludovic Feltz​ ,

    FYI, as per announced earlier we have published a page in wiki in order to guide whoever want to build and debug a user space application in STM32CubeIDE :

    https://wiki.st.com/stm32mpu/wiki/How_to_debug_a_user_space_application_with_STM32CubeIDE

    Hope it help,

    Olivier

    Visitor II
    December 17, 2020

    Hi all,

    coming back to the initial post here. So when generating a new Project in CubeIDE (File>New...>STM32 Project) there are two projects generated, one for CM4 and one for CA7 (like shown in the initial screenshot). I expected, that it is possible to also integrate user space applications into the CA7 project here. Generating separate projects seems a little bit strange.

    If this is not possible. What is the purpose of the CA7 project then?

    Thanks

    Klaas

    Technical Moderator
    December 17, 2020

    Hi @Community member​ ,

    CA7 is there to host OpenSTLinux projects ( TF-A, Uboot, Kernel) .

    Hosting of user space app will come in next CubeIDE release.

    In the meantime we offer this possibility to play with separate projects.

    Olivier