I have an application where I toggle a pin on one GPIO port, then immediately read a value from another GPIO port. The idea is that the external hardware reacts much faster than the LM4F. The GPIO is accessed via the AHB aperture.
The (pseudocode) sequence looks something like:
gpio_set(some_port, some_pin);
gpio_read(another_port, data_pins);
I was getting wrong data from the GPIO read, so I checked the timing with a logic analyzer. As soon as some_pin is set, the HW reacts, and data_pins reach their correct levels. Since external timing was not the issue, I reduced the core clock from 80MHz to 16MHz, with the same results. I ended up putting 4 "nop" instructions between the set and read. Three "nop"s were insufficient. Four "nop"s are always needed regardless of the core frequency.
This leads me to infer that internally the GPIO read happens before the GPIO write. How can I ensure coherence between different GPIO ports?