Little update on the topic: I created a new project in CubeMX and started with configuring only one LED on PA2 and the two input buttons PA9 and PA10. I started adding functions such as switching from internal clock to the external one, and configured the rest of the buttons on PA13, PA14 and PB8. This time everything works without any problems.
Only difference from the previous project is the syntax I used for putting the LEDs up. Instead of GPIOA and wrapping everything in if statements, I used the following syntax:
HAL_GPIO_WritePin( MIN_LED_GPIO_Port, MIN_LED_Pin, HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_9) == GPIO_PIN_SET );
HAL_GPIO_WritePin( MIN_LED_GPIO_Port, MIN_LED_Pin, HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_10) == GPIO_PIN_SET );
HAL_GPIO_WritePin( MIN_LED_GPIO_Port, MIN_LED_Pin, HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_8) == GPIO_PIN_SET );
HAL_GPIO_WritePin( MIN_LED_GPIO_Port, MIN_LED_Pin, HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_13) == GPIO_PIN_SET );
HAL_GPIO_WritePin( MIN_LED_GPIO_Port, MIN_LED_Pin, HAL_GPIO_ReadPin(GPIOA,GPIO_PIN_14) == GPIO_PIN_SET );
I am wondering if this could be culprit somehow. Maybe using GPIOA is messing with the whole bank. Any comment would be appriciated.
Thank you