mimxrt595-evk#

Pigweed AI summary: The NXP MIMXRT595-EVK evaluation board is a target for on-device Pigweed development. To configure this target, the MCUXpresso SDK must be downloaded and unpacked within the project source tree. A source set must then be created based on the downloaded SDK, and the pw_third_party_mcuxpresso_SDK build arg must be set to the name of the source set created. To build for this target, the top-level "mimxrt595" Ninja target must be

The NXP MIMXRT595-EVK evaluation board is a demonstration target for on-device Pigweed development

Configuring#

Pigweed AI summary: To configure a Pigweed target, the first step is to download the MCUXpresso SDK for the device and unpack it within the project source tree. Next, a source set needs to be created based on the downloaded SDK, and the build arg pw_third_party_mcuxpresso_SDK needs to be set to the name of the source set. Alternatively, a basic project template can be used by setting the build arg pw_target_mimxrt595_evk_MANIFEST to the location of the manifest file

Step 1: Download SDK#

Pigweed AI summary: To configure the Pigweed target, the first step is to download the MCUXpresso SDK for the device and unpack it within the project source tree.

To configure this Pigweed target you will first need to download an NXP MCUXpresso SDK for your device and unpack it within your project source tree.

Step 2: Create SDK source set#

Pigweed AI summary: To create an SDK source set, set the build argument to the name of the source set created. Alternatively, use the basic project template by setting the build argument to the location of the manifest file and the sample SDK source set within the Pigweed target directory. Modify and save the args file to use the sample SDK.

You’ll next need to create a source set based on the downloaded SDK, and set the pw_third_party_mcuxpresso_SDK build arg to the name of the source set you create. See pw_build_mcuxpresso for more details.

Alternatively to get started you can start with the basic project template by setting the pw_target_mimxrt595_evk_MANIFEST build arg to the location of the manifest file within the unpacked SDK, and then setting the pw_third_party_mcuxpresso_SDK to the sample_sdk source set within the Pigweed target directory.

$ gn args out
# Modify and save the args file to use the sample SDK.
pw_target_mimxrt595_evk_MANIFEST = "//third_party/mcuxpresso/sdk/EVK-MIMXRT595_manifest_v3_8.xml"
pw_third_party_mcuxpresso_SDK = "//targets/mimxrt595_evk:sample_sdk"

Building#

Pigweed AI summary: To build for the Pigweed target, the top-level "mimxrt595" Ninja target should be built after configuration. This can be done by running the command "ninja -C out mimxrt595".

Once configured, to build for this Pigweed target, simply build the top-level “mimxrt595” Ninja target.

$ ninja -C out mimxrt595

Running and Debugging#

Pigweed AI summary: This article provides instructions for running and debugging the MIMXRT595-EVK board. The first-time setup involves flashing the Link2 debug probe with the correct firmware using the LPCScrypt utility and installing the J-Link package from the SEGGER website. The general setup includes setting the DIP switches, connecting the USB cable, and starting the J-Link GDB Server. To load an executable into the target, debug, and run it, use arm-none-eabi-gdb and set

First Time Setup#

Pigweed AI summary: The MIMXRT595-EVK board comes with an integrated Link2 debug probe that can operate in CMSIS-DAP or SEGGER J-Link mode. To use J-Link mode, the Link2 needs to be flashed with the correct firmware. This can be done by downloading and installing the LPCScrypt utility from the NXP website, placing a jumper over JP1, connecting a USB cable to J40 and the computer, running scripts/boot_lpcscrypt and scripts/program

The MIMXRT595-EVK comes with an integrated Link2 debug probe that can operate in either CMSIS-DAP or SEGGER J-Link mode. CMSIS-DAP is how the board will likely come by default, but J-Link is the mode that is currently known to work, so you’ll need to flash the Link2 with the correct firmware.

  1. Download and install the LPCScrypt utility from the NXP website.

  2. Place a jumper over JP1 (not J1). If you’re having trouble locating this, it’s in the top-right of the board in a block of four jumpers closest to the USB ports.

  3. Connect a USB cable into the top-right USB port (J40) and your computer.

  4. Run scripts/boot_lpcscrypt from the LPCScrypt installation.

  5. Run scripts/program_JLINK from the LPCScrypt installation, press the SPACE key to update the firmware.

  6. Unplug the USB cable and remove the JP1 jumper.

Now is also a good time to download and install the J-Link package from the SEGGER website.

General Setup#

Pigweed AI summary: This section provides instructions for setting up the MIMXRT595-EVK for use. It includes steps such as ensuring the DIP switches are set correctly, connecting a USB cable, and starting the J-Link GDB Server. It also notes that on Linux, the libncurses5 library may need to be installed to use the tools. These steps do not need to be repeated if everything is left set up and not disconnected or rebooted.

Each time you prepare the MIMXRT595-EVK for use, you’ll need to do a few steps. You don’t need to repeat these if you leave everything setup and don’t disconnect or reboot.

  1. Ensure the SW7 DIP switches are set to Off-Off-On (boot from QSPI Flash).

  2. Connect a USB cable into the top-right USB port (J40) and your computer.

  3. Start the J-Link GDB Server and leave this running:

    JLinkGDBServer -select USB -device MIMXRT595S -endian little -if SWD -speed 4000 -noir
    

On Linux, you may need to install the libncurses5 library to use the tools:

sudo apt install libncurses5

Running and Debugging#

Pigweed AI summary: This section provides instructions for running and debugging an executable using arm-none-eabi-gdb. The code includes commands for loading the executable into the target, setting breakpoints, and resetting the target. It also includes instructions for loading an updated version of the same file and debugging a new file. The debug console is available on the USB serial port.

Use arm-none-eabi-gdb to load an executable into the target, debug, and run it.

(gdb) target remote :2331
Remote debugging using :2331
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x08000000 in ?? ()
(gdb) file out/mimxrt595_evk_debug/obj/pw_status/test/status_test.elf
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from out/mimxrt595_evk_debug/obj/pw_status/test/status_test.elf...
(gdb) monitor reset
Resetting target
(gdb) load
Loading section .flash_config, size 0x200 lma 0x8000400
Loading section .vector_table, size 0x168 lma 0x8001000
Loading section .code, size 0xb34c lma 0x8001180
Loading section .ARM, size 0x8 lma 0x800c4d0
Loading section .static_init_ram, size 0x3c8 lma 0x800c4d8
Start address 0x080048d0, load size 47748
Transfer rate: 15542 KB/sec, 6821 bytes/write.
(gdb) monitor reset
Resetting target

You can now set any breakpoints you wish, and continue to run the executable.

To reset the target use monitor reset.

To load an updated version of the same file, after resetting the target, use load and a second monitor reset as shown above.

To debug a new file, use file before load.

Debug console is available on the USB serial port, e.g. /dev/ttyACM0 (Linux) or /dev/tty.usbmodem* (Mac).