SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
Developing Embedded
Solutions on
Asymmetric Systems
using QT
Fernando Luiz Cola
fernando.cola@emc-logic.com
Whoami?
Fernando Luiz Cola
Embedded Software Developer
Emc Logic
fernando.cola@emc-logic.com
Understand AMP and SMP architecture1
Applications and solution where AMP is a good fit2
Overview I.MX7 Processor3
RPMSG and Inter Processor Communication4
Agenda / Objectives
Bottom-up example application with Qt / Linux /
FreeRTOS
5
Introduction AMP
vs SMP
Symmetric Multi-Processing
Kernel SMP
Core1
Core2
OS
APP APP APP
◆ Single OS controlling two or more cores
of the same architecture
◆ CPU shares memory space
◆ Dynamic Scheduling e load balancing
Chip
Asymmetric Multi-Processing
Multi Core API
Core1
Core2
OS
APP
Chip
APP
OS / RTOS / Other
Task Task
◆ Different OS on each core
◆ Different core architectures
◆ Each core may run full-feature OS, Real-time OS or
baremetal code
◆ Inter process communication protocol
◆ Efficient when the application can be statically
partitioned across cores
Example
Multi-Chip System
CPU1
MPU
Linux
Non Critical Task Critical Task
Same SoC AMP
FreeRTOS
CPU
MPU
Linux
Non Critical Task Critical Task
FreeRTOS
Chip 1 Chip 2
Dedicated Channel
Internal Communication
External
Communication
UART / I2C
Applications Examples
Robotics / Real-Time
Applications Examples
Mobile / Sensor Acquisition
Applications Examples
Wearable / Low-Power
Overview I.MX7
Architecture
NXP I.MX7 Overview
◆ Dual Cortex A7 core + Cortex M4
core
◆ Master/Slave architecture
◆ A7 is the master
◆ M4 is the Slave
◆ Inter processor communication
◆ MU – Message Unit
◆ RDC – Resource Domain Controller
NXP I.MX7 Overview
RDC – Resource Domain Controller
NXP I.MX7 Overview
◆ Enables two processors within the SoC to
communicate and coordinate by passing
messages( ex: data, status and control)
◆ Signal the other processor using interrupts
MU – Message Unit
Inter Processor Communication
Transport Layer
MAC Layer
OpenAMP RPMSG
VirtIO, Virtqueue, Vring
MU, Mailbox, shared memory Shared Memory
Inter-Core Interrupts
Physical Layer
VirtIO / Virtqueu
RPMSG
RPMSG on Linux
User space Kernel space
M4
/dev/ttyRP
MSG
endpoint
Platform driver
drivers/rpmsg/imx_rpmsg.c
VirtIO RPMsg driver
drivers/rpmsg/virtio_rpmsg_bus.c
RPMsg char driver
drivers/rpmsg/rpmsg_char.c
Platform bus
VirtIO bus
RPMsg bus
1 – Register Platform Driver
2 – Register VirtIO Device
3 – Register VirtIO Driver
4 – Register RPMsg device
5 – Register RPMsg driver
Remote Core
Linux and FreeRTOS talking
Linux - Master Domain FreeRTOS – Remote Domain
U-boot load and starts
M4 Core and Linux Kernel
RPMSG driver creates
virtqueues and endpoints
Notifies remote processor
RPMSG driver waits for
name service announcement
Send/Receive messages
RPMSG app creates virtqueues
Waits for link being up
App creates endpoints and
sends name service announcement
Send/Receive messages
Application
evelopment with Qt
Hybrid Linux Qt / FreeRTOS Demo
● IMU sensor (I2C) read by MCU
● Qt App read data from MCU using RPMSG
● Plot data on Linux using QtCharts
Hardware Setup
● Colibri iMX7D 512MB
● Iris Carrier Board
● 7” display
● MPU6050
Hardware Setup
Master / Linux
(A7)
Remote / FreeRTOS
(M4)
MU
Shared
Memory
RPMSG
Iris Board + I.MX7
MPU6050
Host PC
Uart 1
Uart 2
I2C
Qt Development
● Toolchain(cross-compile, rootfs, libraries) generated by Yocto-Project
● Configure Qt Kit for I.MX7 using toolchain generated by Yocto
● QtQuick and QML on i.MX7(no-GPU) Qt 2D Software Rendering
● qputenv("QMLSCENE_DEVICE", QbyteArray("softwarecontext"));
● Chart Visualization via QtCharts
− Add to your .pro: QT += charts
● QtCharts is GPLv3!
Architecture Overview
Kernel space
User space
/dev/RPMSG
rpmsg_char
readI2CData
Read Data Task
Qt App
IMU Sensor
Rpmsg
channel
Rpmsg
channel
Linux FreeRTOS
Realtime Class
Realtime {
id: realtime
}
class Realtime : public QObject
{
Q_OBJECT
Q_PROPERTY(int accX READ XAcc NOTIFY accChanged)
Q_PROPERTY(int accY READ YAcc NOTIFY accChanged)
Q_PROPERTY(int accZ READ ZAcc NOTIFY accChanged)
)
public:
Realtime(QObject *parent = nullptr);
virtual ~Realtime();
private:
QFile rpmsgDevice;
signals:
void accChanged();
public slots:
void update();
};
Realtime.h
Main.qml
Realtime Class
rpmsDevice.setFileName(“/dev/ttyRPMSG”);
rpmsgDevice.open(QIODevice::ReadWrite);
qDebug() << "Get Sensor Realtime Data";
if(!rpmsgDevice.isOpen()){
qDebug() << "RPMSG Device not open";
} else {
int accx, accy, accz;
QByteArray query("acc");
rpmsgDevice.write(query);
rpmsgDevice.flush();
QbyteArray response = rpmsgDevice.readLine(64);
sscanf(response.constData(),
"x:%d,y:%d,z:%d", &accx, &accy, &accz);
}
Realtime.cpp
QML
Timer {
id: timer
property int index: 0
running: true
repeat: true
interval: 1000
onTriggered: {
realtime.update();
accx.append(index,realtime.accX);
accy.append(index,realtime.accY);
accz.append(index,realtime.accZ);
index++;
axisX.min++;
axisX.max++;
}
}
Main.qml
QML
Main.qml
ChartView {
id: chartview
animationOptions: ChartView.NoAnimation
theme: ChartView.ChartThemeDark
antialiasing: true
anchors.fill: parent
ValueAxis {
id: axisX
min: -5
max: 5
}
ValueAxis {
id: axisY
min: -10
max: 10
}
}
LineSeries {
id: accx
name: "accx"
axisY: axisY
axisX: axisX
}
LineSeries {
id: accy
name: "accy"
axisY: axisY
axisX: axisX
}
LineSeries {
id: accz
name: "accz"
axisY: axisY
axisX: axisX
}
Demo Communication between cores
https://www.youtube.com/watch?v=SnLAySJPCBU
Demo QT charts
References
● M4 Firmware - https://github.com/ferlzc/Asymmetric_QT_demo_firmware
● QT Application - https://github.com/ferlzc/Asymmetric_QT_demo
References
● Linux and Zephry “talking” to each other in the same SoC
● https://events.linuxfoundation.org/wp-content/uploads/2017/12/Linux-and-Zephyr-%E2%80%9C
Talking%E2%80%9D-to-Each-Other-in-the-Same-SoC-Diego-Sueiro-Sepura-Embarcados.pdf
● OpenAMP Project Page - https://github.com/OpenAMP/
● An Introduction to Asymmetric Multiprocessing: When this Architecture can be a Game
Changer and How to Survive It (ELC 2018)
https://elinux.org/images/6/6e/AMP_-_Kynetics_ELC_2018_Portland.pdf
● Asymetric Multiprocessing and Embedded Linux (ELC 2017)
https://elinux.org/images/3/3b/NOVAK_CERVENKA.pdf
● Toradex FreeRTOS on Cortex-M4 of Colibri IMX7
https://developer.toradex.com/knowledge-base/freertos-on-the-cortex-m4-of-a-colibri-imx7
Fernando Luiz Cola
fernando.cola@emc-logic.com
Obrigado!
https://www.linkedin.com/in/ferlzc/
https://www.emc-logic.com/

