Chapter 1 Overview This document presents the Harpoon release (EAR) 2.1 for i.MX 8M device family, using the Arm Cortex-A53 processor (Armv8-A architecture). Harpoon provides an environment for developing real-time demanding applications on an RTOS running on one (or several) Cortex-A core(s) in parallel of a Linux distribution, leveraging the 64-bit Arm architecture for higher performance.
The boxes in blue (group 3) show the main hardware blocks allocated to the RTOS. The boxes in light orange (group 2) show the main hardware blocks shared between Linux and the RTOS. Harpoon-apps is the real-time application running on Jailhouse's inmate cell. It is built on top of the FreeRTOS and MCUXpresso drivers.
Page 5
Overview There is also a root cell configuration that describes the hardware prior to the hardware partitioning. The source files of the cell configurations are embedded through patches in the Jailhouse recipe of the Harpoon meta-layer, at the following locations: •...
NXP Semiconductors Chapter 2 Building Harpoon Yocto images As mentioned in the overview section, Harpoon is compatible with both i.MX Yocto and Real-time Edge Yocto. Each distribution is addressed in a separate section below. 2.1 i.MX Yocto To build this release, fetch its Yocto manifest and get the meta-layers:...
3.2 Audio use case hardware DAC+ ADC Pro : Harpoon's audio application uses the I2S HiFiBerry audio card Figure 5. HiFiBerry DAC+ ADC Pro (picture from HiFiBerry's website) The HiFiBerry DAC+ ADC Pro is an audio card designed for the Raspberry Pi, but it can be connected to EVK boards using the 40-pin connector, provided a few adaptations are made.
Page 10
Figure 7. i.MX 8M Mini EVK with HiFiBerry audio card The audio card has both an ADC (PCM1863) to record audio and a DAC (PCM5122) for audio playback. Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 10 / 43...
Page 11
44,100 Hz, one for sampling frequencies multiple of 48,000 Hz) are present on the HiFiBerry card, and controlled by PCM5122 GPIOs. The following diagram shows the HiFiBerry architecture: Figure 9. HiFiBerry architecture https://www.hifiberry.com/shop/boards/hifiberry-dac-adc-pro/ Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 11 / 43...
The PCM1863 and the PCM5122 use the same signal for I2S word select by using SAI synchronous mode. 3.3 Industrial use case hardware Harpoon's industrial application may use the following hardware depending on the use case. Figure 10. LS1028A AVB/TSN network bridge The LS1028A RDB is used as a TSN bridge/switch in a TSN network to demonstrate the TSN ethernet use case running from the inmate cell.
Page 13
Figure 11. RT1170 TSN endpoint The RT1170 is used as a TSN endpoint in a TSN network, exchanging packets with the i.MX 8MP board. https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-rt1170-evaluation kit:MIMXRT1170-EVK Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 13 / 43...
4.2 Starting Linux kernel Linux kernel must be started with a (Harpoon specific) Jailhouse compatible device tree. To do this, when U-Boot is executing, stop at U-Boot prompt with a terminal emulator connected to the serial port and execute the following command (based on the board and the application): •...
# harpoon_set_configuration.sh zephyr audio To use the audio application, Jailhouse must be started first. To start Jailhouse and the audio application, run the harpoon service with systemd: # systemctl start harpoon Once the harpoon service has been started, is used to start or stop the audio modes with optional parameters.
Page 17
In the audio pipeline mode there is a three stage pipeline composed of a routing element in stage 2 which can link source elements from stage 1 to sink elements from stage 3. Audio pipeline with multiple sources/sinks and a routing element Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 17 / 43...
Page 18
SAI3, right channel Hardware source Table 4. Indices of sink elements Index Sink element Comments SAI5, left channel Hardware sink Table continues on the next page... Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 18 / 43...
/usr/share/harpoon/inmates/freertos/industrial.bin # FreeRTOS binary /usr/share/harpoon/inmates/zephyr/industrial.bin # Zephyr binary This application contains several use cases that can be started and stopped via the Harpoon Linux user space application, namely harpoon_ctrl NOTE In the current release, a single industrial use case is supported under Zephyr: CAN on i.MX 8M Plus EVK.
Page 20
4.4.2 Starting the industrial application To use the industrial application, Jailhouse must be started first. To start Jailhouse and the industrial application, create the corresponding Harpoon configuration file and run the harpoon service using systemd ; for instance: # harpoon_set_configuration.sh freertos industrial...
Page 22
The below sections gives some details on the hardware requirements, setup preparation and test execution. As far as the Harpoon demonstration goes, the controller (i.MX 8MP Plus) runs in the Cortex-A53 FreeRTOS cell. The IO devices, which can be any TSN endpoint (i.MX 8M Plus, RT1170, etc...) and the TSN bridge complete the TSN network environment for this use case.
Page 23
By default, LS1028ARDB does not forward packets if no bridge interface is configured under Linux. Enabling bridge interface is dependent on the board used. 4.4.3.3.2.2.1 TSN Bridge Configuration Use the following commands to configure bridge on LS1028ARDB: # ls /sys/bus/pci/devices/0000:00:00.5/net/ Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 23 / 43...
Page 24
To start the Ethernet use case from the inmate cell (acting as a TSN Endpoint - IO Device), type the following command: # harpoon_ctrl ethernet -r 0 -i 0 Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide...
Page 25
: clock ID: 6 has no hw clock 0.000000000 stack-freertos _os_clock_init : clock ID: 7 has no hw clock INIT 0.000000000 stack-freertos _os_clock_init : clock ID: 8 success, flags: 1 Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 25 / 43...
When running, the application prints out regular statistics, based on the measurements taken, to help characterize rt_latency the system real-time latency. application is available in the harpoon share directory of the root file system: rt_latency /usr/share/harpoon/inmates/freertos/rt_latency.bin # FreeRTOS binary /usr/share/harpoon/inmates/zephyr/rt_latency.bin # Zephyr binary Harpoon User's Guide, Rev.
Page 32
Running Harpoon Reference Applications To use the rt_latency application, Jailhouse must be started first. To start Jailhouse and the rt_latency application, create an appropriate Harpoon configuration file and run the harpoon service with systemd. For instance: # harpoon_set_configuration.sh freertos latency...
Page 33
1,583 3,000 3,006 5,125 9,937 task CPU load Low priority 11,500 12,097 12,250 27,249 13,375 14,221 14,416 31,240 IRQ load Table continues on the next page... Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 33 / 43...
Page 34
8,333 98767 task CPU load, mutex Linux CPU + 3,875 29,838 2,875 3,937 8,166 141,834 memory load RTOS cold 4,375 51,573 2,875 3,107 7,916 449,858 cache Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 34 / 43...
CAN communication does not work when Use i.MX 8MP EVKs with the same revision to run CAN ping connecting i.MX 8MP EVKs with different pong demo. revisions. Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 35 / 43...
Related information 6.2 Manual build 6.2.1 Setting up the environment You need to have both installed to fetch the source code for Harpoon-apps, FreeRTOS, Zephyr and west MCUXpresso SDK: $ west init -m https://github.com/NXPmicro/harpoon-apps --mr harpoon_2.1.0 hww $ cd hww $ west update 6.2.2 Building the RTOS application for the RTOS cell...
Page 37
The Harpoon control application can then be built: $ cd harpoon-apps/ctrl $ ./build_ctrl.sh The build artefact ( ) is available in the same directory and can be used on target. harpoon_ctrl Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 37 / 43...
6.3 Starting an RTOS application with Jailhouse 6.4 Developing a Harpoon Application Harpoon-apps is the basis to create a Harpoon application. It links with MCUXpresso drivers and a RTOS (FreeRTOS and Zephyr). A Harpoon application has its own directory in the root folder of the harpoon-apps repository. Examples include...
Page 40
Definition of SAI and I2C instances used for the demo. I2C addresses of HiFiBerry’s DAC and ADC. app_board.h SAI configuration. Audio samples format. Device memory to map with MMU (includes SAI and I2C). app_mmu.h Table continues on the next page... Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 40 / 43...
Page 41
CFLAGS and LDFLAGS definitions for building the application. flags.cmake 6.4.4 Controlling application from Linux side Linux side can control the Harpoon application by sending messages through the ivshmem communication channel provided by Jailhouse. The mailbox API is used for communication. The audio application leverages this in function...
Full integration to NXP Real-Time Edge. 14 January 2022 EAR 2.0.0 Introduction of . Support of FreeRTOS. harpoon-apps Support of both i.MX BSP and Real-Time Edge SW. Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 42 / 43...
Page 43
Right to make changes - NXP Semiconductors reserves the right to make changes to information published in this document, including without limitation specifications and product descriptions, at any time and without notice. This document supersedes and replaces all information supplied prior to the publication hereof.
Need help?
Do you have a question about the Harpoon and is the answer not in the manual?
Questions and answers