Controlling Xiaomi Micro Motor with STM32 HAL Library

Previously, due to the robot dog project, I had been using the Xiaomi micro motor, but I struggled to find a detailed tutorial, encountering many pitfalls while learning to control the motor. Today, we will implement the control of the Xiaomi micro motor step by step using buttons. This article will analyze the Xiaomi motor … Read more

How to Solve the Absence of EEPROM in STM32?

In embedded systems, EEPROM (Electrically Erasable Programmable Read-Only Memory) is often used to store data that needs to be changed frequently and should not be lost due to power interruptions. However, since STM32 does not have built-in EEPROM, how can we solve this problem and meet storage requirements? 1. Use External EEPROM Chips When STM32 … Read more

Powerful ITM Debugging Tool for STM32

STM32 has a code tracing feature, known as ITM, which is a very powerful debugging function that can replace serial input/output functionality, requiring only one I/O line to implement. Of course, its benefits are not limited to this; when debugging embedded operating system code, you will find it quite convenient. However, the focus of this … Read more

How to Solve Runaway Phenomenon During STM32 Upgrade with IAP?

During the firmware upgrade process of the STM32 microcontroller, many engineers choose the IAP technology, which allows firmware updates to the microcontroller via the host computer while the application is running. However, occasionally, there may be a low probability of encountering a runaway phenomenon. How to solve it? 1. Check Power Supply Voltage Ensure that … Read more

Designing the Minimal System for STM32 Microcontroller

Foreword Most of us fall into a misconception while learning STM32 — we focus solely on the software code and neglect the hardware aspect. In simple terms, we only know how to use the development board, and when it comes to designing our own STM32 system, we are at a loss. This article aims to … Read more

20 Commonly Used STM32 MCU Library Functions

The development of STM32 microcontrollers relies heavily on their powerful library function support. These library functions provide developers with a unified interface, simplifying the operation of low-level hardware, improving development efficiency and the reliability of programs. Below we will share 20 commonly used library functions for STM32 microcontrollers. 1. GPIO Initialization Function void HAL_GPIO_Init(GPIO_TypeDef* GPIOx, … Read more

Basic Principles of STM32 Serial Communication

Background Knowledge of Communication Interfaces Ways of Communication Between Devices Generally, the communication methods between devices can be divided into parallel communication and serial communication. The differences between parallel and serial communication are shown in the table below. Classification of Serial Communication 1. According to the direction of data transmission, it can be divided into: … Read more

How to Control USB with STM32? A Comprehensive Guide!

In STM32 microcontrollers, the microcontroller is equipped with a USB interface, designed to facilitate high-speed data transfer and communication between devices. The USB interface can be divided into two roles: Host and Device. So, how does STM32 control USB? 1. USB Device Function Control Enable USB device functionality: Enable the USB device functionality in CubeMX … Read more

Understanding the Interrupt System in STM32

Little Science Gas Station In embedded learning, the STM32 series chips are particularly favored due to their many excellent features, such as the STM32 MCU integrating a wealth of peripherals, including communication interfaces (like UART, SPI, I2C, CAN, etc.), analog and digital interfaces, timers, and interrupt controllers. Today, Little Science introduces the interrupt system of … Read more

Accelerating Intelligent IoT 2.0: Emergence of Edge Intelligence

Author: Peng Zhao (Founder of Zhiciph, Co-founder and Partner of Yunhe Capital) IoT Think Tank Original This is my 324th column article. The integration of large AI models with hardware is in full swing, but it seems to be facing resistance on the B2C consumer side. According to The Information, former Apple design chief Jony … Read more