Skip to content

avnet-iotconnect/iotc-mcx-zephyr-demos

Repository files navigation

FRDM‑MCXN947 Face Detection Quickstart (Zephyr + /IOTCONNECT)


1. Introduction

This demo showcases Edge AI face detection running on the NXP FRDM‑MCXN947 using Zephyr RTOS, with results sent to Avnet’s /IOTCONNECT cloud platform via LTE. image

It is based on:

This Quickstart will guide you through hardware setup, cloud onboarding, building, and running the demo.


2. Requirements

Hardware

Software

  • Zephyr SDK & toolchain supporting MCXN947
  • west command-line tools
  • /IOTCONNECT cloud account
  • Device certificate & private key

3. Hardware Setup

1. Follow the NXP Reference Instructions Completely

Before adding any project-specific hardware, complete the hardware setup described in NXP’s official demo:

NXP Reference Repo:
https://github.com/nxp-appcodehub/dm-multiple-face-detection-on-mcxn947

Follow these steps exactly:

Required Steps from NXP (summarized)

  • Move the required solder jumpers
    The MCXN947 must be reconfigured so the camera interface is routed correctly.
    NXP documents each jumper that must be moved—follow these instructions precisely.

  • Connect the OV7670 camera module
    Follow NXP’s wiring diagrams exactly.
    The camera must be aligned properly with the correct FFC connector.

  • Connect the LCD display (optional)
    NXP provides the display connector pinout and required jumpers.

Do not continue until the NXP demo runs correctly with camera (and LCD if used).
This ensures that the camera pipeline and display interface are working before adding LTE or /IOTCONNECT support.

2. Adding the LTE Modem (Avnet /IOTCONNECT Extension)

Once the NXP demo is fully functional, add the Mikroe LTE IoT 12 Click to enable /IOTCONNECT connectivity.

Standard UART Connections

Function MCXN947 Pin LTE Click Pin
TX P0_27 RX
RX P0_26 TX
PWR EN P1_3 (J6) PWR
Power J5/J6 3V3 / 5V
Ground GND GND

Hardware setup images: frdm-mcux-n947 mikroe-lteiot-12

3. Recommended Method for Clean Wiring (Important)

The pictures show the modem connected using discrete jumpers. However, for cleaner mechanical integration:

You can bend only the TX and RX pins upward on the Mikroe module

This allows:

  • The modem to still plug directly into the Mikroe mikroBUS socket
  • TX/RX jumpers to route under the board
  • Jumpers to connect neatly to the P0 connector on the MCXN947 board

This reduces mechanical strain, keeps the module securely seated, and preserves clearance.

How to wire it cleanly:

  1. Slightly bend the RX and TX pins on the modem upward (~20–30 degrees).
  2. Insert the modem into the mikroBUS socket normally.
  3. Run two female‑to‑female Dupont jumpers:
    • Click RX → P0_27
    • Click TX → P0_26
  4. Route jumpers underneath the modem before insertion to keep them tidy.

This approach has been tested and avoids the need to run long external jumper wires.


5. Cloud Account Setup

An /IOTCONNECT account with AWS backend is required. If you need to create an account, a free trial subscription is available. The free subscription may be obtained directly from iotconnect.io or through the AWS Marketplace.

Note

Be sure to check any SPAM folder for the temporary password after registering.


6. Import Device Template

  1. From the navigation panel on the left, select the Devices icon and the Device sub-menu.menu-devices-device.png
  2. At the bottom of the page, select the Templates icon from the toolbar.
    menu-templates.png
  3. At the top-right of the page, select the Create Template button.
    button-create-template.png
  4. At the top-right of the page, select the Import" button.
    button-import.png
  5. Click the Browse button, navigate to and select the downloaded template device-template.json
  6. Click Save

7. Create a Device

In this step, we will create a Device associated with the previously imported Device Template

  1. In the ribbon at the bottom of the screen, click the Devices
  2. At the top-right, click Create Device
    button-create-device.png
  3. Enter a custom device Unique ID (also called a DUID) and Device Name such as PSOCEdgeE84
  4. Select the Entity to associate the device (For new accounts, there is only one option)
  5. Select the previously imported template pedgerm
  6. Under Device Certificate select Auto-generated
  7. Click Save & View
  8. Download the Device Configuration Information by clicking the icon in the upper right of the device page
    icon-device-configuration-information.png

8. Obtain Certificates

In this step we will locate and download the device certificates.

  1. Just below the Device Configuration Information icon, click the Connection Info link.
    connection-info.png
  2. Click on the Certificates icon in the top-right and save the file to your working directory.
    icon-certificates.png
  3. Extract the contents of the *-certificates.zip file for use in the next section.

9. Configure Software

All configuration is in:

src/iotc-conf/iotc-configuration.h

Update:

#define IOTC_CPID "YOUR_CPID"
#define IOTC_ENV  "YOUR_ENV"
#define IOTC_DUID "YOUR_DEVICE_UID"
#define IOTC_TYPE IOTC_CT_AWS   // or IOTC_CT_AZURE

Embed certificates

Convert key:

cat device.key.pem | sed -e '1d;$d' | base64 -d | xxd -i

Convert certificate:

cat device.crt | sed -e '1d;$d' | base64 -d | xxd -i

Paste into:

uint8_t device_key[]  = { ... };
uint8_t device_cert[] = { ... };

10. Using the Demo

Build

west init -l .
west update
west build -b frdm_mcxn947 .

Flash

west flash

Run

  1. Open UART @ 115200 8‑N‑1
  2. Reset device
  3. You should observe:
    • Detected faces
    • Bounding-box draw (if enabled)
    • Telemetry sent to /IOTCONNECT

Telemetry Fields (example)

face_count
faces[i].x
faces[i].y
faces[i].w
faces[i].h
faces[i].confidence
modem_rssi
modem_state

11. Import Dynamic Dashboard

/IOTCONNECT Dynamic Dashboards are an easy way to visualize data and interact with edge devices.

  1. Download the example Face Detect dashboard: mcxn947-facedet-dashboard-template.json
  2. Switch back to the /IOTCONNECT browser window and verify the device status is displaying as Connected
  3. Click Create Dashboard from the top of the page
  4. Select the Import Dashboard option and Click Browse to select the dashboard template previously downloaded.
  5. Select the Template ("mcxn9FACE") and your Device Name
  6. Enter a name (such as MCXN947 Face Detection) and Click Save the finalize the import

You will now be in the dashboard edit mode. You can add/remove widgets or just click Save in the upper-right corner to exit the edit mode.

Dashboard Example


12. Resources

About

Repository of Zephyr MCU examples

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •