STM32F103 GPIO Programming Fundamentals
STM32F103 GPIO Programming Fundamentals
Overview
In the previous article, we discussed the reset and clock configuration for the STM32F103C8T6 minimal system. At this point, the system clock (SYSCLK) has been configured to 72MHz through a 9x multiplication of the external 8MHz high-speed oscillator (HSE) using the PLL. With the minimal system ...
Posted on Sun, 20 Sep 2026 16:28:21 +0000 by jack bro
STM32MP157 Linux Character Device Driver Development Guide
Project Directory Structure
Key project directories for STM32MP157 development:
Buildroot root filesystem: /home/developer/projects/stm32mp157/rootfs
NFS root fliesystem: /home/developer/projects/nfs/rootfs
Linux source code: /home/developer/projects/linux-5.4.31
Device tree: /home/developer/projects/linux-5.4.31/arch/arm/boot/dts/stm32mp157-a ...
Posted on Thu, 17 Sep 2026 16:09:48 +0000 by shane07
Controlling GPIO Inputs and Outputs in Zynq-7000 Linux Kernel Modules
Kernel Space GPIO ManipulationFor the FMQL45T900 platform based on the Zynq-7000 architecture, controlling pins from the kernel space requires determining the correct GPIO index. When utilizing EMIO5 exported from Vivado, the corresponding system GPIO number calculates to 431. The device tree mapping for this pin appears as <&portc 5 0x0 ...
Posted on Wed, 09 Sep 2026 16:05:36 +0000 by Bike Racer
STM32 GPIO Input Configuration for Buttons and Sensors
Overview of GPIO Input Modes
1.1 Button Basics
Mechanical buttons are common digital input devices that close a circuit when pressed and open it when released. Due to the physical nature of their internal spring contacts, they exhibit bounceāa series of rapid on/off transitions during state changes. This requires software or hardware debounc ...
Posted on Fri, 04 Sep 2026 16:39:15 +0000 by crusty76
STM32 GPIO Output Configuration and Control Techniques
General Purpose Input/Output (GPIO) pins typically operate with in a logic voltage range of 0 to 3.3V. While certain inputs may tolerate 5V, output stages are strictly limited to the 3.3V supply. To control higher-power devices such as motors or relays, an external driver circuit must be integrated between the MCU pin and the load.
Hardware Arc ...
Posted on Tue, 01 Sep 2026 16:27:25 +0000 by mindrage00
Implementing GPIO LED Control Using the Linux Platform Bus
Driver Source Code
The following implementation utilizes the platform bus architecture to manage GPIO-based LEDs. It establihses a character device interface and parses device tree information during the probe phase.
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/of_gpio ...
Posted on Tue, 25 Aug 2026 16:19:27 +0000 by sillyman
STM32 Standard Peripheral Library Technical Reference for Basic Peripherals
1. Memory and Bus Architecture
The STM32 architecture is built around a multi-layer bus matrix that facilitates communication between the Cortex-M3 core and various peripherals. Key components include:
I-Code Bus: Fetches instructions from the Flash memory.
D-Code Bus: Accesses data (constants) in Flash or variables in SRAM.
System Bus (S-Bus) ...
Posted on Sat, 01 Aug 2026 16:28:59 +0000 by paulytrick
Troubleshooting STM32 Ultrasonic Sensor Interface Issues
First, let's demonstrate the correct implementation method. We won't show the problematci syntax examples.
void HCSR04_Configuration(void){
GPIO_InitTypeDef gpioConfiguration;
TIM_TimeBaseInitTypeDef timerConfig;
// Enable GPIO peripheral clocks
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
RCC_AHB1PeriphClockCmd(RC ...
Posted on Fri, 10 Jul 2026 16:53:37 +0000 by bftwofreak
Introduction to Embedded C Language Design
Transition from Standard C to Embedded C Programming
Characteristics of C Language
As a fundamental high-level programming language, C has evolved into various extensions. In embedded systems design, the primary enhancement involves hardware device drivers. This extension offers a more adaptable environment for application development. My un ...
Posted on Thu, 18 Jun 2026 16:32:45 +0000 by danger2oo6
Using Semaphores to Enforce Exclusive Access to an LED Device in Linux Kernel Driver
This example demonstrates how to implement a GPIO-controlled LED driver that ensures only one user process can access the LED at a time using a counting semaphore initialized to 1 (binary semaphore). The semaphore is acquired in the open() handler and released in the release() handler, effectively serializign access across multiple processes.
D ...
Posted on Tue, 16 Jun 2026 17:08:44 +0000 by Distant_storm