In-Depth Notes on ZephyrRTOS (2): Basic Program Structure and Multithreading

In-Depth Notes on ZephyrRTOS (2): Basic Program Structure and Multithreading

I believe that the most important aspect of embedded systems is the scheduler, which I think is also the main value of FreeRTOS. However, in addition to the debugger, ZephyrRTOS offers much more. Main Thread The ZephyrRTOS kernel starts the Main Thread after completing the necessary startup tasks, including the initialization of drivers, before entering … Read more

Introduction to Zephyr C Standard Library

Introduction to Zephyr C Standard Library

C Standard Library Zephyr provides several C standard libraries for users: Generic C Library Minimal libc Newlib Picolibc Generic C Library The Generic C Library is not a complete C standard library; it provides some C library functions to be used in conjunction with other C standard libraries, mainly to address: Providing functionalities that other … Read more

Picolibc: A C Standard Library for Embedded Systems

Picolibc: A C Standard Library for Embedded Systems

Picolibc is a C standard library suitable for small microcontroller embedded systems, which can operate in low memory (RAM) devices. Picolibc is an upgraded version of “newlib-nano” that lacks a mature stdio lib, using a lightweight stdio lib from avrlibc, making it more suitable for low memory embedded devices. Zephyr introduced Picolibc in v3.3.0, and … Read more

Understanding Zephyr Build System Process

Understanding Zephyr Build System Process

The build process of Zephyr is divided into two main stages: the configuration stage and the compilation stage. The configuration stage generates the necessary configuration items, while the compilation stage selects the source code to compile based on the configuration items and links them into the final executable file. The configuration stage is driven by … Read more

Zephyr Timing Measurement

Zephyr Timing Measurement

Zephyr provides a set of timing APIs for measuring code execution time, helping to analyze and optimize code. These timing APIs may use a different timer than the default kernel timer, and the timer used is specified by the architecture, SoC, or board configuration. API The timing APIs are defined in zephyr/include/zephyr/timing/timing.h and will only … Read more

How printf() Works with UART Peripheral Driver Functions

How printf() Works with UART Peripheral Driver Functions

Today, I will share with you the hardware UART peripheral debugging output mechanism under IAR. In the embedded world, outputting print information is a very common auxiliary debugging method. With the help of print information, we can easily locate and analyze program issues. There are many ways to implement print information output in embedded application … Read more

Configuring MinGW in VSCode for C Language

Configuring MinGW in VSCode for C Language

C Language Editor VSCode VSCode is a personal favorite editor software. I have run three terminals simultaneously in VSCode, developing in Python, Golang, and C language. The download link is as follows: code.visualstudio.com Configuring MinGW in VSCode To configure MinGW in VSCode, follow these steps: Install the C/C++ extension from the extensions in VSCode; Create … Read more

C Language File-Writable Account Password Login System

C Language File-Writable Account Password Login System

The account login system is essential in many system designs. Today, this login system has comprehensive features, including registration, login, password recovery, password modification, and a password masking feature that displays * when entering the password. Now, let’s get to the code! Table of Contents 1. Header Files & Structure & Basic Function Implementation 2. … Read more

In-Depth Discussion on Pointer Operations and Address Offsets in C

In-Depth Discussion on Pointer Operations and Address Offsets in C

Question: When performing pointer + operations, how much does the address actually offset? This question is essentially a fundamental issue in C programming. However, I have stumbled on this as well, so I write this as a lesson and a reminder for everyone. We know that the essence of a pointer is a memory address, … Read more

Daily C Language Questions With Explanations

Daily C Language Questions With Explanations

1. The illegal constant is: . A.‘\2’ B. ” ” C.‘3’ D.‘\483’ Answer: D Explanation: A backslash followed by a number is an escape character for an octal number, and octal cannot include the digit 8. 2. The incorrect C language identifier is . A.ABC B.abc C.a_bc D.ab.c Answer: D Explanation: An identifier is defined … Read more