Max. frequency for reading a GPIO input data register (IDR)
I'm writing code for the STM32F411 and STM32F103 MCUs using the ST HAL library. The firmware reads an IDR directly using the HAL function HAL_GPIO_Read_Pin. The function is called 2 to 3 times in main(), that is, the IDR register is 'polled' more than once in quick sequence, without an interrupt routine.
Problem: not all digital input pins (1s or 0s) are read correctly. The first read access in main() is successful, but 1 to 2 subsequent reads are unreliable.
Question: is there a required wait in terms of clock cycles before an IDR can be read again? Or perhaps some reset is needed? Thank you for your responses.
