0x01: STM32L432KC Bare-Metal Blink
ARM CORTEX-M4
Direct register manipulation for GPIO toggling. Bypassing HAL for maximum execution efficiency.
// Enable GPIOB Clock (RCC_AHB2ENR)
RCC->AHB2ENR |= (1U << 1);
// Set PB3 to Output Mode (GPIO_MODER)
GPIOB->MODER &= ~(3U << (3 * 2));
GPIOB->MODER |= (1U << (3 * 2));
while(1) {
GPIOB->ODR ^= (1U << 3); // Toggle LED on PB3
for(int i = 0; i < 100000; i++); // Simple Delay
}