Mais conteúdo relacionado

Mais procurados

X / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewX / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural Overview
Moriyoshi Koizumi
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
Kan-Ru Chen
 
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted FirmwareHKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
Linaro
 

Mais procurados (20)

Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Introduction to Optee (26 may 2016)
Introduction to Optee (26 may 2016)Introduction to Optee (26 may 2016)
Introduction to Optee (26 may 2016)
 
HKG15-107: ACPI Power Management on ARM64 Servers (v2)
HKG15-107: ACPI Power Management on ARM64 Servers (v2)HKG15-107: ACPI Power Management on ARM64 Servers (v2)
HKG15-107: ACPI Power Management on ARM64 Servers (v2)
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
LAS16-406: Android Widevine on OP-TEE
LAS16-406: Android Widevine on OP-TEELAS16-406: Android Widevine on OP-TEE
LAS16-406: Android Widevine on OP-TEE
 
LAS16-TR06: Remoteproc & rpmsg development
LAS16-TR06: Remoteproc & rpmsg developmentLAS16-TR06: Remoteproc & rpmsg development
LAS16-TR06: Remoteproc & rpmsg development
 
X / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural OverviewX / DRM (Direct Rendering Manager) Architectural Overview
X / DRM (Direct Rendering Manager) Architectural Overview
 
