Advertisement

Quick Links

NXP Semiconductors
User Guide
Harpoon User's Guide
Document identifier: HRPNUG
Rev. EAR 2.1.0, 30 June 2022

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Harpoon and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for NXP Semiconductors Harpoon

  • Page 1 NXP Semiconductors Document identifier: HRPNUG User Guide Rev. EAR 2.1.0, 30 June 2022 Harpoon User's Guide...
  • Page 2: Table Of Contents

    Chapter 6 Technical Details on Harpoon Applications.........36 6.1 Description..........................36 6.2 Manual build..........................36 6.3 Starting an RTOS application with Jailhouse................38 6.4 Developing a Harpoon Application..................38 Chapter 7 Revision History.................. 42 Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 2 / 43...
  • Page 3: Chapter 1 Overview

    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.
  • Page 4: Hardware Resource Partitioning

    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: •...
  • Page 6: Chapter 2 Building Harpoon Yocto Images

    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:...
  • Page 7: Chapter 3 Hardware Setup

    NXP Semiconductors Chapter 3 Hardware Setup 3.1 i.MX Reference Boards This Harpoon release supports the following development boards: Figure 2. i.MX 8M Mini EVK https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/evaluation-kit-for-the-i­ mx-8m-mini-applications-processor:8MMINILPD4-EVK Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 7 / 43...
  • Page 8 NXP Semiconductors Hardware Setup Figure 3. i.MX 8M Nano EVK Figure 4. i.MX 8M Plus EVK https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/evaluation-kit-for-the-i­ mx-8m-nano-applications-processor:8MNANOD4-EVK https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-8m-plus-evaluation­ kit-enabling-power-measurement:8MPLUSLPD4-PEVK Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 8 / 43...
  • Page 9: Audio Use Case Hardware

    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...
  • Page 12: Industrial Use Case Hardware

    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...
  • Page 14: Chapter 4 Running Harpoon Reference Applications

    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): •...
  • Page 15: Audio 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 16 Table 2. Audio application latency Sampling Audio latency (μs) rate (kHz) Audio buffer size (frames) 176.4 1210 88.2 1310 2380 1720 1390 1220 1140 44.1 2600 1880 1510 1310 1240 Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 16 / 43...
  • 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...
  • Page 19: Industrial Application

    /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 21 0x00a0: a0a1 a2a3 a4a5 a6a7 a8a9 aaab acad aeaf ....0x00b0: b0b1 b2b3 b4b5 b6b7 b8b9 babb bcbd bebf ....0x00c0: c0c1 c2c3 c4c5 c6c7 c8c9 cacb cccd cecf ....Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 21 / 43...
  • 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...
  • Page 26 0.000000000 stack-freertos os_timer_create : os_timer(C06585A0), queue: C06583A0 INIT 0.000000000 management mac_service_init : mac(C06585D8) done INIT 0.000000000 management management_init : management(C0658550) done INIT 0.000000000 stack-freertos management_task : started Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 26 / 43...
  • Page 27 C0659FA0 INFO 0.000000000 stack-freertos timer_system_create : os_timer(C06657A0), queue: 0 INFO 0.000000000 stack-freertos os_timer_create : os_timer(C06657A0), queue: C0659FA0 INFO 0.000000000 stack-freertos timer_system_create : os_timer(C0665808), queue: 0 Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 27 / 43...
  • Page 28 0 INFO 0.000000000 stack-freertos os_timer_create : os_timer(C0665BB0), queue: C0659FA0 INFO 0.000000000 stack-freertos timer_system_create : os_timer(C0665C18), queue: 0 INFO 0.000000000 stack-freertos os_timer_create : os_timer(C0665C18), queue: C0659FA0 Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 28 / 43...
  • Page 29 : mrp_app(C066AD40) port(0) attr(C066BD60, MSRP_ATTR_TYPE_DOMAIN) INFO 0.159357387 srp mrp_mad_join_request : mrp_app(C066AD40) port(0) attr(C066BD60, MSRP_ATTR_TYPE_DOMAIN) new(1) INFO 0.159357387 srp msrp_create_domain : port(0) domain(5, 2, 2) created, Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 29 / 43...
  • Page 30 : cyclic task type: 0, id: 0 INFO 0 app cyclic_task_init : task params INFO 0 app cyclic_task_init : task_period_ns : 100000 INFO 0 app cyclic_task_init : task_period_offset_ns : 0 Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 30 / 43...
  • Page 31: Rt_Latency Application

    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...
  • Page 35: Chapter 5 Known Issues

    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...
  • Page 36: Chapter 6 Technical Details On Harpoon Applications

    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...
  • Page 38: Starting An Rtos Application With Jailhouse

    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 39 ├── dtmf_wave.c │ ├── dtmf_wave.h │ ├── music.h │ ├── pipeline_config.c │ ├── play_dtmf.c │ ├── play_music.c │ ├── play_pipeline.c │ ├── play_sine.c │ ├── rec_play.c Harpoon User's Guide, Rev. EAR 2.1.0, 30 June 2022 User Guide 39 / 43...
  • 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...
  • Page 42: Chapter 7 Revision History

    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.

Table of Contents