SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
Zephyr RTOS in
One Hour
Pavel Hübner <pavel.hubner@hardwario.com>
CTO & Co-founder at HARDWARIO
Zephyr RTOS I.
❏ Scalable, secure & safe
❏ Friendly for low-power applications
❏ Designed with IoT projects in mind
❏ Vast range of connectivity options
❏ Integrates with MCUboot bootloader
❏ Encourages portability & code re-usability
❏ Protects investments to your code by
imposing low-maintenance requirements
❏ But there is a learning curve…
Zephyr RTOS II.
❏ Operating system for microcontrollers (minimum = 32 bits)
❏ Inspired by Linux kernel, backed by Linux Foundation
❏ Big vendors: Intel, Facebook, Google, NXP, Nordic Semiconductor, …
❏ Homepage: https://www.zephyrproject.org/
❏ Documentation: https://docs.zephyrproject.org/latest/
❏ GitHub: https://github.com/zephyrproject-rtos/zephyr
❏ 74,000+ commits
nRF Connect SDK
❏ Additional layer on top of the Zephyr RTOS
❏ Provides extra support for nRF5x / nRF91 SOCs
❏ BLE (SoftDevice) stack support, Thread, Matter, …
❏ Maintained only by Nordic Semiconductor
❏ Homepage: https://bit.ly/33pdPT1
❏ Documentation: https://bit.ly/3ndUDyv
❏ GitHub: https://github.com/nrfconnect/sdk-nrf
❏ 13,000+ commits
CHESTER Platform
❏ Configurable IoT gateway for industrial IoT applications
❏ Connectivity (NB-IoT, LTE-M, LoRaWAN, Astrocast, BLE, GNSS)
❏ Extensibility (CHESTER-X, CHESTER-Z, CHESTER-A, …)
❏ Power supply flexibility (LiSoCl2
3.6 V, Li-Ion, 24 VDC
, 230 VAC
, PV panels)
❏ Introduction video: https://youtu.be/YvKjCou68jw
❏ Product homepage: https://www.hardwario.com/chester/
❏ Product manual: https://docs.hardwario.com/chester/
❏ Open platform for HARDWARIO partners with full OEM customization
❏ Applications: Industrial IoT projects
Firmware landscape
BLE
nRF52840
Application
LTE
nRF9160
Serial modem
LoRaWAN
Murata
Serial modem
CHESTER SDK
is for this part
SWD
connector
SWD
connector
SWD
connector
Software stack
Onion-like layering but in a flat folder structure…
Zephyr RTOS
nRF Connect SDK
CHESTER SDK
Your application
Requirements
❏ Basic software development skills
❏ Operating system: Linux, macOS , Windows 10/11
❏ Reasonably fast machine (SSD, CPU, RAM)
❏ CHESTER (developer's edition)
❏ SEGGER J-Link (flashing + debugging)
❏ Recommended: Power Profiler Kit II
❏ Recommended: Visual Studio Code
(though any editor will work)
Software tools
❏ Compiler toolchain - Zephyr SDK 0.15.1
❏ CMake build generator (default build system = Ninja)
❏ Zephyr meta-tool West:
❏ Git repository management (multirepository)
❏ Build invocation
❏ Target flashing
❏ Target debugging
❏ nRF Command Line Tools (nrfjprog + SEGGER tools)
❏ nRF Connect for Desktop - Programmer, Power Profiler,
Toochain Manager, Bluetooth Low Energy, …
❏ nRF Device Manager - Bluetooth scanner + DFU firmware updates over BLE
❏ Bluefruit Connect (iOS / Android) - Shell interaction (through emulated UART)
❏ HARDWARIO Manager (iOS / Android) - Mobile app for CHESTER management
❏ HARDWARIO Monitor (cross-platform desktop app; implementation Qt 6 / C++)
❏ HARDWARIO Command Line Tools
West workspace
❏ Top-most folder contains .west directory
❏ File .west/config points to top-most manifest file
❏ Manifest file defines Git remote, Git projects + their path
❏ Recursive manifest file importing
❏ Definition of project self-placement
in West workspace
Workspace setup
❏ Initialize West workspace: west init
❏ Exploring workspace folder structure…
❏ All top-level folder are Git repositories
❏ Folder chester (SDK repo content):
❏ Folder applications - reference fully-fledged projects
❏ Folder boards - board definitions + DTS
❏ Folder drivers - device drivers following Device Driver Model
❏ Folder dts - Device Tree bindings + overlays
❏ Folder include - include headers (public interfaces)
❏ Folder lib - generic libraries
❏ Folder samples - minimalistic applications for various functions
❏ Folder scripts - helper scripts (also extensions to West)
❏ Folder subsys - independent subsystems (i.e. LTE, LoRaWAN, etc.)
❏ Folder zephyr - contains module.yaml defining basic paths in project
Basic workflow
❏ Define application requirements
❏ Repeat until the state of pure happiness:
❏ Edit source code
❏ Build application: west build (all output is in the build folder)
❏ Flash application: west flash
❏ Interact with the application in HARDWARIO Console / Monitor
❏ Eventually, debug the application: west debug / west attach
❏ Usually access to logging and shell
is very sufficient and traditional debugging is not needed
❏ Deploy application (create Git tag)
❏ Use continuous integration (nRF Connect SDK Docker image)
Build system
❏ Build system generator = CMake
❏ Default build system = ninja
❏ Everything is defined in a
human-friendly CMakeLists.txt
❏ No direct invocation is needed
❏ Execution is handled by west
❏ New directories with CMakeLists.txt
can be conditionally added via:
add_subdirectory_ifdef(CONFIG_SERIAL serial)
Kconfig system
❏ Heritage from Linux kernel
❏ Domain-specific language
❏ Defines existence and relationships
between build-time options
❏ Preprocessing before build
❏ Option selection via <board>_defconfig + prj.conf + optional overlays
❏ Result: autoconf.h full of #define CONFIG_<option> <value>
❏ Force-included into each file in the build
❏ Options should be checked in code via:
❏ #if CONFIG_<option>
❏ if (IS_ENABLED(CONFIG_<option>))
Device Tree system
❏ Heritage from Linux kernel
❏ Domain-specific language
❏ Describes hardware model in a tree-like structure
❏ Zero overhead in target environment
❏ Result: devicetree_unfixed.h
❏ Included via #include <kernel/devicetree.h>
❏ Binding example 1:
const struct device *dev = DEVICE_DT_GET(
DT_PARENT(DT_NODELABEL(node_label)));
❏ Binding example 2:
const struct device *dev = device_get_binding("LABEL");
Zephyr fundamentals I.
❏ Thread manipulation:
❏ Thread object - k_thread
❏ k_thread_init() or K_THREAD_DEFINE()
❏ k_sleep() - mostly used with macros:
❏ K_MSEC(n), K_SECONDS(n), K_FOREVER, …
❏ k_yield()
❏ Workqueue threads
❏ System or dedicated workqueue
❏ k_work_submit()
❏ Atomic services:
❏ atomic_t
❏ atomic_set()
❏ atomic_get()
Zephyr fundamentals II.
❏ Synchronization objects:
❏ Mutex object - k_mutex
❏ Semaphore object - k_sem
❏ Signal object - k_signal
❏ Data passing objects:
❏ FIFO object - k_fifo
❏ Pipe object - k_pipe
❏ Message queue object - k_msgq
❏ Ring buffer object - ringbuf
❏ Object polling:
❏ Wait on event from 1 or more sources
❏ k_poll()
Zephyr fundamentals III.
❏ Mutex services:
❏ K_MUTEX_DEFINE() or k_mutex_init()
❏ k_mutex_lock()
❏ k_mutex_unlock() - never forget…
❏ Pitfall = deadlock
❏ Timer control:
❏ k_timer_init() or K_TIMER_DEFINE()
❏ k_timer_start()
❏ Interrupt context
❏ Critical error:
❏ k_oops()
❏ Watchdog timer is advised to be enabled
Useful tips & tricks
❏ Pristine build: west build -t pristine
❏ Start from clean table: rm -rf build
❏ Start Kconfig wizard (terminal): west build -t menuconfig
❏ Start Kconfig wizard (GUI): west build -t guiconfig
❏ Processed Device Tree: devicetree_unfixed.h
❏ Processed Kconfig output: autoconf.h
❏ Output artifacts: zephyr.hex / zephyr.bin / zephyr.elf
❏ With bootloader: merged.hex / app_update.bin
❏ Build errors from compiler → start from top
❏ Build errors from linker → start from bottom
Logging subsystem
❏ Zero to N backend architecture
❏ Backends: UART, RTT, BLE, …
❏ Logger definition per module
❏ Individual log level - should be passed via Kconfig
❏ Logger module registration:
LOG_MODULE_REGISTER(ctr_lte_if, CONFIG_CTR_LTE_IF_LOG_LEVEL);
❏ Four basic log levels:
❏ Error - LOG_ERR("...")
❏ Warning - LOG_WRN("...")
❏ Info - LOG_INF("...")
❏ Debug - LOG_DBG("...")
❏ Logging macros support full printf-style formatting
Shell subsystem
❏ Zero to N backend architecture
❏ Backends: UART, RTT, BLE, …
❏ Shell-alike interaction with a microcontroller
❏ Command definition in a tree structure
❏ Help navigation is provided
❏ Commands are defined per module
❏ Allows definitions without module cross-dependencies
❏ Several useful built-in commands:
❏ help
❏ kernel threads
❏ kernel stacks
❏ kernel uptime
❏ kernel reboot cold
Settings subsystem
❏ Multiple storage formats:
❏ NVS, LittleFS, FAT, …
❏ Multiple storage media:
❏ Internal flash, NOR flash, eMMC, …
❏ Today: NVS in internal flash
❏ Future: LittleFS + possibility to download file over BLE
❏ No need to change implementation,
just a matter of configuration
❏ Settings handler registered per module
❏ Settings = simple key/value storage
❏ A bit of boilerplate code to enable it on module
❏ Penalty for robustness
Demo
CHESTER DevKit
https://shop.hardwario.com/chester-devkit/
❏ 20% discount - use voucher iotnorth
❏ Voucher valid only until Feb 12, 2023
Meet us in person:
1. Zephyr booth at Embedded World
March 14-16, 2023 in Nuremberg
2. Zephyr Developer Summit
June 27-30, 2023 in Prague

Más contenido relacionado

La actualidad más candente

Yocto project and open embedded training
Yocto project and open embedded trainingYocto project and open embedded training
Yocto project and open embedded trainingH Ming
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling ToolsTIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling ToolsXiaozhe Wang
 
Introduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversIntroduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversRajKumar Rampelli
 
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
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniquesSatpal Parmar
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introductionYi-Hsiu Hsu
 
Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yoctoAlex Gonzalez
 
Linux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisLinux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisPaul V. Novarese
 
Linux Kernel Module - For NLKB
Linux Kernel Module - For NLKBLinux Kernel Module - For NLKB
Linux Kernel Module - For NLKBshimosawa
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debuggingHao-Ran Liu
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchlinuxlab_conf
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardAnne Nicolas
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBshimosawa
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelDivye Kapoor
 

La actualidad más candente (20)

Yocto project and open embedded training
Yocto project and open embedded trainingYocto project and open embedded training
Yocto project and open embedded training
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
Toolchain
ToolchainToolchain
Toolchain
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling ToolsTIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
TIP1 - Overview of C/C++ Debugging/Tracing/Profiling Tools
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Introduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversIntroduction to Kernel and Device Drivers
Introduction to Kernel and Device Drivers
 
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...
 
Debugging linux kernel tools and techniques
Debugging linux kernel tools and  techniquesDebugging linux kernel tools and  techniques
Debugging linux kernel tools and techniques
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introduction
 
Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yocto
 
Linux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisLinux Crash Dump Capture and Analysis
Linux Crash Dump Capture and Analysis
 
Linux Kernel Module - For NLKB
Linux Kernel Module - For NLKBLinux Kernel Module - For NLKB
Linux Kernel Module - For NLKB
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 

Similar a Zephyr RTOS in One Hour | HARDWARIO @ IoT North UK

Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned RightScale
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modulesEddy Reyes
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Xavier Hallade
 
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012DefCamp
 
Defcon 27 - Writing custom backdoor payloads with C#
Defcon 27 - Writing custom backdoor payloads with C#Defcon 27 - Writing custom backdoor payloads with C#
Defcon 27 - Writing custom backdoor payloads with C#Mauricio Velazco
 
Tuning systemd for embedded
Tuning systemd for embeddedTuning systemd for embedded
Tuning systemd for embeddedAlison Chaiken
 
Nomad + Flatcar: a harmonious marriage of lightweights
Nomad + Flatcar: a harmonious marriage of lightweightsNomad + Flatcar: a harmonious marriage of lightweights
Nomad + Flatcar: a harmonious marriage of lightweightsIago López Galeiras
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux DevelopersOpersys inc.
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 
Developing with-devstack
Developing with-devstackDeveloping with-devstack
Developing with-devstackDeepak Garg
 
開放運算&GPU技術研究班
開放運算&GPU技術研究班開放運算&GPU技術研究班
開放運算&GPU技術研究班Paul Chao
 
Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015Giorgio Cefaro
 
Talk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopTalk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopQuey-Liang Kao
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentMohammed Farrag
 
The internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesThe internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesAkihiro Suda
 

Similar a Zephyr RTOS in One Hour | HARDWARIO @ IoT North UK (20)

Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)Using the Android Native Development Kit (NDK)
Using the Android Native Development Kit (NDK)
 
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
Hunting and Exploiting Bugs in Kernel Drivers - DefCamp 2012
 
