Real Time Zephyr RTOS Embedded C Programming - A Foundational Course.
Andrew Eliasz
Founder and Head at Croydon Tutorial College, Director of First Technology Transfer Ltd.
FTT has been running real time embedded systems programming courses for over 20 years.
Over the years it has developed and taught courses for such RTOS systems as VxWorks, Nucleus, ThreadX, QNX, DSP/BIOS, Symbian as well as embedded Linux both PREEMPT and Xenomai. Zephyr is a relatively new RTOS developed initially by Wind River Systems but now open source. It is quite a sophisticated RTOS with bothnanokernel and microkernel courses, which means that it can be used on machines with limited memory as well as on larger embedded systems. It has been designed with security and IoT application development in mind. It has an interesting build system that makes use of CMake and ninja/make as well as its own meta build tool called West.
My reasons for this article are to get some feedback on the course we have nearly completed the delivery of which is scheduled to start being delivered towards the end of July. This course is a foundational course. This does not mean it is a beginners course as attendees are assumed to have considerable embedded systems C programming knowledge already. Rather it is a practical course aimed at getting programmers up to speed with developing prototype applications. Other more advanced and focused courses are in development and research such as courses dealing with networking applications (WiFi, BLE, Ethernet, CAN etc.), USB - both host and device, IoT security, Kernel build and device driver programming (with an emphasis on mastery of CMake, Kconfig and Device Tree)
The idea is to deliver this course, currently, using a distance based learning approach using either Microsoft Teams or Scala4's FriendOS.
Your suggestions and feedback will be much appreciated. Also, if you are interested in becoming an instructor then do please send a CV and, prefereably, have a go at one of the auditions I have posted (level 6 stars or higher).
Real Time Embedded C Programming using Zephyr RTOS
A Foundational Course.
The emphasis in this course is on programming with the Zephyr RTOS Kernel Services. These days the term Real-Time Operating System (RTOS) is used when referring to an operating system designed for use in embedded microprocessors or controllers. The Real Time part refers to the ability to implement applications that are capable of rapidly responding to external events in a deterministic and predictable manner. RTOS based applications are required to meet strict deadline constraints and meet the requirements of the application. To ensure that urgent operations are handled reliably higher priorities can be assigned to such operations.
Another feature of real time applications is the careful design and implementation of the communication and synchronization between the various tasks. The Zephyr RTOS was developed by Wind River Systems, and subsequently open sourced. Its design and implementation are oriented towards the development of time critical IoT (Internet of Things) and IIoT (Industrial Internet of Things) applications,and, consequently it has a rich feature set for building both wireless and wired networking applications.
This course covers the foundations of programming embedded systems applications using Zephyr's Kernel services. The course will be based on the NRF52840-DK development kit. After introducing the Zephyr architecture as well as the Zephyr build and configuration processes it will focus on multi-tasking and interprocess communication using the Zephyr Kernel Services API. By analogywith embedded Linux courses this course will be analogous to a Linux course that focuses on application development using the Posix API. In this case, however, it will be the Zephyr Kernel Services API that will be the API being used.
The course will cover
- Scheduling, Interrupts and Synchronisation
- Data Passing
- Memory Management
- Timing and timers
- Interrupt handlers
- Advanced programming patterns and idioms
- Object oriented C programming design patterns and idioms
- State machines - Finite, Extended, Statecharts
The course will provide
- Cortex-M4 architecture overview
- Concepts and Patterns of Real-Time multitasking
- Understanding of Real-Time constraints
- Determinism
- Preemption
- Interrupts
- An overview of the Zephyr RTOS architecture
- Various Zephyr services and APIs
- An understanding of the Zephyr West build meta tool, CMake, Ninja and make
- Developing applications using Eclipse CDT with the Eclipse Plug-in for Zephyr
Suitable for which kinds of attendee ?
This course is for software engineers, field engineers and (project) managers planning to build relatively sophisticated IoT and IIoT applications running on, relatively, resource constrained ARM Cortex M0, M4, M7 systems.
Prerequisites :
Attendees must be experienced C programmers with a good basic knowledge of embedded processor architectures and the application of embedded programming concepts.
Hardware used: The standard processor platform used in this course will be the nRF52840 DK development kit. (The course can, however, be tailored to other processors and boards. )
Software development environment: The standard development environment will be Eclipse CDT with the Eclipse Plug-in for Zephyr. (This course can, however, be tailored for other development environments. )
Course duration 5 days.
Course outline:
Overview of the Cortex-M Architecture
- Stacks and stack pointers
- Running-modes and Privileged Levels
- Cortex Mx MPU Overview
- Systick Timer rationale and uses
- Exception / Interrupt Mechanism - An Overview
- Interrut entry and return
- Implementation of interrupt handlers - An Overview
- Overview of IDEs and C Compilers for ARM Cortex M Processors.
Real-Time systems - Architectures and Programming Patterns
- Essential Real-Time Concepts - Hard vs. Soft real time
- Requirements analysis and design of real time systems - an overview
- Advantages of working with an embedded RTOS
- Multi-tasking aspects of Real Time systems analysis and design
- Task scheduling and pre-emption patterns used in Real Time Operating Systems
- RTOS intertask communication mechanisms and patterns
- Zephyr RTOS architecture
- Nanokernel mode
- Microkernel mode
- Layered structure of Zephyr RTOS based applications
- Kernel
- OS Services
- Application Services
- Zephyr RTOS application build process
- Kconfig and CMake - intensive overview
- Zephyr West meta tool and Zephyr Repositories
- Zephyr Device Tree (DT) - A high level overview
Scheduling, Interrupts and Synchronisation
- Threads
- Scheduling
- System Threads
- Workqueue Threads
- Task lifecycles - creating and managing tasks
- The "forever loop" design pattern
- Interrupt driven vs. polling vs. hybrid application designs
- Polling API
- Interrupts
- Semaphores
- Mutexes
- Task mutual exclusion design patterns
- Critical sections
- Deadlocks and Priority Inversion
- - Overview of Symmetric Multiprocessing (SMP) and Zephyr support for SMP
Data Passing
- Queues
- FIFOs
- LIFOs
- Stacks
- Message Queues
- Mailboxes
- Pipes
- Data passing and data sharing patterns
- Producer consumer scenarios
- Dining philosopher's case study - deadlock, livelock and starvation
Memory Management
- - Memory Heaps
- Memory Slabs
- Memory Pools
- Memory based interprocess communication
Timing
- Overview of Kernel Timing
- Timers and their uses
- Timer and workqueue coding patterns and idioms
Interrupt handling patterns and idioms
- Deferred interrupt processing
- Task utilising interrupt synchronisation
- Queues and Interrupt Service Routines (ISRs)
- Interrupt nesting considerations
- One shot and auto-reload timer design patterns and idioms
Memory management design patterns and idioms
- Buddy system
- Multi-level
- Thread safe
- Free memory monitoring and error handling
- Stack monitoring
More advanced data structures and algorithms
- Linked lists (singly and doubly linked)
- Circular buffers and circular lists - FIFOs
- Stacks - LIFOs
- Object oriented patterns and idioms in C
- Finite state machines - logic driven and data driven
- Extended finite state machines
- Statecharts - an overview
Embedded Software developer @ qrtech | Wireless Communications Systems#Embedded software developement
9 个月Hi may I know how to start this course as I am interested to take this course
ex-LTTS| Embedded Software developer | MTech in RVCE
1 年Hi, I'm interested in this course, How can I register for the same ?
Embedded Software Developer
1 年Looks Great. I need training on Zephyr RTOS with the following on Native_posix enumeration platform. -> HTTP Server -> HTTPS Server (by passing TLS certificate) -> MQTT Server -> MQTTS Server (by passing TLS certificate) -> Timers -> Rest Interfaces and Even Handlers I'm ready to go with the training process in immediate base. Can you please check and revert me with the further process. Thank You... G Hemanth Sai, [email protected]
Firmware developer
3 年How may I start this cource
Firmware Engineer at Renesas Electronics
3 年I am interested to attend this course. Is it still available?