Skip to content

This repo contains demo projects that runs on NXP devices.

License

Notifications You must be signed in to change notification settings

nxp-imx-support/zephyr_samples

Repository files navigation

Zephyr demo running on i.MX93

License badge Board badge Board badge Category badge Category badge Category badge Peripheral badge

These are highly illustrative Zephyr RTOS demo projects tailored specifically to run on the i.MX93 MPU. Specifically, the Digital Cluster demo and the Barcode Scanner demo demonstrate the exceptional capabilities of Zephyr RTOS in a hands-on manner. The Digital Cluster demo showcases the real-time performance of Zephyr RTOS, emphasizing its ability to handle multiple tasks simultaneously with minimal latency. This is crucial for applications requiring precision timing and quick response.

The Barcode Scanner demo, on the other hand, highlights the speed of Zephyr RTOS's boot process. Compared to RT-Linux, Zephyr RTOS boasts a significantly faster boot time, which is essential for scenarios where quick initialization is paramount.

Furthermore, the lightweight nature of Zephyr RTOS is also evident in these demo projects. Its efficient memory management and minimal resource consumption ensure that even resource-constrained devices can leverage its capabilities effectively. This is a significant advantage compared to RT-Linux, which tends to be heavier and more resource-intensive.

  1. Software
  2. Hardware
  3. Setup
  4. Results
  5. FAQs
  6. Support
  7. Release Notes

1. Software

Zephyr is an operating system that includes a HAL component.

The HAL provides an abstraction layer for interacting with hardware, allowing developers to write hardware-independent code.

The sample part indicates these are example implementations or demonstrations of how to use the Zephyr HAL.

These HAL samples help developers learn how to leverage the Zephyr HAL to build applications that can run on different hardware platforms without needing to modify the core code.

2. Hardware

3. Setup

3.1 Step1

Setup Zephyr Project

To setup Zephyr project, refer to Getting Started Guide - Zephyr Project Documentation.

Note that when running west init ~/zephyrproject command, use the following command instead:

$ west init -m https://github.com/nxp-upstream/zephyr --mr gh-release/imx93_zephyr_poc ~/zephyrproject

Other steps are the same.

3.2 Step2

Build Demo App

To build a demo app, first clone this repository under ~/zephyrproject :

$ cd ~/zephyrproject
$ git clone -b gh-release/imx93_zephyr_poc --single-branch https://github.com/nxp-imx-support/zephyr_samples.git

Then build with following commands:

$ cd ~/zephyrproject/zephyr
$ west build -b ${BOARD} ${PATH_TO_DEMO}

For example, to build barcode_scanner demo, use west build -b mimx93_evk_a55 ../zephyr_samples/barcode_scanner .

The result binary is ~/zephyrproject/zephyr/build/zephyr/zephyr.bin .

3.3 Step3

Run Zephyr Demo using SPL Boot

Instead of using u-Boot to load Zephyr binary, SPL boot is used to minimize boot time. To run these demo, mkimage tool must be used. To learn how to set up mkimage tool, please refer to chapter 4.5.13 of i.MX Linux User's Guide.

Assuming that mkimage tool is set up at $MKIMAGE dirctory, and Zephyr build directory is $BUILD (~/zephyrproject/zephyr/build if following above steps) , run following commands:

$ cp $BUILD/zephyr/zephyr.bin $MKIMAGE/iMX9/u-boot.bin
$ cd $MKIMAGE
$ make SOC=iMX9 REV=A1 flash_singleboot

The mkimage writes bootable binary to $MKIMAGE/iMX9/flash.bin . Write the binary to SD card with following command (replace /dev/sdX to actual device):

$ dd if=$MKIMAGE/iMX9/flash.bin of=/dev/sdX bs=1k seek=32 conv=fsync

Insert SD card to the board, boot from SD card to run Zephyr demo. The Zephyr shell can be accessed via LPUART1 with setting of 115200-8-1-0-0 . If connect via on-board debug USB to UART bridge, select 3rd COM/TTY device on the host.

3.4 Step 4

Barcode Scanner

The barcode_scanner demo runs on a single i.MX 93 11x11 EVK board. It shows preview of MT9M114 parallel camera, scan for QR-Code and shows the info on the LVDS display.

Connect LVDS diaplay to the EVK. Insert X_RPI_CAM_INT camera board onto the RPI 20 pin header of the EVK.

Build barcode_scanner using this command:

$ west build -b mimx93_evk_a55 ../zephyr_samples/barcode_scanner

Create bootable SD cand with mkimage and dd, then boot from it.

E-bike Digital Cluster

The ebike digital cluster demo include 2 projects: ebike_digital_cluster and ebike_data_source. It displays a demo instrument panel of an E-bike on an LVDS display, receives status data via CAN network and update the instrument panel.

The ebike_data_source can run on either i.MX 93 11x11 EVK or i.MX 93 9x9 QSB. It serves as CAN data source, continuously sends status data of a simulated e-bike, and acknowledges latency measurement packets via FlexCAN. The ebike_digital_cluster can only run on i.MX 93 11x11 EVK. It receives information from FlexCAN and displays the data on LVDS display.

Prepare 1x i.MX 93 11x11 EVK board and 1x i.MX 93 9x9 QSB board. Connect CAN interface of the two boards. Connect LVDS display to i.MX 93 11x11 EVK board.

Build ebike_data_source using this command:

$ west build -b mimx93_qsb_a55 ../zephyr_samples/ebike_data_source

Create bootable SD cand with mkimage and dd, then boot from it. To use another i.MX 93 11x11 EVK as ebike_data_source, replace mimx93_qsb_a55 to mimx93_evk_a55 .

Build ebike_ebike_cluster using this command:

$ west build -b mimx93_evk_a55 ../zephyr_samples/ebike_ebike_cluster

Create bootable SD cand with mkimage and dd, then boot from it.

4. Results

Barcode Scanner

When the demo runs correctly, we will see the following interfaces. picture

E-bike Digital Cluster

When the demo runs correctly, we will see the following interfaces. picture

5. FAQs

6. Support

Questions regarding the content/correctness of this example can be entered as Issues within this GitHub repository.

Warning: For more general technical questions regarding NXP Microcontrollers and the difference in expected funcionality, enter your questions on the NXP Community Forum

Follow us on Youtube Follow us on LinkedIn Follow us on Facebook Follow us on Twitter

7. Release Notes

Version Description / Update Date
1.0 Initial release May 30th 2024

Licensing

Zephyr sample is licensed under the Apache-2.0 License.

About

This repo contains demo projects that runs on NXP devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages