Quick Understanding of FreeRTOS Code Standards

Quick Understanding of FreeRTOS Code Standards

Follow “Engineer Advancement Notes” and select “Star Public Account” to progress together! [Introduction] Some friends feel that the FreeRTOS kernel code looks unfamiliar and are not used to its coding style. This article will outline its coding standards to improve the efficiency of reading its code. The code is based on FreeRTOS V10.4.3. FreeRTOS Code … Read more

Adding FINSH Console to FreeRTOS

Adding FINSH Console to FreeRTOS

1 FINSH ConsoleWith the console, we can reduce trial and error costs when debugging hardware, change PID parameters in real-time without needing to reprogram, and customize commands to call serial API for testing communication protocols. This article summarizes the entire porting process.2 Preparation Before Porting2.1 Testing EnvironmentThis test is an extension based on the io_toggle … Read more

Memory Allocators in FreeRTOS: heap1 to heap5 (Part 3)

Memory Allocators in FreeRTOS: heap1 to heap5 (Part 3)

heap1   Design Concept  Using fixed-size memory blocks divided into multiple equal-sized memory blocks.      Usage Process   1  Initialization  2  Call  Using xNextFreeByte as a marker, find the starting address of the unallocated bytes and return the byte position 3  Release  Not supported Understanding pvPortMalloc()   Memory allocation needs to consider two aspects of byte alignment     1  Memory allocation byte alignment  2  Memory heap starting address byte alignment   … Read more

Understanding Task Scheduling in FreeRTOS

Understanding Task Scheduling in FreeRTOS

1. Task Scheduling FreeRTOS is a lightweight real-time operating system kernel, and one of its core functions is task scheduling. Task scheduling is the core mechanism of FreeRTOS, determining which task runs at any given moment, when to switch tasks, and how to handle task priorities. 1.1. Task Definition Task “Task” is the basic execution … Read more

Advantages of Running RTOS on Microcontrollers Compared to Bare Metal

Advantages of Running RTOS on Microcontrollers Compared to Bare Metal

Author | strongerHuangWeChat Official Account | Embedded ColumnRecently, I have been asked similar questions: Do I have to learn RTOS when studying microcontrollers? Is there still a future for bare metal development? For microcontroller projects, should I choose bare metal development or RTOS development? Are there still companies using bare metal for projects? …… Many … Read more

How to Solve Priority Inversion in FreeRTOS?

How to Solve Priority Inversion in FreeRTOS?

In embedded systems, real-time operating systems (RTOS) like FreeRTOS are widely used for managing multitasking scheduling. However, priority inversion is a common issue that can cause high-priority tasks to be delayed by low-priority tasks, affecting the system’s real-time performance. This article will delve into the causes of priority inversion, utilizing mechanisms provided by FreeRTOS, and … Read more

What to Do When You Encounter Stack Overflow While Porting RTOS?

What to Do When You Encounter Stack Overflow While Porting RTOS?

Click the above blue text to follow us In embedded systems, RTOS meets strict timing requirements by managing multiple tasks. Task stack management is a critical aspect of RTOS development, especially when porting RTOS to new hardware platforms. Stack overflow is a common error in embedded development that can lead to memory corruption, unpredictable system … Read more

NXP S32K312 Development Board Review | Based on S32K312 – Implementing a Small Desk Lamp Function Using ADC to Control PWM Duty Cycle

NXP S32K312 Development Board Review | Based on S32K312 - Implementing a Small Desk Lamp Function Using ADC to Control PWM Duty Cycle

▲ Click ☆ to star me, in case of losing contact Project Introduction This trial project is based on the NXP S32K312 series core board, aiming to collect the analog signal from a potentiometer using the ADC (Analog-to-Digital Converter) to control the duty cycle of PWM (Pulse Width Modulation), thereby achieving the manual dimming function … Read more

How to Detect Memory Leaks in FreeRTOS

How to Detect Memory Leaks in FreeRTOS

Click on the aboveblue text to follow us In embedded systems, memory resources are often very limited, and memory leaks can lead to degraded system performance or even crashes. A memory leak refers to memory allocated by a program that is not properly released, gradually exhausting available memory. As a lightweight real-time operating system (RTOS), … Read more

Porting Real-Time Device Drivers to Linux Embedded Systems (Part 1)

Porting Real-Time Device Drivers to Linux Embedded Systems (Part 1)

Linux has stormed the embedded systems market. According to industrial analysts, approximately one-third to one-half of new 32-bit and 64-bit embedded system designs utilize Linux. Embedded Linux has demonstrated advantages in many application areas, such as SOHO home networks and imaging/multifunction peripherals, and has significant potential for leapfrog development in areas like (NAS/SAN) storage, home … Read more