Run a demo using Arm GCC
This section describes the steps to configure the command line Arm GCC tools to build, run, and debug demo applications and necessary driver libraries provided in the MCUXpresso SDK. The hello_world
demo application is targeted which is used as an example.
Only J-Link debugging interface is supported for JLinkGDBServer and GDB. It is recommended to set SW5[1..4]
to 0001
when using these tools to debug. It is required to reset board for each download/debug.
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 operating system environment.
Install GCC Arm Embedded tool chain
Download and run the installer from GNU Arm Embedded Toolchain. 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 for MIMXRT1180-EVK (document MCUXSDKMIMXRT118XKRN).
Parent topic:Set up toolchain
Install MinGW (only required on Windows OS)
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 use 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 from SOURCEFORGE.
Run the installer. The recommended installation path is C:\MinGW. However, you may install to any location.
Note: The installation path cannot contain any spaces.
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 Settingsin the **Environment Variables…**section. The path is:
<mingw_install_dir>\bin
Assuming the default installation path is C:\MinGW, an example is as shown in Figure 3. If the path is not set correctly, the toolchain will not work.
Note: If you have C:\MinGW\msys\x.x\binin your PATH variable (as required by Kinetis SDK 1.0.0), remove it to ensure that the new GCC build system works correctly.
Parent topic:Set up toolchain
Add a system environment variable for ARMGCC_DIR
Create a system
environment variable and name it as ARMGCC_DIR
. The value of this variable should point to the Arm GCC Embedded tool chain installation path. For this example, the path is:
C:\Program Files (x86)\GNU Tools ARM Embedded\8 2018-q4-major
See the installation folder of the GNU Arm GCC Embedded tools for the exact path name of your installation.
Short path should be used for path setting, you could convert the path to short path by running the for %I in (.) do echo %~sI
command in above path.
Parent topic:Set up toolchain
Install CMake
Download CMake 3.0.x from CMAKE.
Install CMake, ensuring that the option Add CMake to system PATHis selected when installing. The user chooses to select whether it is installed into the PATH for all users or just the current user. In this example, it is 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
.
Parent topic:Set up toolchain
Parent topic:Run a demo using Arm GCC
Build an example application
To build an example application, perform the following 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 similar to the following:
<install_dir>/boards/<board_name>/<example_type>/<core_type>/<application_name>/armgcc
For this example, the exact path is:
<install_dir>/examples/evkmimxrt1180/demo_apps/hello_world/cm33/armgcc
Type build_debug.baton the command line or double click on build_debug.batfile in Windows Explorer to build it. The output is as shown in Figure 2.
Parent topic:Run a demo using Arm GCC
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 a standalone J-Link pod is connected to the debug interface of your board.
After the J-Link interface is configured and connected, follow these steps to download and run the demo applications:
This board supports the J-Link debug probe. Before using it, install SEGGER software, which can be downloaded from SEGGER.
Connect the development platform to your PC via USB cable between the OpenSDA USB connector and the PC USB connector.
Open the terminal application on the PC, such as PuTTY or TeraTerm, and connect to the debug serial port number (to determine the COM port number, see How to determine COM port). Configure the terminal with these settings:
115200 or 9600 baud rate, depending on your board (reference
BOARD_DEBUG_UART_BAUDRATE
variable in the board.h file)No parity
8 data bits
1 stop bit
Open the J-Link GDB Server application. Go to the SEGGER install folder. For example, C:\Program Files(x86)\SEGGER\JLink_Vxxx. Open the command windows. To debug CM33, run the following command:
JLinkGDBServer.exe -device MIMXRT1189xxx8_M33 -if SWD -speed 4000 -jlinkscriptfile <evkmimxrt1180_cm33.jlinkscript> -stayontop -ir
To debug CM7, run the following command:
JLinkGDBServer.exe -device MIMXRT1189xxx8_M7 -if SWD -speed 4000 -jlinkscriptfile <evkmimxrt1180_cm7.jlinkscript> -stayontop -ir
Note: The supporting
jlinkscript
file can be found in boards/evkmimxrt1180/jlinkscript.After it is connected, the screen should resemble Figure 2.
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 example application output. The output can be found in using one of these paths, depending on the build target selected:
<install_dir>/boards/<board_name>/<example_type>/<application_name>/<core>/armgcc/<target>
For this example, the path is:
<install_dir>/boards/evkmimxrt1180/demo_apps/hello_world/<core>/armgcc/debug
Run the
arm-none-eabi-gdb.exe <application_name>.elf
. For this example, it isarm-none-eabi-gdb.exe hello_world.elf
.Run these commands:
target remote localhost:2331 monitor reset monitor halt load
The application is now downloaded and halted at the reset vector. Execute the
continue
ormonitor 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.
Parent topic:Run a demo using Arm GCC
Build and run a multicore example application
This section describes the steps to build and run a dual-core application. The demo application build scripts locate in this folder:
<install_dir>/boards/evkmimxrt1180/multicore_examples/<application_name>/<core_type>/armgcc
Begin with a simple dual-core version of the Hello World application. The multicore Hello World GCC build scripts are located in this folder:
<install_dir>/boards/evkmimxrt1180/multicore_examples/hello_world/cm7/armgcc/build_debug.bat
<install_dir>/boards/evkmimxrt1180/multicore_examples/hello_world/cm33/armgcc/build_flexspi_nor_debug.bat
Build the application for the auxiliary core (cm7) first, because the primary core application project (cm33) must know the auxiliary core application binary when running the linker. It is not possible to finish the primary core linker when the auxiliary core application binary is not ready.
By default, the primary core flexspi_nor_debug target links the auxiliary core debug target, and the primary core flexspi_nor_release target links the auxiliary core release target. During the primary core execution, the auxiliary core image is copied from flash into CM7 RAM and executed.
Parent topic:Run a demo using Arm GCC