Installing and Activating Cross Development Environment Print

 

The Linux Cortex-M development software is distributed as a linux-cm-<BSP>-<release>.tar.bz2 file available for download from the Emcraft site. That file can be installed to an arbitrary directory on your Linux development host, as follows:

$ tar -xjf ./linux-cm-<BSP>-<release>.tar.bz2
$ ls -l linux-cm-<BSP>-<release>
total 28
drwxrwxr-x. 31 sasha sasha 4096 Apr 18 05:59 A2F
-rwxrwxr-x. 1 sasha sasha 588 Apr 18 05:58 ACTIVATE.sh
drwxrwxr-x. 24 sasha sasha 4096 Apr 18 05:58 linux
-rw-rw-r--. 1 sasha sasha 42 Apr 18 05:58 _MANIFEST
drwxrwxr-x. 3 sasha sasha 4096 Apr 18 05:58 projects
drwxrwxr-x. 3 sasha sasha 4096 Apr 18 06:09 tools
drwxrwxr-x. 25 sasha sasha 4096 Apr 18 05:59 u-boot

You do not need to be the superuser (root) in order to install the Linux Cortex-M distribution. The installation can be performed from an arbitrary unprivileged user account.

As a next step in the installation procedure, you need to download the GNU cross-build tools for Cortex-M and the GNU Arm Embedded Toolchain available from https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2. It is recommended that you install the GNU development tools to the tools/ directory in the cross-development tree. Download the
arm-buildroot-uclinuxfdpiceabi_sdk-buildroot.tar.gz and
gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 files to your home directory, then unpack it to tools/:

$ cd linux-cm-<BSP>-<release>/tools/
$ tar -xzf ~/arm-buildroot-uclinuxfdpiceabi_sdk-buildroot.tar.gz
$ tar -xjf ~/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2

The tools can be installed from an unprivileged account.

It is possible to install the tools to an alternative location, however, should you do that, you will need to modify the ACTIVATE.sh script to provide a correct path to the installed tools (specifically, PATH must include a correct path to the directory where you have installed the cross-tools).

Generally speaking, our customers do not have many issues (if any) with installation and activation of the development environment. For some reason, the most frequently occurring error is that people forget to run the activation script. This obviously results in insufficient path settings and the compiler failing to build sources for Cortex-M.

The activation script needs to be run any time you start a development session. The script resides at the top of the installation directory:

$ ls
A2F ACTIVATE.sh linux _MANIFEST projects tools u-boot

An alternative way to run the script is to perform the following command:

$ . ./ACTIVATE.sh

Whichever way you run the script, it sets a number of environment variables that are required for the cross development environment to function correctly. One of those variables is called MCU. The easy way to test if the cross development environment is active is to run the following command:

$ echo $MCU
IMXRT<board_name>_NXPEVK

where <board_name> is IMXRT102X for i.MX RT1024, IMXRT105X for i.MX RT1050, and IMXRT117X for i.MX RT11170.

If MCU is empty or set to something other than <board_name>, this means that you have forgotten to run the activation script or somehow run it incorrectly.

Some of our customers ask if the cross development environment can be run on a Windows host. We don't support Windows, however some of our customers have been successfully running the development environment on a virtual Linux machine under Windows. Again, we don't support that explicitly so if you want to try that, you are on your own.