VideoLibrary
Introduction to Zephyr Part 8: Multithreading | DigiKey
In this tutorial, we demonstrate how to run multiple threads in Zephyr RTOS.
Video Player is loading.
Current Time 0:00
Duration 0:00
Loaded: 0%
Stream Type LIVE
Remaining Time 0:00
 
1x
  • Chapters
  • descriptions off, selected
  • subtitles off, selected

      Introduction to Zephyr Part 8: Multithreading | DigiKey

      We show you how multithreading can be used to execute multiple tasks concurrently in Zephyr RTOS, improving system responsiveness and efficiency. This tutorial uses a sample program to demonstrate how to blink an LED and print messages to the console simultaneously by creating and managing threads. You'll learn how to define thread stacks, initialize GPIOs, and manage execution with Zephyr's multithreading APIs. You can find a written version of this tutorial here: https://www.digikey.com/en/maker/tutorials/2025/introduction-to-zephyr-part-8-multithreading The GitHub repository for this course (including solutions to the challenges) can be found here: https://github.com/ShawnHymel/introduction-to-zephyr/tree/main Learn how Zephyr's threading APIs simplify thread creation and synchronization, making it easy to manage independent tasks. Proper stack allocation ensures stable execution, while Devicetree abstractions allow for portable GPIO configurations. This example serves as a foundation for more complex multithreaded applications. From there, we dive into thread synchronization using mutexes. In a separate example, we show how to handle user input/output via serial terminal to update a variable shared between two threads. Access to the variable is protected via mutex (lock). Finally, we give you the challenge of using Zephyr’s message queue system to pass data between threads. We only scratch the surface of multithreading in these examples. While we touch on priorities, mutexes, and semaphores, multithreading can become complicated very quickly. Zephyr's robust support for multithreading makes it an excellent choice for responsive embedded systems. If you would like to learn more about multithreading concepts and real-time operating systems, we recommend checking out our Introduction to RTOS series: https://www.youtube.com/watch?v=F321087yYy4&list=PLEBQazB0HUyQ4hAPU1cJED6t3DU0h34bz

      3/13/2025 5:55:19 PM

      Part List

      图片制造商零件编号描述可供货数量价格查看详情
      ESP32-S3-WROOM-2-N32R8V DEV BRDESP32-S3-DEVKITC-1-N32R8VESP32-S3-WROOM-2-N32R8V DEV BRD0 - 立即发货
      1 : ¥131.33
      散装
      查看详情