SlideShare a Scribd company logo
1 of 34
Download to read offline
Heterogeneous Multiprocessing
with Android on NXP i.MX 7
Laura Nao, Nicola La Gloria
Kynetics, Santa Clara, CA
About us.
● Kynetics is full software stack engineering firm
○ Embedded Unit
○ Application Unit
● We support NXP embedded application processors
● Custom Android OS for different industries.
○ Kernel development
○ API Device Integration (HAL)
○ Custom system services (native, Java)
● Continuous building and delivery of artifacts
Outline (1/2)
1. Introduction to AMP
○ SMP vs AMP
○ i.MX7 overview
○ OpenAMP framework
2. RPMsg in Android kernel
○ RPMsg character driver overview
○ Implementation in the Linux kernel
3. Android porting on Colibri i.MX7
○ Kynetics’ Cohesys BSP for Colibri i.MX 7
SMP vs AMP
SMP on homogeneous architectures:
● Single OS controlling two or
more identical cores sharing
system resources
● Dynamic scheduling and load
balancing
. . .
App App
OS
Coren
Core1
...
Kernel SMP
Outline (2/2)
4. Cohesys AMP demo - Headless mode
○ Cohesys Android/FreeRTOS demo - Goal
○ Cohesys Android/FreeRTOS demo - HW Setup
○ IMU data sampling (FreeRTOS)
○ Android native IPC client
5. Android AMP demo - Headful mode
○ Android App overview
○ Java bridge to native IPC library (JNI)
○ GUI
6. Hands-on videos
7. Q&A
SMP vs AMP
AMP on heterogeneous
architectures:
● Different OS on each core -->
full-featured OS alongside a
real-time kernel
● Inter processor communication
protocol
● Efficient when the application
can be statically partitioned
across cores - high performance
is achieved locally
. . .
App App Task Task
OS OS/RTOS
Coren
Core1
...
MCAPI
Why Heterogeneous Systems?
A growing number of embedded systems require concurrent execution in
segregated environments:
● Real time performances to access certain devices/peripherals
● Power consumption (MCU + MPU systems were used in the past)
○ Data aggregation from sensors
● System integrity: segregation (Rich OS + critical subsystem)
○ Multi-chip approach
○ Virtualization
○ HMP (Heterogeneous multiprocessing) ←
● Cortex-A7 core + Cortex-M4 core
● Master - Slave architecture
○ A7 is the master
○ M4 is the slave
● Inter processor communication
○ MU - Messaging Unit
○ RPMsg component (OpenAMP framework)
● Safe sharing of I/O resources
○ RDC - Resource Domain Controller
NXP i.MX7 overview
i.MX7 Reference Manual: https://www.nxp.com/docs/en/reference-manual/IMX7DRM.pdf
Why Embedded Android
● Very application oriented: abstraction between low level hardware and
application layers
● Rich UI SDK
○ Native (NDK)
○ Java (SDK)
● Great debugging tools
● Productive development environment
○ Android Studio
○ Gradle based build system
● Almost any java developer can be an “embedded application developer”
OpenAMP framework: Inter-processor communication
RPMsg
VirtIO/Virtqueue
Shared memory
Inter-core interrupts
RPMsg Lite,
OpenAMP Rpmsg,
...
VirtIO, Virtqueue, Vring
Shmem, MU, Mailbox
Transport Layer
MAC Layer
Physical Layer
OpenAMP framework: MAC (VirtIO)
virtqueue
struct vring
short used_idx
short avail_idx
Int (*add_buff)(..)
void*(*get_buff)(..)
void(*kick)(..)
vring_desc
vring_desc
vring_desc
vring_desc
vring_desc
vring_avail
vring_used
...
VRING Buffer list
Buffer
Buffer
Buffer
Shared Memory
VirtIO Communication
Master (A7) transmit to Remote (M4)
● Master get_buff() from virtqueue1
○ get idx from USED ring
● Master fills the buffer
● Master add_buff() to the virtqueue1
○ write buffer idx in AVAIL ring and increment idx
● Remote get_buff() from AVAIL ring
○ Remote add_buff() to USED ring (freed)
● Master writes buffer idx to USED ring and increment idx
Master (A7) receives from Remote (M4)
● Master get_buff() from virtqueue2
○ get idx from USED ring tail
● Master add_buff() to the virtqueue2
○ write buffer idx AVAIL in ring and
increment
● Remote get_buff() from AVAIL ring
and fills the buffer
○ Remote add_ buff() to USED
ring and increment
● Master get_buff() from USED ring
OpenAMP framework - RPMsg channels and endpoints
RPMsg character driver
The Linux RPMsg char driver exposes RPMsg endpoints to user-space processes.
● Supports the creation of multiple endpoints for each RPMsg device
● Each created endpoint device shows up as a single character device in /dev
● Provides multiple interfaces:
○ Control interface: allows creation/destruction of endpoint interfaces
○ Endpoint interface (one for each exposed endpoint): allows creation, destruction
and interaction with endpoints
The driver was first introduced in the Linux 4.11 version (sources can be found in the drivers
folder of mainline kernel). More info are available in our technical note.
RPMsg character driver
Implementation in Linux Kernel
Cohesys BSP
Board Support Package for Toradex Colibri-iMX7 SoM:
● Android 7.1.2
● U-Boot 2017.03 (from NXP) + support for .ELF files
● Linux Kernel 4.9 + RPMsg character driver backported from Kernel 4.11
This build is compatible with:
● Colibri i.MX7 eMMC SOM 1GB RAM
● Toradex Iris carrier board
● 7” capacitive parallel display from Toradex
Hybrid Android/FreeRTOS Demo - Goal
● FreeRTOS binary running on Cortex-M4
○ Sample IMU sensor
○ Send data upon configuration:
➢ VECTOR mode - raw acc, mag, gyro data
➢ NORM mode - norm of acc, mag, gyro vectors
● Android executable running on Cortex-A7 [i.e. “headless” mode]
○ Check inter-core communication and log received data on a text file
● Android app running on Cortex-A7 [i.e. “headful” mode]
○ Sensor data plotting
Hybrid Android/FreeRTOS Demo - HW Setup
● Toradex Iris Carrier Board w/
Colibri i.MX7 SOM
● Adafruit Precision NXP 9-DOF
Breakout Board (via I2C)
○ FXOS8700 3-Axis
accelerometer and
magnetometer
○ FXAS21002 3-axis
gyroscope
Architecture Overview
TXT
IMU data sampling (FreeRTOS app)
TXT
IMU data sampling (FreeRTOS app)
TXT
Android native IPC client
TXT
https://youtu.be/LjGJndErk8g
Headless Demo Video
Android app overview
JNI - native to Java code
Java: impossibility of interacting directly with the hardware
JNI: Glue layer between Java and the lower layers of the OS
● Provides support for interacting with native code like C/C++
● Map native methods which interact directly with the hardware
● Java code declares static native methods in whatever class in the code
● Main Activity loads the native libraries (.so or .dll) where native methods are
implemented (in C) and bind them to the class where they have been
declared (native).
Android OS and JNI
Picture by Karim Yaghmour
Native IPC library (JNI)
Motivation: The Android app needs to
interact with the control interface exposed
by the RPMsg char driver:
● Endpoint creation requires ioctl
operation on the control interface
● Ioctl operations cannot be done
from Java code
Activity
JNI wrapper
Native library
Android kernel
Rpmsg char driver
UI app
Linux process
● Low level operation on RPMsg devices
(e.g. creating/destroying endpoints) are
handled by native C methods.
JNI endpoint creation
#define RPMSG_CREATE_EPT_IOCTL _IOW(0xb5, 0x1, struct rpmsg_endpoint_info)
/* Open controller device */
fd_ctrldev = open(/dev/rpmsg_ctrl0, O_RDONLY);
/* Create endpoint device */
ret = ioctl(fd_ctrldev, RPMSG_CREATE_EPT_IOCTL, &ep);
if (ret < 0) {
__android_log_print(ANDROID_LOG_INFO, "openDeviceNative", "Error creating endpoint device: %s
n",strerror(errno));
close(fd_ctrldev);
return NULL;
}
GUI
Plotting libraries used: https://github.com/PhilJay/MPAndroidChart
● VECTOR mode: plots raw values of
the three components (i.e. x, y, z) of
respectively the acc, mag and gyro
vectors.
● NORM mode : plots the norm values
of the acc, mag and gyro vectors.
There is one plot for each sensor.
● NORM mode is selected by default
during application startup.
I/O Data Rate
Remote core:
● Sample IMUs every 10ms - 100 Hz
● Buffer of 300 elements = 3Kb (TCM Memory is only 32 Kb - bigger buffer is possible if
application is moved to DDR)
○ In NORM mode each element is 12 byte (3 float * 4 bytes each float)
○ In VECTOR mode each element is 36 byte
● Items are dequeued and sent to master 10 at a time every 100 ms
○ In NORM mode sending speed is 1.32KB/s (with RPMSG header)
○ In VECTOR mode sending speed is 3.67KB/s (with RPMSG header)
Master core:
● At the driver layer
○ In NORM mode receiving speed is ~0.93KB/s (without RPMSG header)
○ In VECTOR mode receiving speed is ~3.51KB/s (without RPMSG header)
Headfull Demo Video
https://youtu.be/2u6bOJbrFW0
https://youtu.be/D5Dh9G9JB18
Setup Demo Video
References
● Kynetics Technical Notes: http://kynetics.com/docs
○ Android Asymmetric Multiprocessing on Toradex Colibri i.MX7D
○ RPMsg device and driver on Linux and Android
○ Android Asymmetric Multiprocessing on i.MX7: Remote Core Sensors Data
Streaming in Java
● Kynetics GitHub: https://github.com/kynetics
● OpenAMP project page
● An Introduction to Asymmetric Multiprocessing: When this Architecture can be a Game
Changer (ELC 2018)
Q&A

More Related Content

What's hot

Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systemsVandana Salve
 
Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN
 
Understanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panicUnderstanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panicJoseph Lu
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxThe Linux Foundation
 
Continguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux KernelContinguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux KernelKernel TLV
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Opersys inc.
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Linaro
 
Android Binder IPC for Linux
Android Binder IPC for LinuxAndroid Binder IPC for Linux
Android Binder IPC for LinuxYu-Hsin Hung
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Samsung Open Source Group
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introductionYi-Hsiu Hsu
 
Run Qt on Linux embedded systems using Yocto
Run Qt on Linux embedded systems using YoctoRun Qt on Linux embedded systems using Yocto
Run Qt on Linux embedded systems using YoctoMarco Cavallini
 
Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yoctoAlex Gonzalez
 
LF_DPDK_Mellanox bifurcated driver model
LF_DPDK_Mellanox bifurcated driver modelLF_DPDK_Mellanox bifurcated driver model
LF_DPDK_Mellanox bifurcated driver modelLF_DPDK
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsLinaro
 
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOSBuilding a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOSFernando Luiz Cola
 

What's hot (20)

Linux for embedded_systems
Linux for embedded_systemsLinux for embedded_systems
Linux for embedded_systems
 
Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN hypervisor introduction
Project ACRN hypervisor introduction
 
Lec04 gpu architecture
Lec04 gpu architectureLec04 gpu architecture
Lec04 gpu architecture
 
Understanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panicUnderstanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panic
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
 
Continguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux KernelContinguous Memory Allocator in the Linux Kernel
Continguous Memory Allocator in the Linux Kernel
 
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...Using and Customizing the Android Framework / part 4 of Embedded Android Work...
Using and Customizing the Android Framework / part 4 of Embedded Android Work...
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
 
Android Binder IPC for Linux
Android Binder IPC for LinuxAndroid Binder IPC for Linux
Android Binder IPC for Linux
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introduction
 
Cuda
CudaCuda
Cuda
 
NVIDIA CUDA
NVIDIA CUDANVIDIA CUDA
NVIDIA CUDA
 
Run Qt on Linux embedded systems using Yocto
Run Qt on Linux embedded systems using YoctoRun Qt on Linux embedded systems using Yocto
Run Qt on Linux embedded systems using Yocto
 
Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yocto
 
LF_DPDK_Mellanox bifurcated driver model
LF_DPDK_Mellanox bifurcated driver modelLF_DPDK_Mellanox bifurcated driver model
LF_DPDK_Mellanox bifurcated driver model
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOSBuilding a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
The kvm virtualization way
The kvm virtualization wayThe kvm virtualization way
The kvm virtualization way
 

Similar to Heterogeneous Multiprocessing with Android on NXP i.MX 7

AMP Kynetics - ELC 2018 Portland
AMP  Kynetics - ELC 2018 PortlandAMP  Kynetics - ELC 2018 Portland
AMP Kynetics - ELC 2018 PortlandKynetics
 
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portlandAsymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portlandNicola La Gloria
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLinaro
 
Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Linaro
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Opersys inc.
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese..."Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...Edge AI and Vision Alliance
 
BPF Hardware Offload Deep Dive
BPF Hardware Offload Deep DiveBPF Hardware Offload Deep Dive
BPF Hardware Offload Deep DiveNetronome
 
Embedded platform choices
Embedded platform choicesEmbedded platform choices
Embedded platform choicesTavish Naruka
 
Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storage
Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storageWebinar: OpenEBS - Still Free and now FASTEST Kubernetes storage
Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storageMayaData Inc
 
A Journey into Hexagon: Dissecting Qualcomm Basebands
A Journey into Hexagon: Dissecting Qualcomm BasebandsA Journey into Hexagon: Dissecting Qualcomm Basebands
A Journey into Hexagon: Dissecting Qualcomm BasebandsPriyanka Aash
 
LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205Linaro
 
Rlite software-architecture (1)
Rlite software-architecture (1)Rlite software-architecture (1)
Rlite software-architecture (1)ARCFIRE ICT
 
Node in Real Time - The Beginning
Node in Real Time - The BeginningNode in Real Time - The Beginning
Node in Real Time - The BeginningAxilis
 
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kevin Lynch
 
Multi-Processor computing with OpenMP
Multi-Processor computing with OpenMPMulti-Processor computing with OpenMP
Multi-Processor computing with OpenMPStefan Coetzee
 
Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...
Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...
Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...Pradeep Singh
 
0xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp020xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp02chon2010
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux HeritageOpersys inc.
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
BPF  & Cilium - Turning Linux into a Microservices-aware Operating SystemBPF  & Cilium - Turning Linux into a Microservices-aware Operating System
BPF & Cilium - Turning Linux into a Microservices-aware Operating SystemThomas Graf
 

Similar to Heterogeneous Multiprocessing with Android on NXP i.MX 7 (20)

AMP Kynetics - ELC 2018 Portland
AMP  Kynetics - ELC 2018 PortlandAMP  Kynetics - ELC 2018 Portland
AMP Kynetics - ELC 2018 Portland
 
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portlandAsymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
 
Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509
 
Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3Leveraging Android's Linux Heritage at AnDevCon3
Leveraging Android's Linux Heritage at AnDevCon3
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese..."Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
 
BPF Hardware Offload Deep Dive
BPF Hardware Offload Deep DiveBPF Hardware Offload Deep Dive
BPF Hardware Offload Deep Dive
 
Embedded platform choices
Embedded platform choicesEmbedded platform choices
Embedded platform choices
 
Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storage
Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storageWebinar: OpenEBS - Still Free and now FASTEST Kubernetes storage
Webinar: OpenEBS - Still Free and now FASTEST Kubernetes storage
 
A Journey into Hexagon: Dissecting Qualcomm Basebands
A Journey into Hexagon: Dissecting Qualcomm BasebandsA Journey into Hexagon: Dissecting Qualcomm Basebands
A Journey into Hexagon: Dissecting Qualcomm Basebands
 
LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
Rlite software-architecture (1)
Rlite software-architecture (1)Rlite software-architecture (1)
Rlite software-architecture (1)
 
Node in Real Time - The Beginning
Node in Real Time - The BeginningNode in Real Time - The Beginning
Node in Real Time - The Beginning
 
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
 
Multi-Processor computing with OpenMP
Multi-Processor computing with OpenMPMulti-Processor computing with OpenMP
Multi-Processor computing with OpenMP
 
Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...
Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...
Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...
 
0xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp020xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp02
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
BPF  & Cilium - Turning Linux into a Microservices-aware Operating SystemBPF  & Cilium - Turning Linux into a Microservices-aware Operating System
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
 

More from Kynetics

Eclipse Hara, Updating Embedded Devices with hawkBit Made Easy
Eclipse Hara, Updating Embedded Devices with hawkBit Made EasyEclipse Hara, Updating Embedded Devices with hawkBit Made Easy
Eclipse Hara, Updating Embedded Devices with hawkBit Made EasyKynetics
 
Deploy Eclipse hawBit in Production
Deploy Eclipse hawBit in ProductionDeploy Eclipse hawBit in Production
Deploy Eclipse hawBit in ProductionKynetics
 
Orchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded LinuxOrchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded LinuxKynetics
 
ELC2019 - Poster - Update Anything
ELC2019 - Poster - Update Anything ELC2019 - Poster - Update Anything
ELC2019 - Poster - Update Anything Kynetics
 
Eclipse Iot Day 2018 Presentation
Eclipse Iot Day 2018 PresentationEclipse Iot Day 2018 Presentation
Eclipse Iot Day 2018 PresentationKynetics
 
Eclipsecon 2017 presentation
Eclipsecon 2017 presentationEclipsecon 2017 presentation
Eclipsecon 2017 presentationKynetics
 
Using Java on Wearable Devices featuring an Hybrid Architecture.
Using Java on Wearable Devices featuring an Hybrid Architecture.Using Java on Wearable Devices featuring an Hybrid Architecture.
Using Java on Wearable Devices featuring an Hybrid Architecture.Kynetics
 
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...Kynetics
 
Reactive IoT, Java One 2016
Reactive IoT, Java One 2016Reactive IoT, Java One 2016
Reactive IoT, Java One 2016Kynetics
 
Linaro Connect 2017 - Presentation - Kynetics
Linaro Connect 2017 - Presentation - KyneticsLinaro Connect 2017 - Presentation - Kynetics
Linaro Connect 2017 - Presentation - KyneticsKynetics
 

More from Kynetics (10)

Eclipse Hara, Updating Embedded Devices with hawkBit Made Easy
Eclipse Hara, Updating Embedded Devices with hawkBit Made EasyEclipse Hara, Updating Embedded Devices with hawkBit Made Easy
Eclipse Hara, Updating Embedded Devices with hawkBit Made Easy
 
Deploy Eclipse hawBit in Production
Deploy Eclipse hawBit in ProductionDeploy Eclipse hawBit in Production
Deploy Eclipse hawBit in Production
 
Orchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded LinuxOrchestrated Android-Style System Upgrades for Embedded Linux
Orchestrated Android-Style System Upgrades for Embedded Linux
 
ELC2019 - Poster - Update Anything
ELC2019 - Poster - Update Anything ELC2019 - Poster - Update Anything
ELC2019 - Poster - Update Anything
 
Eclipse Iot Day 2018 Presentation
Eclipse Iot Day 2018 PresentationEclipse Iot Day 2018 Presentation
Eclipse Iot Day 2018 Presentation
 
Eclipsecon 2017 presentation
Eclipsecon 2017 presentationEclipsecon 2017 presentation
Eclipsecon 2017 presentation
 
Using Java on Wearable Devices featuring an Hybrid Architecture.
Using Java on Wearable Devices featuring an Hybrid Architecture.Using Java on Wearable Devices featuring an Hybrid Architecture.
Using Java on Wearable Devices featuring an Hybrid Architecture.
 
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...
Deploy Small IoT Embedded SOC Devices and a Back-End Platform with Java, usin...
 
Reactive IoT, Java One 2016
Reactive IoT, Java One 2016Reactive IoT, Java One 2016
Reactive IoT, Java One 2016
 
Linaro Connect 2017 - Presentation - Kynetics
Linaro Connect 2017 - Presentation - KyneticsLinaro Connect 2017 - Presentation - Kynetics
Linaro Connect 2017 - Presentation - Kynetics
 

Recently uploaded

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 

Recently uploaded (20)

Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 

Heterogeneous Multiprocessing with Android on NXP i.MX 7

  • 1. Heterogeneous Multiprocessing with Android on NXP i.MX 7 Laura Nao, Nicola La Gloria Kynetics, Santa Clara, CA
  • 2. About us. ● Kynetics is full software stack engineering firm ○ Embedded Unit ○ Application Unit ● We support NXP embedded application processors ● Custom Android OS for different industries. ○ Kernel development ○ API Device Integration (HAL) ○ Custom system services (native, Java) ● Continuous building and delivery of artifacts
  • 3. Outline (1/2) 1. Introduction to AMP ○ SMP vs AMP ○ i.MX7 overview ○ OpenAMP framework 2. RPMsg in Android kernel ○ RPMsg character driver overview ○ Implementation in the Linux kernel 3. Android porting on Colibri i.MX7 ○ Kynetics’ Cohesys BSP for Colibri i.MX 7
  • 4. SMP vs AMP SMP on homogeneous architectures: ● Single OS controlling two or more identical cores sharing system resources ● Dynamic scheduling and load balancing . . . App App OS Coren Core1 ... Kernel SMP
  • 5. Outline (2/2) 4. Cohesys AMP demo - Headless mode ○ Cohesys Android/FreeRTOS demo - Goal ○ Cohesys Android/FreeRTOS demo - HW Setup ○ IMU data sampling (FreeRTOS) ○ Android native IPC client 5. Android AMP demo - Headful mode ○ Android App overview ○ Java bridge to native IPC library (JNI) ○ GUI 6. Hands-on videos 7. Q&A
  • 6. SMP vs AMP AMP on heterogeneous architectures: ● Different OS on each core --> full-featured OS alongside a real-time kernel ● Inter processor communication protocol ● Efficient when the application can be statically partitioned across cores - high performance is achieved locally . . . App App Task Task OS OS/RTOS Coren Core1 ... MCAPI
  • 7. Why Heterogeneous Systems? A growing number of embedded systems require concurrent execution in segregated environments: ● Real time performances to access certain devices/peripherals ● Power consumption (MCU + MPU systems were used in the past) ○ Data aggregation from sensors ● System integrity: segregation (Rich OS + critical subsystem) ○ Multi-chip approach ○ Virtualization ○ HMP (Heterogeneous multiprocessing) ←
  • 8. ● Cortex-A7 core + Cortex-M4 core ● Master - Slave architecture ○ A7 is the master ○ M4 is the slave ● Inter processor communication ○ MU - Messaging Unit ○ RPMsg component (OpenAMP framework) ● Safe sharing of I/O resources ○ RDC - Resource Domain Controller NXP i.MX7 overview i.MX7 Reference Manual: https://www.nxp.com/docs/en/reference-manual/IMX7DRM.pdf
  • 9. Why Embedded Android ● Very application oriented: abstraction between low level hardware and application layers ● Rich UI SDK ○ Native (NDK) ○ Java (SDK) ● Great debugging tools ● Productive development environment ○ Android Studio ○ Gradle based build system ● Almost any java developer can be an “embedded application developer”
  • 10. OpenAMP framework: Inter-processor communication RPMsg VirtIO/Virtqueue Shared memory Inter-core interrupts RPMsg Lite, OpenAMP Rpmsg, ... VirtIO, Virtqueue, Vring Shmem, MU, Mailbox Transport Layer MAC Layer Physical Layer
  • 11. OpenAMP framework: MAC (VirtIO) virtqueue struct vring short used_idx short avail_idx Int (*add_buff)(..) void*(*get_buff)(..) void(*kick)(..) vring_desc vring_desc vring_desc vring_desc vring_desc vring_avail vring_used ... VRING Buffer list Buffer Buffer Buffer Shared Memory
  • 12. VirtIO Communication Master (A7) transmit to Remote (M4) ● Master get_buff() from virtqueue1 ○ get idx from USED ring ● Master fills the buffer ● Master add_buff() to the virtqueue1 ○ write buffer idx in AVAIL ring and increment idx ● Remote get_buff() from AVAIL ring ○ Remote add_buff() to USED ring (freed) ● Master writes buffer idx to USED ring and increment idx Master (A7) receives from Remote (M4) ● Master get_buff() from virtqueue2 ○ get idx from USED ring tail ● Master add_buff() to the virtqueue2 ○ write buffer idx AVAIL in ring and increment ● Remote get_buff() from AVAIL ring and fills the buffer ○ Remote add_ buff() to USED ring and increment ● Master get_buff() from USED ring
  • 13. OpenAMP framework - RPMsg channels and endpoints
  • 14. RPMsg character driver The Linux RPMsg char driver exposes RPMsg endpoints to user-space processes. ● Supports the creation of multiple endpoints for each RPMsg device ● Each created endpoint device shows up as a single character device in /dev ● Provides multiple interfaces: ○ Control interface: allows creation/destruction of endpoint interfaces ○ Endpoint interface (one for each exposed endpoint): allows creation, destruction and interaction with endpoints The driver was first introduced in the Linux 4.11 version (sources can be found in the drivers folder of mainline kernel). More info are available in our technical note.
  • 16. Cohesys BSP Board Support Package for Toradex Colibri-iMX7 SoM: ● Android 7.1.2 ● U-Boot 2017.03 (from NXP) + support for .ELF files ● Linux Kernel 4.9 + RPMsg character driver backported from Kernel 4.11 This build is compatible with: ● Colibri i.MX7 eMMC SOM 1GB RAM ● Toradex Iris carrier board ● 7” capacitive parallel display from Toradex
  • 17. Hybrid Android/FreeRTOS Demo - Goal ● FreeRTOS binary running on Cortex-M4 ○ Sample IMU sensor ○ Send data upon configuration: ➢ VECTOR mode - raw acc, mag, gyro data ➢ NORM mode - norm of acc, mag, gyro vectors ● Android executable running on Cortex-A7 [i.e. “headless” mode] ○ Check inter-core communication and log received data on a text file ● Android app running on Cortex-A7 [i.e. “headful” mode] ○ Sensor data plotting
  • 18. Hybrid Android/FreeRTOS Demo - HW Setup ● Toradex Iris Carrier Board w/ Colibri i.MX7 SOM ● Adafruit Precision NXP 9-DOF Breakout Board (via I2C) ○ FXOS8700 3-Axis accelerometer and magnetometer ○ FXAS21002 3-axis gyroscope
  • 20. IMU data sampling (FreeRTOS app) TXT
  • 21. IMU data sampling (FreeRTOS app) TXT
  • 22. Android native IPC client TXT
  • 25. JNI - native to Java code Java: impossibility of interacting directly with the hardware JNI: Glue layer between Java and the lower layers of the OS ● Provides support for interacting with native code like C/C++ ● Map native methods which interact directly with the hardware ● Java code declares static native methods in whatever class in the code ● Main Activity loads the native libraries (.so or .dll) where native methods are implemented (in C) and bind them to the class where they have been declared (native).
  • 26. Android OS and JNI Picture by Karim Yaghmour
  • 27. Native IPC library (JNI) Motivation: The Android app needs to interact with the control interface exposed by the RPMsg char driver: ● Endpoint creation requires ioctl operation on the control interface ● Ioctl operations cannot be done from Java code Activity JNI wrapper Native library Android kernel Rpmsg char driver UI app Linux process ● Low level operation on RPMsg devices (e.g. creating/destroying endpoints) are handled by native C methods.
  • 28. JNI endpoint creation #define RPMSG_CREATE_EPT_IOCTL _IOW(0xb5, 0x1, struct rpmsg_endpoint_info) /* Open controller device */ fd_ctrldev = open(/dev/rpmsg_ctrl0, O_RDONLY); /* Create endpoint device */ ret = ioctl(fd_ctrldev, RPMSG_CREATE_EPT_IOCTL, &ep); if (ret < 0) { __android_log_print(ANDROID_LOG_INFO, "openDeviceNative", "Error creating endpoint device: %s n",strerror(errno)); close(fd_ctrldev); return NULL; }
  • 29. GUI Plotting libraries used: https://github.com/PhilJay/MPAndroidChart ● VECTOR mode: plots raw values of the three components (i.e. x, y, z) of respectively the acc, mag and gyro vectors. ● NORM mode : plots the norm values of the acc, mag and gyro vectors. There is one plot for each sensor. ● NORM mode is selected by default during application startup.
  • 30. I/O Data Rate Remote core: ● Sample IMUs every 10ms - 100 Hz ● Buffer of 300 elements = 3Kb (TCM Memory is only 32 Kb - bigger buffer is possible if application is moved to DDR) ○ In NORM mode each element is 12 byte (3 float * 4 bytes each float) ○ In VECTOR mode each element is 36 byte ● Items are dequeued and sent to master 10 at a time every 100 ms ○ In NORM mode sending speed is 1.32KB/s (with RPMSG header) ○ In VECTOR mode sending speed is 3.67KB/s (with RPMSG header) Master core: ● At the driver layer ○ In NORM mode receiving speed is ~0.93KB/s (without RPMSG header) ○ In VECTOR mode receiving speed is ~3.51KB/s (without RPMSG header)
  • 33. References ● Kynetics Technical Notes: http://kynetics.com/docs ○ Android Asymmetric Multiprocessing on Toradex Colibri i.MX7D ○ RPMsg device and driver on Linux and Android ○ Android Asymmetric Multiprocessing on i.MX7: Remote Core Sensors Data Streaming in Java ● Kynetics GitHub: https://github.com/kynetics ● OpenAMP project page ● An Introduction to Asymmetric Multiprocessing: When this Architecture can be a Game Changer (ELC 2018)
  • 34. Q&A