Skip to content

Atomic operations don't work on memory in PSRAM #2505

Open
@sfe-SparkFro

Description

@sfe-SparkFro

I unfortunately don't have any replication code to share right now, as I'm working on a project that's private for the time being. Edit: See next comment

But the short explanation is that I have some code that calls __atomic_fetch_add(my_int, 1). When my_int is in SRAM, everything works fine. When my_int is in PSRAM, the system gets into an infinite loop, forever incrementing my_int (seems like once every clock cycle).

I saw this thread in which it is mentioned that atomic operations are only supported for memory <=32 bits in size (otherwise a spin lock is used), and not supported in PSRAM. That's fine, the performance hit of a spin lock is negligible for me. But seems like there's currently no check for the memory location to actually do a spin lock if the memory is in PSRAM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions