2025-11-25 9:36 AM - last edited on 2025-11-25 9:41 AM by Andrew Neil
Hello,
I am currently working with STM32G431RB, and I have an SD card connector on my board. When the CPU clock is below 80MHz, everything works fine. However, when I increase the clock frequency and insert the SD card into the slot, the program crashes and gives different hard fault errors (stack overflow, bus hard fault, etc.).
This is the SD card slot schematic.
2025-11-25 9:42 AM
2025-11-25 10:05 AM
This is one example of the error. I'm using IAR Workbench, and no peripheral is activated, and the only code that I'm running is
while (1) {
if (! SD_DET)
HAL_GPIO_WritePin(led_GPIO_Port, led_Pin, GPIO_PIN_RESET);
else
HAL_GPIO_WritePin(led_GPIO_Port, led_Pin, GPIO_PIN_SET);
}