This topic helps you set up the development environment for NXP's i.MX RT1170.
注意: This port is a Technology Preview and access to it is available only on request. Contact sales 了解更多信息。
Use the Qt online installer to install the following prerequisites. You can download the installer from your Qt account .
注意: Ninja is an optional build tool and can be replaced with others like JOM or NMake. It is not needed when using Qt Creator.
注意: MCUXpresso IDE provides the tools for flashing and onboard debugging.
注意: The Qt online installer does not install the MCUXpresso IDE by default. You must select it explicitly from the list of third-party tools and SDKs.
注意: You could also manually create/remove kits using Create Kit and Remove Kit .
注意: Automatically create kits for all available targets on start option is available from Qt Creator v4.14 onwards. On older versions of Qt Creator, you have to explictly create or remove kits using Create kit or Remove kit .
To get started from the command line, ensure that the following environment variables are set:
To get started from the command line, ensure that the following environment variables are set:
Qul_DIR
to the Qt for MCUs SDK install path.
<QT_INSTALL_PATH>\QtMCUs\<VERSION>
其中,
<QT_INSTALL_PATH>
is the Qt install directory,
<VERSION>
is the directory containing the Qt Quick Ultralite version you are using, for example
1.1.0
.
MCUXpressoIDE_PATH
to your MCUXpresso IDE installation path.
EVK_MIMXRT1170_SDK_PATH
environment variable and set it to the installed SDK path.
EVK_MIMXRT1170_FREERTOS_PATH
environment variable and set it to the installed FreeRTOS SDK path.
Flashing and debugging NXP boards requires the board to have the DAPLINK firmware. If incorrect firmware is flashed, the tools may fail to establish a connection with the device.
NXP provides the firmware for download . On the download page, select your board type and download the "Default firmware application, DAPLink".
After installing the DAPLink, follow these instructions to flash the firmware:
The platform to build for must be set to
mimxrt1170-evk-freertos
for this board.
-DQUL_PLATFORM=mimxrt1170-evk-freertos
This platform supports armgcc 工具链 .
-DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\armgcc.cmake
The supported color depth by this platform is 32-bit.
注意: If this variable is not set, default color depth is used while configuring for the platform.
-DQUL_COLOR_DEPTH=32
By default, the asset data for application is copied to SDRAM on application startup. In order to keep resources in external flash, and not load it to RAM on startup, use the
QUL_COPY_TO_RAM
CMake option with the value
Never
when adding assets to the application with
qul_add_resource
.
The package for
NXP i.MX RT1170 Evaluation Kit
board comes with the following prebuilt demos and examples:
You can find these in the
demo_images
目录。
Open the CMake project file for the example you want to build and configure it with the kit you created earlier. Once the project is configured, select 运行 or press Ctrl+r on your keyboard to build and flash the binary to the target.
以下范例构建
motor_cluster
demo for this board:
cd %Qul_DIR%\demos\motor_cluster mkdir build cd build cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_PLATFORM=mimxrt1170-evk-freertos cmake --build .
Once you have successfully built the
motor_cluster
demo, you can flash it, using the flashing instructions above.
The same procedure applies to any other application.
By default, the output of
printf
calls are redirected to a virtual serial port, which is exposed on the host machine via USB.
In order to debug application code on MIMXRT1170, a hardware debugger must be connected to the board's JTag port, and J-Link software must be installed from here
The J5-J8 pins (under the JTag socket) must be disabled.
警告: Disabling J5-J8 pins prevents flashing via DAP-Link. Those pins must be re-enabled before flashing binaries.
注意: Currently flashing via JTag is not supported, see flashing instructions
JLinkGDBServer -endian little -noir -speed auto -port 2331 -vd -device MIMXRT1062DVL6A -if SWD -halt -reportuseraction
arm-none-eabi-gdb
in a separate console
$ARMGCC_DIR/bin/arm-none-eabi-gdb path/to/compiled.elf -ex "target remote localhost:2331" (gdb) monitor reset halt (gdb) continue
注意: If the monitor reset gdb command does not reset the device, use the load command.
注意: This method is not fully working, some instructions can't be debugged.
Connect a USB cable to the board (to J11) and to the host PC. Install pyocd software and run it:
pyocd gdbserver -p 2331
运行
arm-none-eabi-gdb
in a separate console
$ARMGCC_DIR/bin/arm-none-eabi-gdb build/Debug/nxp1170-example.elf -ex "target remote localhost:2331" (gdb) monitor reset halt (gdb) continue