GPIO output configuration not working
Hi, I have an STM32H563ZIT6 board and a simple task: to toggle the GPIO at maximum speed. I set the PA11 pin as an output pin and generated the code. Then, I used the HAL Library function [HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_11);] to toggle the PA11 pin every 1 second. It is working perfectly, and the LED is glowing.
However, when I manually configure the PA11 pin as an output pin, the LED does not blink. I have attached my code for your reference. Any help would be highly appreciated
void GPIO_Init()
{
//GPIO Ports Clock Enable
RCC->AHB2ENR|= RCC_AHB2ENR_GPIOAEN;
//Configure GPIO pin Output Level
GPIOA->BRR |= GPIO_BRR_BR11;
//Configure IO Direction mode
GPIOA->MODER |=GPIO_MODER_MODE11_0;
//Configure the IO Speed
GPIOA->OSPEEDR |=GPIO_OSPEEDR_OSPEED11_1;
//Configure the IO Output Type
GPIOA->OTYPER &=~GPIO_OTYPER_OT11;
}
int main()
{
GPIO_Init();
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
GPIOA->BSRR |= GPIO_BSRR_BS11;
HAL_Delay(1000);
GPIOA->BSRR |= GPIO_BSRR_BR11;
HAL_Delay(1000);
}
}