0 Members and 2 Guests are viewing this topic.
The ARM instruction ensures that the previous instructions have completed.It does not take into account other delays that may be present in the peripheral. For example, some peripherals operate in a different clock domain and will have additional clock delays before the write actually reaches the register.Reading back the register will ensure these have completed.
.., when is this actually useful?
The DSB instruction will do that as well:
QuoteThe DSB instruction will do that as well:I do not see how the DSB instruction has any relation to the INTERNAL data paths within a peripheral.The DBS instruction works at the processor bus level.
Quote from: SiliconWizard on October 31, 2022, 06:36:58 pm.., when is this actually useful?For example, when you want to enable some hardware and you need to initialize some (other) hardware firstbecause it is dependent to it.
ST's HAL is full of examples where they read back a register immediately after writing to that register.
I get that, but how often is it required in practice? Note that it would be a potential issue only if you access registers of peripherals that are NOT on the same clock domain (different APBs). If they share the same APB, the sequence is guaranteed. Isn't it?