Embedded module TQMa8MxNL - YOCTO Linux BSP documentation
Building Cortex M7 Examples with MCUXpresso
This guide refers to the following hardware and software versions:
- TQMa8MNxL (MIMX8MN6xxxIZ)
- MCUXpresso SDK 2.9.0
- GCC ARM Embedded, 9-2020-q2-update
- Ubuntu 18.04 (Host System)
Preparing Development Host
Host System Tools
The MCUXpresso SDK requires cmake to build binaries therefore it must be installed on your development host. To install it on a Ubuntu based host execute the command below.
$ sudo apt-get install cmake
# Check the version >= 3.0.x
$ cmake --version
GCC Arm Embedded Toolchain
The required toolchain version can be found in the SDK release notes (included as PDF):
SDK_2_9_0_MIMX8MN6xxxIZ\docs\MCUXpresso SDK Release Notes for EVK-MIMX8MN.pdf
The toolchain must be downloaded from the ARMDeveloper website.
This is the actual toolset (in other words, compiler, linker, and so on).
The GCC toolchain should be the latest supported version as described in the MCUXpresso SDK Release Notes.
- Download the toolchain gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2
- Unpack the toolchain archive in /opt/:
tar xvjf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 -C /opt/
MCUXpresso SDK
The MCUXpresso Software Development Kit (MCUXpresso SDK) provides bare metal source code for execution on the Cortex M7. Apply the steps below to install it.
- Visit MCUXpresso SDK Builder
- Select processor MIMX8MN6xxxIZ
- Select the version 2.9.0 in the right column and press the Build MCUXpresso SDK button.
- After “building” the SDK, download the ZIP archive via the Download SDK button
SDK Setup
1. Unzip previously downloaded SDK archive, afterwards create and Enter new
$ mkdir MIMX8MN6xxxIZ && cd MIMX8MN6xxxIZ
2. Copy downloaded SDK archive into the folder created before
$ cp path/to/downloaded/SDK-Archive ./
3. Unpack the SDK and delete the archive afterwards.
$ tar xvf SDK_2_9_0_MIMX8MN6xxxIZ.tar.gz && rm SDK_2_9_0_MIMX8MN6xxxIZ.tar.gz
4. Create GIT repository from current directory and create initial commit.
5. Create new git repository.
$ git init
6. Create new local branch.
$ git checkout -b v2.9.x
6. Add .gitignore file
$ touch .gitignore
7. Exclude build results to prevent dirty builds.
$ echo "tqma8-cortexm-demos-v2.9.0-*" > .gitignore
8. Add all files to the repository.
$ git add -A
9. Create initial git commit.
$ git commit -m "initial commit"
10. Unpack and apply the TQM module-specific data in the MCUXpresso SDK root directory and remove the archive afterwards.
$ tar xvf tqma8mnxl-cortexm-demos-4eb071e7.tar.gz $ rm tqma8mnxl--cortexm-demos-4eb071e7.tar.gz
11. Create a new commit after adding TQ customizations.
$ git add * $ git commit -m "added support for specific tq-platform"
Build demos and create archive
It is possible to build the applications manually. We recommend the use of the Makefile (make), because this creates an archive with the demos, which can be integrated into the BSP.
Build Cortex M7 - Hello World Demo manually
$ cd /path/to/MIMX8MN6xxxIZ $ . ./sdk_env_tqma8mnxl.sh $ cd demo-apps/hello_world/armgcc/ $ ./build_release.sh
Build Cortex M7 - RPMSG PingPong Demo manually
$ cd /path/to/MIMX8MN6xxxIZ $ . ./sdk_env_tqma8mnxl.sh $ cd multicore_examples/rpmsg_lite_pingpong_rtos/linux_remote/armgcc/ $ ./build_release.sh
Build archive for BSP integration
Navigate to SDK root path and build archive using the make command.
$ cd /path/to/MIMX8MN6xxxIZ $ make
Build customized demos and create archive
The following example shows how to customize and rebuild the HelloWorld demo.
1. Change to the HelloWorld Demo folder in the SDK
$ cd path/to/sdk/boards/tqma8mnxl-mba8mnxl/demo_apps/hello_world/
2. Open the file hello_world.c
$ nano hello_world.c
3. Change PRINTF(“hello world.\r\n”); to PRINTF(“hello customer.\r\n”); in line 44 and save the file finally.
4. Change to the root path of the SDK and commit new changes
$ cd /path/to/MIMX8MN6xxxIZ $ git add boards/<platform>/demo_apps/hello_world/hello_world.c $ git commit -m "changed hello world string"
5. Build demo binaries and create archive for the BSP integration Please check that there are no uncommited changes in your git repository. If so, please commit all your changes.
$ make
BSP Integration
The archive created above is brought into the BSP via the meta-tq layer. The inclusion of custom M7 binaries can be solved via a separate layer.
1. Create new layer and create the appropriate folder structure.
2. Navigate to the BSP root (ci-meta-tq) directory
$ <cd path/to>/ci-meta-tq
4. Initialise build environment.
$ . setup-environment <buildspace>
5. If not already existing, create a custom Yocto meta layer e.g. meta-custom.
$ bitbake-layers create-layer ../sources/meta-custom
6. Create the following path in the Yocto meta layer that should contain the customized demo recipe, in this case the meta-custom layer is used and navigate to it.
$ mkdir -p ../sources/meta-custom/recipes-bsp/tqma8-cortexm-demos $ cd ../sources/meta-custom/recipes-bsp/tqma8-cortexm-demos
7. Create folder tqma8-cortexm-demos and store the demo archive created before
$ mkdir tqma8-cortexm-demos $ cp </path/to/archive>/tqma8-cortexm-demos-v2.9.0-<COMMIT-ID>.tar.gz ./tqma8-cortexm-demos
Example archive name tqma8-cortexm-demos-v2.9.0-gc32d0e2b7d
8. Create a bbappend file to customize the original recipe without touch it.
$ nano tqma8-cortexm-demos_v2.9.0.bbappend
Add the following content to tqma8-cortexm-demos_v2.9.0.bbappend file.
Content of tqma8-cortexm-demos_v2.9.0.bbappend:
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SDK_TQ_REV = "<COMMIT-ID>"
Include own layer in the build-envirentment
The meta-custom layer must be added to the bblayers.conf file, otherwise the recipes in this layer will not be used for the build.
$ cd /path/to/ci-meta-tq/buildspace $ echo 'BBLAYERS += "${BSPDIR}/sources/meta-custom"' >> conf/bblayers.conf
Build image with new CortexM demos
1. Clear previous tqma8-cortexm-demos build results
bitbake -c cleansstate tqma8-cortexm-demos
2. Rebuild image e.g. tq-image-weston
$ bitbake tq-image-weston