CLion Tutorial: Multithreading RTOS Debugging

CLion Tutorial: Multithreading RTOS Debugging

When debugging with RTOS, CLion provides views for FreeRTOS, Azure RTOS, and Zephyr tasks (threads). For FreeRTOS, you can also explore objects and the heap. Some gdb servers have built-in support for different RTOS. To ensure proper integration with CLion, make sure to disable built-in support on the gdb server side. To enable the RTOS … Read more

Building MCUBoot for ESP32-C3 Under Zephyr

Building MCUBoot for ESP32-C3 Under Zephyr

The article on building the ESP Bootloader under Zephyr for ESP32-C3 mentions that Zephyr also supports booting from MCUBoot: ROM-> MCUboot -> Zephyr.bin ( App ) As previously explained about the ROM, this article focuses on analyzing the booting part of MCUboot. Building Using west -v build -b esp32c3_zgp –sysbuild zephyr_sample/ — -DBOARD_ROOT=/mnt/g/project/v3.4.0/zephyr_sample/ -Dmcuboot_BOARD_ROOT=/mnt/g/project/v3.4.0/zephyr_sample/ to … Read more

Setting Up ESP32-S3 Development Environment with Zephyr

Setting Up ESP32-S3 Development Environment with Zephyr

The Zephyr development environment supports three major operating systems: Windows, Linux, and MacOS. However, the most comprehensive support is for Linux, so it is recommended to use Linux for beginners. This article is based on Ubuntu 22.04. In some sense, this is a rehash of previous articles because similar content has been covered: Building Zephyr … Read more

Zephyr Kernel Data Structures – Singly Linked List

Zephyr Kernel Data Structures - Singly Linked List

Singly Linked List The Zephyr singly linked list is implemented in the following file: zephyr/include/zephyr/sys/slist.h. Zephyr stores singly linked list data in sys_slist_t (i.e., each list element stores a pointer to the next element, rather than the data of the previous element). /** @cond INTERNAL_HIDDEN */ struct _slist { sys_snode_t *head; sys_snode_t *tail; }; /** … Read more

Common Data Structures in Zephyr Kernel

Common Data Structures in Zephyr Kernel

This article provides an overview without technical details or usage instructions. The Zephyr kernel uses a generic data structure library, which can also be utilized in applications. The data structures include: Linked List Packet Buffer Red-Black Tree Circular Buffer It is important to note that the APIs for accessing these data structures are not thread-safe. … Read more

Zephyr Kernel Data Structure – MPSC

Zephyr Kernel Data Structure - MPSC

Overview MPSC_PBUF (Multi Producer Single Consumer Packet Buffer) is a circular buffer where data in MPSC_PBUF is managed in packets, and the size of the packets is variable. Users read or store data from MPSC_PBUF in packet units. To reduce data copying in memory, data production is divided into two steps: allocating packet space and … Read more

Zephyr Kernel Data Structures – Red-Black Tree

Zephyr Kernel Data Structures - Red-Black Tree

Overview The search time complexity of a linked list is O(N). As the number of members managed by the linked list increases, the algorithmic cost of searching increases. To address this, Zephyr provides an implementation of a red-black tree, where the time complexity for search and delete operations is O(log2(N)) for a tree of size … Read more

Building ESP Bootloader for ESP32C3 in Zephyr

Building ESP Bootloader for ESP32C3 in Zephyr

In Zephyr, there are two boot processes for the ESP32 series SOC: No MCUboot: ROM-> ESP Bootloader-> Zephyr.bin (App) With MCUboot: ROM-> MCUboot -> Zephyr.bin (App) This article focuses on the no MCUboot part. ROM In ESP32C3, the ROM is referred to as the “First stage bootloader”. The ROM is hard-coded into the ESP32C3 and … Read more

Zephyr Kernel Data Structures – Ring Buffer

Zephyr Kernel Data Structures - Ring Buffer

Overview The ring buffer is one of the commonly used data structures in embedded software development, storing content in a first-in-first-out manner, and is used to implement asynchronous “stream” replication of data. Zephyr provides a struct ring_buf abstraction to manage such data structures. Various drivers in Zephyr (UART, Modem, I2S, etc.), as well as shell, … Read more

Understanding Zephyr System Timer Implementation

Understanding Zephyr System Timer Implementation

The kernel time of Zephyr is driven by sys_clock_announce. Regardless of the SOC type, the system timer is driven by interfacing with this API. For details, refer to the Zephyr Tick Clock Introduction. All system timer drivers for Zephyr are located under zephyr/drivers/timer. How Zephyr Chooses Which Driver to Use All system timer drivers supported … Read more