Porting Android
Porting AndroidPorting Android
Porting Android
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
BUD17-416: Benchmark and profiling in OP-TEE
BUD17-416: Benchmark and profiling in OP-TEE BUD17-416: Benchmark and profiling in OP-TEE
BUD17-416: Benchmark and profiling in OP-TEE
 
Implementing generic JNI hardware control for Kotlin based app on AOSP
Implementing generic JNI hardware control for Kotlin based app on AOSPImplementing generic JNI hardware control for Kotlin based app on AOSP
Implementing generic JNI hardware control for Kotlin based app on AOSP
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
 
HKG18-203 - Overview of Linaro DRM
HKG18-203 - Overview of Linaro DRMHKG18-203 - Overview of Linaro DRM
HKG18-203 - Overview of Linaro DRM
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted FirmwareHKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
 
Intro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication ProtocolsIntro to Embedded OS, RTOS and Communication Protocols
Intro to Embedded OS, RTOS and Communication Protocols
 

Semelhante a Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS

Virtual platform
Virtual platformVirtual platform
Virtual platform
sean chen
 

Semelhante a Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS (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
 
OSN days 2019 - Open Networking and Programmable Switch
OSN days 2019 - Open Networking and Programmable SwitchOSN days 2019 - Open Networking and Programmable Switch
OSN days 2019 - Open Networking and Programmable Switch
 
ucOS
ucOSucOS
ucOS
 
Multicore
MulticoreMulticore
Multicore
 
Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)Network Programming: Data Plane Development Kit (DPDK)
Network Programming: Data Plane Development Kit (DPDK)
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOS
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
 
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
SF-TAP: Scalable and Flexible Traffic Analysis Platform (USENIX LISA 2015)
 
Challenges in GPU compilers
Challenges in GPU compilersChallenges in GPU compilers
Challenges in GPU compilers
 
Enduro/X Middleware
Enduro/X MiddlewareEnduro/X Middleware
Enduro/X Middleware
 
Network-Connected Development with ZeroMQ
Network-Connected Development with ZeroMQNetwork-Connected Development with ZeroMQ
Network-Connected Development with ZeroMQ
 
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
 
Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021
Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021
Apache Pulsar with MQTT for Edge Computing - Pulsar Summit Asia 2021
 
IRQs: the Hard, the Soft, the Threaded and the Preemptible
IRQs: the Hard, the Soft, the Threaded and the PreemptibleIRQs: the Hard, the Soft, the Threaded and the Preemptible
IRQs: the Hard, the Soft, the Threaded and the Preemptible
 
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
Install FD.IO VPP On Intel(r) Architecture & Test with Trex*
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
 
HiPEAC Computing Systems Week 2022_Mario Porrmann presentation
HiPEAC Computing Systems Week 2022_Mario Porrmann presentationHiPEAC Computing Systems Week 2022_Mario Porrmann presentation
HiPEAC Computing Systems Week 2022_Mario Porrmann presentation
 
HKG18-411 - Introduction to OpenAMP which is an open source solution for hete...
HKG18-411 - Introduction to OpenAMP which is an open source solution for hete...HKG18-411 - Introduction to OpenAMP which is an open source solution for hete...
HKG18-411 - Introduction to OpenAMP which is an open source solution for hete...
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 

Último

➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men 🔝Deoghar🔝 Escorts...
➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men  🔝Deoghar🔝   Escorts...➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men  🔝Deoghar🔝   Escorts...
➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men 🔝Deoghar🔝 Escorts...
amitlee9823
 
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
amitlee9823
 
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
amitlee9823
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
motiram463
 
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Bommasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Bommasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Bommasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Bommasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Naicy mandal
 

