Documentation: need for memory barriers

Open
#160 13 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

documentation pio question

I think the documentation could use some extra information about the need for memory barriers: so far as I can see, there's currently neither explanatory material in the SDK, nor the raw information in the datasheet to figure it out for yourself.

As an example, I just got caught out where I had an interrupt handler for the PIO Tx FIFO, which looped loading bytes into the FIFO until the interrupt status (IRQ0_INTS) cleared - this overflowed the FIFO because the status read apparently overtook the FIFO write. Evidently there's a write buffer in there somewhere. Easily cured with a DMB instruction, but I couldn't find this write buffer documented anywhere.

Also, there's the mysterious __mem_fence_acquire() where the SDK documentation seems to assume you know what it does, and drilling down into the SDK source suggests it's just a compatibility veneer for a facility defined elsewhere - yet Google doesn't give any hits apart from the Pico SDK itself.

Dominant language
No language data
Stars
35
Forks
4
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/pico-feedback

All issues in raspberrypi/pico-feedback

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.