Defcon 27 - Writing custom backdoor payloads with C#
Defcon 27 - Writing custom backdoor payloads with C#Defcon 27 - Writing custom backdoor payloads with C#
Defcon 27 - Writing custom backdoor payloads with C#
 
Tuning systemd for embedded
Tuning systemd for embeddedTuning systemd for embedded
Tuning systemd for embedded
 
Nomad + Flatcar: a harmonious marriage of lightweights
Nomad + Flatcar: a harmonious marriage of lightweightsNomad + Flatcar: a harmonious marriage of lightweights
Nomad + Flatcar: a harmonious marriage of lightweights
 
Android for Embedded Linux Developers
Android for Embedded Linux DevelopersAndroid for Embedded Linux Developers
Android for Embedded Linux Developers
 
Linux Device Driver’s
Linux Device Driver’sLinux Device Driver’s
Linux Device Driver’s
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Cuda 2011
Cuda 2011Cuda 2011
Cuda 2011
 
Driver_linux
Driver_linuxDriver_linux
Driver_linux
 
Developing with-devstack
Developing with-devstackDeveloping with-devstack
Developing with-devstack
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
開放運算&GPU技術研究班
開放運算&GPU技術研究班開放運算&GPU技術研究班
開放運算&GPU技術研究班
 
Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015Import golang; struct microservice - Codemotion Rome 2015
Import golang; struct microservice - Codemotion Rome 2015
 
