Skip to main content
Visitor II
September 17, 2020
Solved

FSMC access thread safe?

  • September 17, 2020
  • 2 replies
  • 924 views

Supposed I am using external memory via an 16 bit address / 8 bit data bus with FSMC (STM32F714). An RTOS is running.

Is access to this memory atomic (in the sense of thread safety) when I read/write 32 bit wide data? The consideration is, for instance:

  • bytes 1 and 2 are already written, then a task switch occurs, and another task uses the FSMC controller for a different read/write operation;
  • worse: the second task accesses the same memory location, thus overriding all 4 bytes, and then, when the former task continues, it finishes writing bytes 3 and 4.

Can the processor handle these operations atomically, or is usage of a mutex appropriate when accessing the same resource (external memory, or the FSMC infrastructure as a whole)?

    This topic has been closed for replies.
    Best answer by waclawek.jan

    > STM32F714

    ?

    Yes, FSMC/FMC writes are atomic, even if they are split internally because of narrow external bus.

    JW

    2 replies

    Super User
    September 17, 2020

    > STM32F714

    ?

    Yes, FSMC/FMC writes are atomic, even if they are split internally because of narrow external bus.

    JW

    IngmarAuthor
    Visitor II
    September 17, 2020

    good news, thank you Jan!