Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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:

    $ source /opt/st/stm32mp1-som/2.4-snapshot/environment-setup-cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi
    $ unset CCACHE_PATH
  3. Now the CC, LD, CFLAGS and the others standard build environment variables are set for cross-compilation for the STM32MP1 platform, eg:

    $ $CC hello.c -o hello
    ...
  4. 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:

    $ mount /dev/sda1 /media
    $ cp /media/hello /tmp
    $ /tmp/hello
    Hello from STM32MP1-SOM!
    $
  5. Alternatively, you could deploy your application from the host to the target using scp:

    $ scp hello root@172.17.13.11:/tmp
  6. Another way of deploying the binary to the target is the exporting the build directory as an NFS share. Having NFS configured on your host, run on the target:

  7. $ mount -o nolock 172.17.0.19:/work/stmp1 /mnt
    $ ls -l /mnt
    ...
    -rwxrwxr-x   1 1002  1002     14612 Apr 16 20:37 hello
    -rw-rw-r--   1 1002  1002       219 Apr 16 20:36 hello.c
    $ cp /mnt/hello /tmp
    $
  • No labels