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

« Previous Version 2 Current »

This note explains how to develop new Linux functionality for your specific application. The text below walks you through the recommended development workflow. Various application notes available from the site illustrate how to use that workflow to configure and use specific functionalities on the target.

The recommended development workflow is as follows.

On the development host, go to the top of the installation tree and activate the cross-development environment:

-bash-4.2$ . ./ACTIVATE.sh
-bash-4.2$ echo $MCU
STM32H7
-bash-4.2$

Select the project you would like to start your development from. When you are starting development for a first time, the only project available in the distribution is rootfs. This project provides a powerful set of run-time capabilities however of course you will want to extend or re-configure it for your specific needs, creating new projects for your embedded devices. As you proceed with development, you may well end up having several projects for different embedded applications co-existing in your development tree. Choose a specific project as a starting point for new development based on requirements for your new embedded design.

In the session below, we use rootfs as a starting point for the development. Go to the project directory and clone the project so that you can update the new project without making changes to the existing project that you use as a reference. Here is how we create a clone of rootfs, calling the clone rootfs_plus:

-bash-4.2$ cd projects/rootfs
-bash-4.2$ make clone new=rootfs_plus
New project created in /home/sasha/2.5.0/linux-cm-stm32h7-2.5.0/projects/rootfs_plus
-bash-4.2$

Go to the newly created project directory and build it. If your have cloned project from a known-to-work reference project, the new project should build as well since so far you have made no updates to the new project:

-bash-4.2$ cd ../rootfs_plus
-bash-4.2$ make
...
-bash-4.2$ ls -lt rootfs_plus.uImage
-rw-rw-r--. 1 sasha sasha 6447194 Jul 10 14:37 rootfs_plus.uImage
-bash-4.2$

At this point, it is probably a good idea to validate that the newly built project actually runs on the target as expected. Refer to Loading Linux Images via Ethernet and TFTP (uClinux) for detailed instructions on how to load an uImage to the target.

At this point you are ready to start development of your custom functionality. You will be doing one or more of the following things:

  1. Updating the kernel configuration. Run make kmenuconfig and then browse through the kernel configuration GUI to enable / disable whatever kernel build-time options that affect your application:

    -bash-4.2$ make kmenuconfig

    Having updated the kernel config, build the project, load it to the target and validate that it still boots. Enabling or disabling even a single kernel config option can easily break your target functionality.

  2. Updating the Linux dts file. Open the dts file in your favorite text editor and update it as appropriate to define I/O devices enabled by Linux at run time as well as allocation of the STM32H7 pins to various IO functions.

  3. Updating the busybox configuration.

    -bash-4.2$ make bmenuconfig
  4. Modify the root file system spec file. Simply open the spec file in your favorite text editor and update it as appropriate for your application:

    -bash-4.2$ vi rootfs_plus.initramfs

    Things that you would typically do are as follows:

  • Add your application binaries (and/or files) to the root file system:

    ...
    file /bin/my_app ${INSTALL_ROOT}/projects/${SAMPLE}/app/my_app 755 0 0
    ...

Refer to TBD Building User-Space Applications and related application notes for information on how to build user applications for the target.

  • No labels