Set Up Toolchain
This section contains the steps to install the necessary components required to build and run an MCUXpresso SDK demo application with the Arm GCC toolchain, as supported by the MCUXpresso SDK. There are many ways to use Arm GCC tools, but this example focuses on a Windows environment. Though not discussed here, GCC tools can also be used with both Linux OS and Mac OSX.
Install GCC Arm Embedded Toolchain
Download and run the installer from
launchpad.net/gcc-arm-embedded. This is the actual toolset (in other words, compiler, linker, etc.). The GCC toolchain should correspond to the latest supported version, as described in MCUXpresso SDK Release Notes Supporting MIMXRT1170-EVK from <SDK>/docs folder.
The Minimalist GNU for Windows (MinGW) development tools provide a set of tools that are not dependent on third party C-Runtime DLLs (such as Cygwin). The build environment used by the MCUXpresso SDK does not utilize the MinGW build tools but does leverage the base install of both MinGW and MSYS. MSYS provides a basic shell with a Unix-like interface and tools.
- Download the latest MinGW mingw-get-setup installer
- Run the installer. The recommended installation path is C:\MinGW, however, you may install to any location.
- Ensure that the mingw32-base and msys-base are selected under Basic Setup.
- In the Installation menu, click Apply Changes and follow the remaining instructions to complete the installation.
Add the appropriate item to the Windows operating system Path environment variable. It can be found under
Control Panel -> System and Security -> System -> Advanced System Settings in the Environment Variables...
section. The path is:
Assuming the default installation path,
C:\MinGW, an example is shown below. If the path is not set correctly, the toolchain does not work.
Note: If you have
C:\MinGW\msys\x.x\bin in your PATH variable (as required by KSDK 1.0.0), remove it to ensure that the new GCC build system works correctly.
Add a New Environment Variable for ARMGCC_DIR
Create a new system environment variable and name it ARMGCC_DIR. The value of this variable should point to the Arm GCC Embedded tool chain installation path, which, for this example, is:
C:\Program Files (x86)\GNU Tools ARM Embedded\<version>
Reference the installation folder of the GNU Arm GCC Embedded tools for the exact path name of your installation.
- Download CMake 3.0.x from
- Install CMake, ensuring that the option Add CMake to system PATH is selected when installing. It's up to the user to select whether it's installed into the PATH for all users or just the current user. In this example, the assumption is that it's installed for all users.
- Follow the remaining instructions of the installer.
- You may need to reboot your system for the PATH changes to take effect.
- Make sure sh.exe is not in the Environment Variable PATH. This is a limitation of mingw32-make.
Build an Example Application
To build an example application, follow these steps.
- Open a GCC Arm Embedded tool chain command window. To launch the window, from the Windows operating system Start menu, go to “Programs -> GNU Tools Arm Embedded <version>” and select “GCC Command Prompt”.
- Change the directory to the example application project directory, which has a path like this:
For this guide, the exact path is:
- Type “build_debug.bat” on the command line or double click on the "build_debug.bat" file in Windows operating system Explorer to perform the build. The output is shown in this figure:
Run an Example Application
This section describes steps to run a demo application using J-Link GDB Server application. To perform this exercise, make sure that either:
- The Freelink/LPC-Link2 interface on your board is programmed with the J-Link firmware. If your board does not support Freelink/LPC-Link2 interface, then a standalone J-Link pod is required.
- You have a standalone J-Link pod that is connected to the debug interface of your board.
Procedure to configure Freelink/LPC-Link2 interface with J-Link firmware:
- Power off the MIMXRT1170-EVK
- Place a jumper in J22 header to enter DFU boot mode
- Power on the MIMXRT1170-EVK
- Connect to PC through J11 port
- Download and install LPCScrypt from LPCScrypt v2.1.2
- Go to the scripts folder from LPCScrypt location.
- Run the “program_JLINK.cmd” script
- After script finishes, close the LPCScrypt window
- Power off the MIMXRT1170-EVK
- Remove jumper from J22 header
- Power on the MIMXRT1170-EVK
- Verify that Device Manager now lists the J-Link interface
After the J-Link interface is configured and connected, follow these steps to download and run the demo applications:
- Connect the development platform to your PC via USB cable between the LPC-Link2(
J11) USB connector and the PC USB connector. If using a standalone J-Link debug pod, also connect it to the SWD/JTAG connector of the board.
- Open the J-Link GDB Server application. Assuming the J-Link software is installed, the application can be launched by going to the Windows operating system Start menu and selecting "Programs -> SEGGER -> J-Link <version> J-Link GDB Server".
- Select Device “MIMXRT1176xxxA_M7” and Target interface to SWD.
- Verify GDB Server is waiting for GDB connection.
- Open the terminal application on the PC, such as PuTTY or TeraTerm, and connect to the debug serial port number. Configure the terminal with these settings:
- 115200 (reference BOARD_DEBUG_UART_BAUDRATE in board.h)
- No parity
- 8 data bits
- 1 stop bit
- If not already running, open a GCC Arm Embedded tool chain command window. To launch the window, from the Windows operating system Start menu, go to "Programs -> GNU Tools Arm Embedded <version>" and select "GCC Command Prompt".
- Change to the directory that contains the demo application output. The output can be found in using one of these paths, depending on the build target selected:
For this guide, the path is:
Run the arm-none-eabi-gdb.exe
<application_name>.elf. For this example, it is
Run these commands on the GCC Command Prompt:
- target remote localhost: 2331
- monitor reset
- monitor halt
The application is now downloaded and halted at the reset vector.
Execute the monitor go command to start the demo application.
The hello_world application is now running, and a banner is displayed on the terminal. If this is not true, check your terminal settings and connections.
Refer to the Getting Started with MCUXpresso SDK for MIMXRT1170-EVK.pdf in the <SDK install folder>/docs folder from the SDK for additional information and instructions to build and run multicore example applications.