No output on GPIOs
- March 2, 2026
- 5 replies
- 260 views
Hello
I have a STM32H7R3V8T6 and want to use a few peripherals and GPIOs. However, I don't manage to see an output with my analyzer. The peripherals themselves seem to work: An XSPI receive for example does receive some dummy bytes and takes exactly the required time for the transfer (measured with the cycle counter), but the pins do not show anything.
I reduced my code and came up with this simple demonstration of how I initialize a GPIO:
int main(void)
{
SystemCoreClockUpdate();
HAL_Init();
SystemClock_Config();
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = GPIO_PIN_12;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
while (1) {
HAL_GPIO_TogglePin(GPIOB, 12);
HAL_Delay(10);
}
}The debugger shows that I reach the loop. The registers of the peripheral seem to be correct, but the pin doesn't toggle. This also happens with other GPIOs and pins that are assigned to peripherals such as the XSPI.
What could I be missing?
Thank you very much.
PS: See the attachment for the clock setup, if that matters.
