STM32F4上"Exclusives Reservation Granule"的值是多少?

What is the value of the "Exclusives Reservation Granule" on STM32F4?

我很感兴趣,因为这个值会影响我想使用(很棒的)ldrex/strex 同步原语的数据结构在内存中的位置。

ARMv7-M 体系结构参考说:

The size of the tagged memory block is called the Exclusives reservation granule. The Exclusives reservation granule is IMPLEMENTATION DEFINED between:

  • one word, in an implementation with a == 2
  • 512 words, in an implementation with a == 11.

因此,对于给定的实现(例如 STM32F407),我应该能够找到使用的值。但是我不能,在我翻过的各种文件中。

有人知道吗?还有,你是怎么找到的?

STM32F407有一个Cortex-M4内核,也就是说ERG的大小实际上是4GB。

来自the Cortex-M4 TRM

The local monitor within the processor has been constructed so that it does not hold any physical address, but instead treats any access as matching the address of the previous LDREX. This means that the implemented exclusives reservation granule is the entire memory address range.

STM32F407 TRM 没有提到任何关于实现外部监视器的系统,所以我假设它没有。如果没有其他 CPU 与之同步,这没什么大不了的——我想不出一个很好的理由来使读-修改-写原子化以防止被 DMA 覆盖。