The Volatile Keyword You Might Overlook in MCUs

The Volatile Keyword You Might Overlook in MCUs

Click 👆👆👆 the blue text Follow “Passion Embedded” In embedded development, especially in the development of microcontrollers like STM32, the <span>volatile</span> keyword is a very important concept. 1. Concept of the volatile Keyword <span>volatile</span> is a type modifier in C/C++ that tells the compiler: The variable may be modified unexpectedly (e.g., by hardware, interrupts, or … Read more

Analysis of Embedded Driver Design Techniques

Analysis of Embedded Driver Design Techniques

In embedded system development, driver design is a key factor affecting system performance, energy efficiency, and maintainability. Below is an in-depth analysis of three mainstream driver design techniques along with practical recommendations: 1. Polling Driver Technical Features: Blocking Design: The main program cannot perform other tasks while waiting for peripheral responses. Simple Implementation: Only requires … Read more

LwOW: A Lightweight OneWire Protocol Library Designed for Embedded Systems, Supporting UART and GPIO Communication

LwOW: A Lightweight OneWire Protocol Library Designed for Embedded Systems, Supporting UART and GPIO Communication

In embedded system development, efficient and reliable communication with peripherals is crucial. The OneWire protocol, with its simple single-wire interface and cost-effectiveness, is widely used for connecting devices such as temperature sensors and iButtons. However, traditional OneWire libraries are often too bulky and resource-intensive. Today, we will delve into a lightweight, high-performance OneWire protocol library—LwOW, … Read more

Resolving ARM Cortex-M Exception – HardFault (UsageFault) INVPC Set to 1

Resolving ARM Cortex-M Exception - HardFault (UsageFault) INVPC Set to 1

CPU: STM32F429IGT6 For other STM32 chips or other ARM Cortex-M chips, the solution is generally the same. It is recommended to read this article in full before debugging the issues you encounter. 1. Basic Knowledge In ARM Cortex-M series processors, there are several system exceptions dedicated to fault handling. The faults in CM3 can be … Read more

Efficient UART Reception Programming Example with DMA and IDLE Based on STM32

Efficient UART Reception Programming Example with DMA and IDLE Based on STM32

Efficient UART Reception Programming Example with DMA and IDLE Based on STM32 The goal of this article: A FreeRTOS programming example based on STM32_H5 According to the description in this article, experiments should be able to be conducted on the corresponding hardware, and similar applications can be derived. Prerequisites: Basic knowledge of C language, and … Read more

Understanding the Internal Bus of STM32 Microcontroller

Understanding the Internal Bus of STM32 Microcontroller

The STM32 microcontroller, based on the ARM Cortex-M3 architecture, has a complex and efficient internal bus structure that supports the entire system’s data flow and instruction execution, making it a key learning point for many embedded engineers. Below, we will list the main internal buses of the STM32 microcontroller and their functions. 1. I-Code Bus … Read more

Technical Sharing | ARM Support for Device Passthrough in Virtualization

Technical Sharing | ARM Support for Device Passthrough in Virtualization

With the widespread use of ARM architecture processors in the field of cloud computing, the demand for application developers to be familiar with ARM architecture-related technologies is becoming increasingly urgent. It is well known that providing virtual machine services is a typical application scenario of cloud computing, and the performance of devices within virtual machines … Read more

Debugging Techniques for Microcontrollers Without Serial Ports

Debugging Techniques for Microcontrollers Without Serial Ports

Outputting debugging information is an essential debugging tool in embedded development. One characteristic of embedded development is that often there is no operating system or file system, making conventional methods of printing logs to files generally unsuitable. The most common method is to output UART logs through a serial port. For example, with the 51 … Read more

In-Depth Exploration of Byte Alignment Issues

In-Depth Exploration of Byte Alignment Issues

1. The Concept of “Memory Alignment” Memory alignment, also known as byte alignment, is an attribute of the memory address where a data type can be stored. This attribute is essentially the memory address itself, which must conform to certain specifications. This specification states that the memory address value must be a power of 2. … Read more

Configuring DAC Output for Fixed Voltage and Square Wave on STM32

Configuring DAC Output for Fixed Voltage and Square Wave on STM32

The STM32F103VCT6 features two 12-bit DACs. The conversion speed of the DAC has not been confirmed, but some online sources suggest a frequency of 1MHz, which means 1us. The ADC conversion time at a working frequency of 56MHz is 1us, and at 72MHz it is 1.17us. If there is a symmetrical relationship between AD and … Read more