LDR instruction after STR outputs old data when reading from timer peripheral
I have a bit of code as follows:
str r3, [r0, #68]
ldr r3, [r0, #68]
where [r0, #68] is TIM20.BDTR on a STM32G474. I would expect that the LDR would output the same data that was just stored, however it seems that out outputs the previous data. I also tried putting a DMB between the two instructions but the same result still occurred. Inserting 5 DMB instructions seems to cause a long enough delay that the correct data is returned.
This obviously has the potential to be problematic in a few scenarios, but I can't find any documentation from ST on this behaviour, so does anyone know if such documentation exists?
