Building Linux Userspace Applications Print

 

This application note explains how to build a Linux userspace application from the Linux-hosted cross development environment and then to deploy the built executable on the target.

  1. On the development host, install the prebuilt Yocto toolchain from here.
  2. Activate the toolchain:
  3. source /opt/st/stm32mp1-som/2.4-snapshot/environment-setup-cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi
    unset CCACHE_PATH

  4. Now the CC, LD, CFLAGS and the others standard build environment variables are set for cross-compilation for the STM32MP1 platform, eg:
  5. $CC hello.c -o hello
    ...

  6. To deploy the build executable to the target, copy it to a USB Flash and plug in the USB Flash into any of USB connectors on the board:
  7. $ mount /dev/sda1 /media
    $ cp /media/hello /tmp
    $ /tmp/hello
    Hello from STM32MP1-SOM!
    $