Q: Atomic Register Access Upon Certain Registers

Open
#116 2 comments 0 reactions 1 assignee View on GitHub

@Wren6991 is already working on this.

Since May 25, 2021.

Assessment

This issue has not been assessed yet.

Description

question rp2040

The effect of atomic register access as defined in RP2040 datasheet, Sect. 2.1.2 seems unclear to me when applied onto some specific registers.

Example 1: Atomic XOR on write (e.g. via hw_xor_bits()) applied onto PIO Register TXF0. This register is, as far as I understand, a write-only register, since it pushes a new data word into the FIFO. Applying XOR however requires knowledge about the bits of a previous value, but there is no previous value when pushing a new value into the FIFO. My guess is, that the XOR is applied against an assumed 0x0 value, i.e. resulting in the same effect as directly writing to the register without applying XOR. Is this correct?

Example 2: Atomic bit mask set and clear (e.g. via hw_set_bits() and hw_clear_bits) applied onto PIO Register INSTR_MEM0. The memory words are write-only. If atomic bit mask set and clear nevertheless worked, this would mean that you could non-destructively update the delay/side-set of an instruction without knowing what instruction is currently stored: Just clear/set the delay/side-set bits of an instruction with a mask that keeps all other bits of the instruction unmodified. Does this really work? My guess is no...

Also, the atomic register access is specified for write operations only. What will be the effect when reading from an address that is provided e.g. for atomic XOR write access?

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.