Talk 160920 @ Cat System Workshop
Talk 160920 @ Cat System WorkshopTalk 160920 @ Cat System Workshop
Talk 160920 @ Cat System Workshop
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports Development
 
The internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesThe internals and the latest trends of container runtimes
The internals and the latest trends of container runtimes
 

Último

Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311  Call Girls in Thane , Independent Escort Service ThanePallawi 9167673311  Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service ThanePooja Nehwal
 
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查awo24iot
 
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
(=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)kojalkojal131
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Pooja Nehwal
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | DelhiFULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhisoniya singh
 
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Pooja Nehwal
 
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...ranjana rawat
 
presentation about microsoft power point
presentation about microsoft power pointpresentation about microsoft power point
presentation about microsoft power pointchhavia330
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...Pooja Nehwal
 
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...Suhani Kapoor
 
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 Bookingroncy bisnoi
 
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...Pooja Nehwal
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...Call Girls in Nagpur High Profile
 
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escortsranjana rawat
 

Último (20)

Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311  Call Girls in Thane , Independent Escort Service ThanePallawi 9167673311  Call Girls in Thane , Independent Escort Service Thane
Pallawi 9167673311 Call Girls in Thane , Independent Escort Service Thane
 
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
如何办理(Adelaide毕业证)阿德莱德大学毕业证成绩单Adelaide学历认证真实可查
 
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(ANIKA) Wanwadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
(=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)
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
 
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
young call girls in Sainik Farm 🔝 9953056974 🔝 Delhi escort Service
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
Call Girls In Andheri East Call 9892124323 Book Hot And Sexy Girls,
 
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Ravet ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | DelhiFULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
FULL ENJOY - 8264348440 Call Girls in Hauz Khas | Delhi
 
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
Call Girls in Thane 9892124323, Vashi cAll girls Serivces Juhu Escorts, powai...
 
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(MEGHA) Hinjewadi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
 