Último (20)

Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men 🔝Deoghar🔝 Escorts...
➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men  🔝Deoghar🔝   Escorts...➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men  🔝Deoghar🔝   Escorts...
➥🔝 7737669865 🔝▻ Deoghar Call-girls in Women Seeking Men 🔝Deoghar🔝 Escorts...
 
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
Kothanur Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
 
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Vinay Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006Call Girls in Vashi Escorts Services - 7738631006
Call Girls in Vashi Escorts Services - 7738631006
 
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
Call Now ≽ 9953056974 ≼🔝 Call Girls In Yusuf Sarai ≼🔝 Delhi door step delevry≼🔝
 
HLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussHLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discuss
 
Bommasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Bommasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Bommasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Bommasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
 
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
NO1 Verified Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi A...
 
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Makarba ( Call Girls ) Ahmedabad ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
 
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...Book Sex Workers Available Pune Call Girls Yerwada  6297143586 Call Hot India...
Book Sex Workers Available Pune Call Girls Yerwada 6297143586 Call Hot India...
 
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
 
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
 

Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS

  • 1. Developing Embedded Solutions on Asymmetric Systems using QT Fernando Luiz Cola fernando.cola@emc-logic.com
  • 2. Whoami? Fernando Luiz Cola Embedded Software Developer Emc Logic fernando.cola@emc-logic.com
  • 3. Understand AMP and SMP architecture1 Applications and solution where AMP is a good fit2 Overview I.MX7 Processor3 RPMSG and Inter Processor Communication4 Agenda / Objectives Bottom-up example application with Qt / Linux / FreeRTOS 5
  • 5. Symmetric Multi-Processing Kernel SMP Core1 Core2 OS APP APP APP ◆ Single OS controlling two or more cores of the same architecture ◆ CPU shares memory space ◆ Dynamic Scheduling e load balancing Chip
  • 6. Asymmetric Multi-Processing Multi Core API Core1 Core2 OS APP Chip APP OS / RTOS / Other Task Task ◆ Different OS on each core ◆ Different core architectures ◆ Each core may run full-feature OS, Real-time OS or baremetal code ◆ Inter process communication protocol ◆ Efficient when the application can be statically partitioned across cores
  • 7. Example Multi-Chip System CPU1 MPU Linux Non Critical Task Critical Task Same SoC AMP FreeRTOS CPU MPU Linux Non Critical Task Critical Task FreeRTOS Chip 1 Chip 2 Dedicated Channel Internal Communication External Communication UART / I2C
  • 9. Applications Examples Mobile / Sensor Acquisition
  • 12. NXP I.MX7 Overview ◆ Dual Cortex A7 core + Cortex M4 core ◆ Master/Slave architecture ◆ A7 is the master ◆ M4 is the Slave ◆ Inter processor communication ◆ MU – Message Unit ◆ RDC – Resource Domain Controller
  • 13. NXP I.MX7 Overview RDC – Resource Domain Controller
  • 14. NXP I.MX7 Overview ◆ Enables two processors within the SoC to communicate and coordinate by passing messages( ex: data, status and control) ◆ Signal the other processor using interrupts MU – Message Unit
  • 15. Inter Processor Communication Transport Layer MAC Layer OpenAMP RPMSG VirtIO, Virtqueue, Vring MU, Mailbox, shared memory Shared Memory Inter-Core Interrupts Physical Layer VirtIO / Virtqueu RPMSG
  • 16. RPMSG on Linux User space Kernel space M4 /dev/ttyRP MSG endpoint Platform driver drivers/rpmsg/imx_rpmsg.c VirtIO RPMsg driver drivers/rpmsg/virtio_rpmsg_bus.c RPMsg char driver drivers/rpmsg/rpmsg_char.c Platform bus VirtIO bus RPMsg bus 1 – Register Platform Driver 2 – Register VirtIO Device 3 – Register VirtIO Driver 4 – Register RPMsg device 5 – Register RPMsg driver Remote Core
  • 17. Linux and FreeRTOS talking Linux - Master Domain FreeRTOS – Remote Domain U-boot load and starts M4 Core and Linux Kernel RPMSG driver creates virtqueues and endpoints Notifies remote processor RPMSG driver waits for name service announcement Send/Receive messages RPMSG app creates virtqueues Waits for link being up App creates endpoints and sends name service announcement Send/Receive messages
  • 19. Hybrid Linux Qt / FreeRTOS Demo ● IMU sensor (I2C) read by MCU ● Qt App read data from MCU using RPMSG ● Plot data on Linux using QtCharts
  • 20. Hardware Setup ● Colibri iMX7D 512MB ● Iris Carrier Board ● 7” display ● MPU6050
  • 21. Hardware Setup Master / Linux (A7) Remote / FreeRTOS (M4) MU Shared Memory RPMSG Iris Board + I.MX7 MPU6050 Host PC Uart 1 Uart 2 I2C
  • 22. Qt Development ● Toolchain(cross-compile, rootfs, libraries) generated by Yocto-Project ● Configure Qt Kit for I.MX7 using toolchain generated by Yocto ● QtQuick and QML on i.MX7(no-GPU) Qt 2D Software Rendering ● qputenv("QMLSCENE_DEVICE", QbyteArray("softwarecontext")); ● Chart Visualization via QtCharts − Add to your .pro: QT += charts ● QtCharts is GPLv3!
  • 23. Architecture Overview Kernel space User space /dev/RPMSG rpmsg_char readI2CData Read Data Task Qt App IMU Sensor Rpmsg channel Rpmsg channel Linux FreeRTOS
  • 24. Realtime Class Realtime { id: realtime } class Realtime : public QObject { Q_OBJECT Q_PROPERTY(int accX READ XAcc NOTIFY accChanged) Q_PROPERTY(int accY READ YAcc NOTIFY accChanged) Q_PROPERTY(int accZ READ ZAcc NOTIFY accChanged) ) public: Realtime(QObject *parent = nullptr); virtual ~Realtime(); private: QFile rpmsgDevice; signals: void accChanged(); public slots: void update(); }; Realtime.h Main.qml
  • 25. Realtime Class rpmsDevice.setFileName(“/dev/ttyRPMSG”); rpmsgDevice.open(QIODevice::ReadWrite); qDebug() << "Get Sensor Realtime Data"; if(!rpmsgDevice.isOpen()){ qDebug() << "RPMSG Device not open"; } else { int accx, accy, accz; QByteArray query("acc"); rpmsgDevice.write(query); rpmsgDevice.flush(); QbyteArray response = rpmsgDevice.readLine(64); sscanf(response.constData(), "x:%d,y:%d,z:%d", &accx, &accy, &accz); } Realtime.cpp
  • 26. QML Timer { id: timer property int index: 0 running: true repeat: true interval: 1000 onTriggered: { realtime.update(); accx.append(index,realtime.accX); accy.append(index,realtime.accY); accz.append(index,realtime.accZ); index++; axisX.min++; axisX.max++; } } Main.qml
  • 27. QML Main.qml ChartView { id: chartview animationOptions: ChartView.NoAnimation theme: ChartView.ChartThemeDark antialiasing: true anchors.fill: parent ValueAxis { id: axisX min: -5 max: 5 } ValueAxis { id: axisY min: -10 max: 10 } } LineSeries { id: accx name: "accx" axisY: axisY axisX: axisX } LineSeries { id: accy name: "accy" axisY: axisY axisX: axisX } LineSeries { id: accz name: "accz" axisY: axisY axisX: axisX }
  • 28. Demo Communication between cores https://www.youtube.com/watch?v=SnLAySJPCBU
  • 30. References ● M4 Firmware - https://github.com/ferlzc/Asymmetric_QT_demo_firmware ● QT Application - https://github.com/ferlzc/Asymmetric_QT_demo
  • 31. References ● Linux and Zephry “talking” to each other in the same SoC ● https://events.linuxfoundation.org/wp-content/uploads/2017/12/Linux-and-Zephyr-%E2%80%9C Talking%E2%80%9D-to-Each-Other-in-the-Same-SoC-Diego-Sueiro-Sepura-Embarcados.pdf ● OpenAMP Project Page - https://github.com/OpenAMP/ ● An Introduction to Asymmetric Multiprocessing: When this Architecture can be a Game Changer and How to Survive It (ELC 2018) https://elinux.org/images/6/6e/AMP_-_Kynetics_ELC_2018_Portland.pdf ● Asymetric Multiprocessing and Embedded Linux (ELC 2017) https://elinux.org/images/3/3b/NOVAK_CERVENKA.pdf ● Toradex FreeRTOS on Cortex-M4 of Colibri IMX7 https://developer.toradex.com/knowledge-base/freertos-on-the-cortex-m4-of-a-colibri-imx7