<aside> 👉 Note: these instructions were written using mcuxpressoide-11.4.0_6224.x86_64 on ubuntu 22.04, using the MIMXRT1060-EVKB (https://www.mouser.com/pdfDocs/NXP_MIMXRT1060-EVKB_QS.pdf).

The full example project can be found here: https://github.com/memfault/mcuxpresso-rt1060-example

These instructions should also apply to other NXP RT family boards (ex: MIMXRT1020-EVK), though there may be adjustments needed to the reset logic or linker script.

</aside>

Overview

This document describes how to add the Memfault SDK to an MCUXpresso project. The strategy documented here follows these high-level steps:

  1. Download MCUXpresso SDK from NXP
  2. Generate a sample project from that SDK
  3. Add the Memfault SDK sources to the project using the eclipse_patch.py script from the Memfault SDK
  4. Configure a few build settings (gnu build id, debug level)
  5. (optional, for RT1060 network demo) Add the example port files for the RT1060 LwIP port, and configure Memfault Project Key for uploading Memfault data from the EVK

Part 1: Setup + verify LwIP sample application

  1. install mcuxpresso: https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE

  2. download the SDK for the MIMXRT1060-EVKB (select all to download all components, and select “mcuxpresso” as the target toolchain). I downloaded SDK_2.10.1_MIMXRT1060-EVKB (NOTE: v2.11.1 was not compatible with MCUXpresso v11.4.0)

    Untitled

  3. import the SDK into MCUXpresso:

    Untitled

  4. to create the sample project, click “Import SDK example(s)...”, then select our board, and select lwip_httpscli_mbedTLS_freertos:

    Untitled

  5. default settings in the next screen are all OK, except for:

    1. Set library type (and hosting variant): change it to “NewlibNano (none)”
    2. Include semihost HardFault handler: uncheck
  6. build the sample with “Project→Build all”

  7. flash the sample with “Run→Debug as...→MCUXpresso IDE LinkServer (inc. CMSIS-DAP) probes”, assuming you have the default CMSIS-DAP debug firmware on the EVK

  8. open a serial terminal (example below is using pyserial):

    ❯ pyserial-miniterm --raw /dev/ttyACM0 115200
    
  9. pressing “Run” in MCUXpresso, you should see the following output in the serial terminal:

    Initializing PHY...
    
  10. connect an ethernet cable to a router to see the demo proceed

Part 2: Integrate and test Memfault