presentation about microsoft power point
presentation about microsoft power pointpresentation about microsoft power point
presentation about microsoft power point
 
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...High Profile Call Girls In Andheri 7738631006 Call girls in mumbai  Mumbai ...
High Profile Call Girls In Andheri 7738631006 Call girls in mumbai Mumbai ...
 
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...
VIP Call Girls Hitech City ( Hyderabad ) Phone 8250192130 | ₹5k To 25k With R...
 
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
 
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
9892124323, Call Girl in Juhu Call Girls Services (Rate ₹8.5K) 24×7 with Hote...
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
 
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Bhavna Call 7001035870 Meet With Nagpur Escorts
 

Zephyr RTOS in One Hour | HARDWARIO @ IoT North UK

  • 1. Zephyr RTOS in One Hour Pavel Hübner <pavel.hubner@hardwario.com> CTO & Co-founder at HARDWARIO
  • 2. Zephyr RTOS I. ❏ Scalable, secure & safe ❏ Friendly for low-power applications ❏ Designed with IoT projects in mind ❏ Vast range of connectivity options ❏ Integrates with MCUboot bootloader ❏ Encourages portability & code re-usability ❏ Protects investments to your code by imposing low-maintenance requirements ❏ But there is a learning curve…
  • 3. Zephyr RTOS II. ❏ Operating system for microcontrollers (minimum = 32 bits) ❏ Inspired by Linux kernel, backed by Linux Foundation ❏ Big vendors: Intel, Facebook, Google, NXP, Nordic Semiconductor, … ❏ Homepage: https://www.zephyrproject.org/ ❏ Documentation: https://docs.zephyrproject.org/latest/ ❏ GitHub: https://github.com/zephyrproject-rtos/zephyr ❏ 74,000+ commits
  • 4. nRF Connect SDK ❏ Additional layer on top of the Zephyr RTOS ❏ Provides extra support for nRF5x / nRF91 SOCs ❏ BLE (SoftDevice) stack support, Thread, Matter, … ❏ Maintained only by Nordic Semiconductor ❏ Homepage: https://bit.ly/33pdPT1 ❏ Documentation: https://bit.ly/3ndUDyv ❏ GitHub: https://github.com/nrfconnect/sdk-nrf ❏ 13,000+ commits
  • 5. CHESTER Platform ❏ Configurable IoT gateway for industrial IoT applications ❏ Connectivity (NB-IoT, LTE-M, LoRaWAN, Astrocast, BLE, GNSS) ❏ Extensibility (CHESTER-X, CHESTER-Z, CHESTER-A, …) ❏ Power supply flexibility (LiSoCl2 3.6 V, Li-Ion, 24 VDC , 230 VAC , PV panels) ❏ Introduction video: https://youtu.be/YvKjCou68jw ❏ Product homepage: https://www.hardwario.com/chester/ ❏ Product manual: https://docs.hardwario.com/chester/ ❏ Open platform for HARDWARIO partners with full OEM customization ❏ Applications: Industrial IoT projects
  • 6. Firmware landscape BLE nRF52840 Application LTE nRF9160 Serial modem LoRaWAN Murata Serial modem CHESTER SDK is for this part SWD connector SWD connector SWD connector
  • 7. Software stack Onion-like layering but in a flat folder structure… Zephyr RTOS nRF Connect SDK CHESTER SDK Your application
  • 8. Requirements ❏ Basic software development skills ❏ Operating system: Linux, macOS , Windows 10/11 ❏ Reasonably fast machine (SSD, CPU, RAM) ❏ CHESTER (developer's edition) ❏ SEGGER J-Link (flashing + debugging) ❏ Recommended: Power Profiler Kit II ❏ Recommended: Visual Studio Code (though any editor will work)
  • 9. Software tools ❏ Compiler toolchain - Zephyr SDK 0.15.1 ❏ CMake build generator (default build system = Ninja) ❏ Zephyr meta-tool West: ❏ Git repository management (multirepository) ❏ Build invocation ❏ Target flashing ❏ Target debugging ❏ nRF Command Line Tools (nrfjprog + SEGGER tools) ❏ nRF Connect for Desktop - Programmer, Power Profiler, Toochain Manager, Bluetooth Low Energy, … ❏ nRF Device Manager - Bluetooth scanner + DFU firmware updates over BLE ❏ Bluefruit Connect (iOS / Android) - Shell interaction (through emulated UART) ❏ HARDWARIO Manager (iOS / Android) - Mobile app for CHESTER management ❏ HARDWARIO Monitor (cross-platform desktop app; implementation Qt 6 / C++) ❏ HARDWARIO Command Line Tools
  • 10. West workspace ❏ Top-most folder contains .west directory ❏ File .west/config points to top-most manifest file ❏ Manifest file defines Git remote, Git projects + their path ❏ Recursive manifest file importing ❏ Definition of project self-placement in West workspace
  • 11. Workspace setup ❏ Initialize West workspace: west init ❏ Exploring workspace folder structure… ❏ All top-level folder are Git repositories ❏ Folder chester (SDK repo content): ❏ Folder applications - reference fully-fledged projects ❏ Folder boards - board definitions + DTS ❏ Folder drivers - device drivers following Device Driver Model ❏ Folder dts - Device Tree bindings + overlays ❏ Folder include - include headers (public interfaces) ❏ Folder lib - generic libraries ❏ Folder samples - minimalistic applications for various functions ❏ Folder scripts - helper scripts (also extensions to West) ❏ Folder subsys - independent subsystems (i.e. LTE, LoRaWAN, etc.) ❏ Folder zephyr - contains module.yaml defining basic paths in project
  • 12. Basic workflow ❏ Define application requirements ❏ Repeat until the state of pure happiness: ❏ Edit source code ❏ Build application: west build (all output is in the build folder) ❏ Flash application: west flash ❏ Interact with the application in HARDWARIO Console / Monitor ❏ Eventually, debug the application: west debug / west attach ❏ Usually access to logging and shell is very sufficient and traditional debugging is not needed ❏ Deploy application (create Git tag) ❏ Use continuous integration (nRF Connect SDK Docker image)
  • 13. Build system ❏ Build system generator = CMake ❏ Default build system = ninja ❏ Everything is defined in a human-friendly CMakeLists.txt ❏ No direct invocation is needed ❏ Execution is handled by west ❏ New directories with CMakeLists.txt can be conditionally added via: add_subdirectory_ifdef(CONFIG_SERIAL serial)
  • 14. Kconfig system ❏ Heritage from Linux kernel ❏ Domain-specific language ❏ Defines existence and relationships between build-time options ❏ Preprocessing before build ❏ Option selection via <board>_defconfig + prj.conf + optional overlays ❏ Result: autoconf.h full of #define CONFIG_<option> <value> ❏ Force-included into each file in the build ❏ Options should be checked in code via: ❏ #if CONFIG_<option> ❏ if (IS_ENABLED(CONFIG_<option>))
  • 15. Device Tree system ❏ Heritage from Linux kernel ❏ Domain-specific language ❏ Describes hardware model in a tree-like structure ❏ Zero overhead in target environment ❏ Result: devicetree_unfixed.h ❏ Included via #include <kernel/devicetree.h> ❏ Binding example 1: const struct device *dev = DEVICE_DT_GET( DT_PARENT(DT_NODELABEL(node_label))); ❏ Binding example 2: const struct device *dev = device_get_binding("LABEL");
  • 16. Zephyr fundamentals I. ❏ Thread manipulation: ❏ Thread object - k_thread ❏ k_thread_init() or K_THREAD_DEFINE() ❏ k_sleep() - mostly used with macros: ❏ K_MSEC(n), K_SECONDS(n), K_FOREVER, … ❏ k_yield() ❏ Workqueue threads ❏ System or dedicated workqueue ❏ k_work_submit() ❏ Atomic services: ❏ atomic_t ❏ atomic_set() ❏ atomic_get()
  • 17. Zephyr fundamentals II. ❏ Synchronization objects: ❏ Mutex object - k_mutex ❏ Semaphore object - k_sem ❏ Signal object - k_signal ❏ Data passing objects: ❏ FIFO object - k_fifo ❏ Pipe object - k_pipe ❏ Message queue object - k_msgq ❏ Ring buffer object - ringbuf ❏ Object polling: ❏ Wait on event from 1 or more sources ❏ k_poll()
  • 18. Zephyr fundamentals III. ❏ Mutex services: ❏ K_MUTEX_DEFINE() or k_mutex_init() ❏ k_mutex_lock() ❏ k_mutex_unlock() - never forget… ❏ Pitfall = deadlock ❏ Timer control: ❏ k_timer_init() or K_TIMER_DEFINE() ❏ k_timer_start() ❏ Interrupt context ❏ Critical error: ❏ k_oops() ❏ Watchdog timer is advised to be enabled
  • 19. Useful tips & tricks ❏ Pristine build: west build -t pristine ❏ Start from clean table: rm -rf build ❏ Start Kconfig wizard (terminal): west build -t menuconfig ❏ Start Kconfig wizard (GUI): west build -t guiconfig ❏ Processed Device Tree: devicetree_unfixed.h ❏ Processed Kconfig output: autoconf.h ❏ Output artifacts: zephyr.hex / zephyr.bin / zephyr.elf ❏ With bootloader: merged.hex / app_update.bin ❏ Build errors from compiler → start from top ❏ Build errors from linker → start from bottom
  • 20. Logging subsystem ❏ Zero to N backend architecture ❏ Backends: UART, RTT, BLE, … ❏ Logger definition per module ❏ Individual log level - should be passed via Kconfig ❏ Logger module registration: LOG_MODULE_REGISTER(ctr_lte_if, CONFIG_CTR_LTE_IF_LOG_LEVEL); ❏ Four basic log levels: ❏ Error - LOG_ERR("...") ❏ Warning - LOG_WRN("...") ❏ Info - LOG_INF("...") ❏ Debug - LOG_DBG("...") ❏ Logging macros support full printf-style formatting
  • 21. Shell subsystem ❏ Zero to N backend architecture ❏ Backends: UART, RTT, BLE, … ❏ Shell-alike interaction with a microcontroller ❏ Command definition in a tree structure ❏ Help navigation is provided ❏ Commands are defined per module ❏ Allows definitions without module cross-dependencies ❏ Several useful built-in commands: ❏ help ❏ kernel threads ❏ kernel stacks ❏ kernel uptime ❏ kernel reboot cold
  • 22. Settings subsystem ❏ Multiple storage formats: ❏ NVS, LittleFS, FAT, … ❏ Multiple storage media: ❏ Internal flash, NOR flash, eMMC, … ❏ Today: NVS in internal flash ❏ Future: LittleFS + possibility to download file over BLE ❏ No need to change implementation, just a matter of configuration ❏ Settings handler registered per module ❏ Settings = simple key/value storage ❏ A bit of boilerplate code to enable it on module ❏ Penalty for robustness
  • 23. Demo
  • 24. CHESTER DevKit https://shop.hardwario.com/chester-devkit/ ❏ 20% discount - use voucher iotnorth ❏ Voucher valid only until Feb 12, 2023 Meet us in person: 1. Zephyr booth at Embedded World March 14-16, 2023 in Nuremberg 2. Zephyr Developer Summit June 27-30, 2023 in Prague