Skip to main content
debugging
Lead
April 16, 2025
Question

Building C programs on STM32MP Linux

  • April 16, 2025
  • 3 replies
  • 1190 views

Been looking around how to install GCC native ARM tool-chain on the STM32MP1 & MP2 to be able to build C applications on an ARM host. Is that possible or it can only be done with a Intel based cross compiler ?

 

 

3 replies

Andrew Neil
Super User
April 16, 2025

@debugging wrote:

 Is that possible or it can only be done with a Intel based cross compiler ?


GCC on Linux ARM must be possible - Raspberry Pi does it!

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate II
September 5, 2025

If you are building Yocto you can find some recipe to install gcc on the target it self for native build (i don't know the recipe name sorry..)

Or you can issue bitbake command 

bitbake -c populate_sdk <your-image-name>

to build a cross compiler for your target image along with target rootfs. Which can be found in deploy/sdk directory of your build. and can be installed on other machines.

debugging
debuggingAuthor
Lead
September 23, 2025

Thank you. The main thing is I updated the kernel with kernel drivers from a newer kernel, but that means that some utilities that interact with the kernel (cross compiled in user space)  need link with updated ARM libraries that talk to the kernel. I am trying to figure out how to update those libraries in the SDK (which is building now.)

 

Olivier GALLIEN
Technical Moderator
October 9, 2025

Hi @debugging

 

Building on target is possible thanks to an extra package packagegroup-core-buildessential. 

 

On MP2 it can be install directly through apt get

On MP1 you need to generate it with Yocto by doing : 

 

    IMAGE_INSTALL:append = "\                             packagegroup-core-buildessential \

 

Note that MP1 will present poor performance for build operation. 

 

Olivier 

 

 

Olivier GALLIEN In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.