Question
Do we need to synchronize memory access between interrupt handlers and treads on STM32H7?
If we want to pass some information from application running in a thread mode to an interrupt handler using normal SRAM memory (at 0x20000000 address) variables, do we need to do any special synchronization steps (such as calling Data Memory Barrier (DMB) instruction), or we do not?
For example, in the application running in a thread mode, we write '0x1' value to a global 32-bit integer variable 'X'. Then an exception happens and processor starts executing the interrupt handler. Is it guaranteed that it will see 'X' as having '0x1'?
So, in the application thread:
LDR R1, =X // write address of X into R1 register
MOV R0, #1 // write 1 into R0 register
STR R0, [R1] // write 1 into variable 'X'
// STR instruction completes. But 1 is not yet written to the physical memory.
// Next, an exception here happens ...
In the exception handler:
LDR R1, =X // write address of X into R1 register
LDR R0, [R1] // read content of 'X' into R0 register
// is it guaranteed that R0 contains 1?
On other hardware platforms (GPU parallel computing for example), it is not the case: we have to exit all threads and re-start them again to see memory changes made from another thread.
Do we need to do any special synchronization in the case of STM32H7? Any official statement about it in the documentation? Lets say D-cache is disabled.
Thanks.
