Open richardanaya opened 3 years ago
I have described one possible implementation for this in a comment elsewhere, but I don't know how to gate that for specific registers or peripherals only. I tried to look at the corresponding SVD file but haven't found any indication there that some registers should be atomic*. I also couldn't find a way to encode this info in a SVD file, at least based on a surface look at svd_parser. Does anyone here have an idea how to mark only some peripherals/registers as atomic? Maybe have another file listing all atomic peripherals/registers? Or list each atomic peripheral as a flag?
*All registers except those belonging to SIO peripheral should be atomic.
As SVD doesn't have such info, the only way I see is to implement atomic operation for all registers, but make them unsafe
as it done for write_with_zero
.
That would be unfortunate, but at least it would work.
By the way, I have a POC available in my fork if someone wants to take a look. Would something like that fly? I can try to finish a PR, but for that I need some help with how to gate the feature for RP2040 target only.
As per https://datasheets.raspberrypi.org/rp2040/rp2040-datasheet.pdf "2.1.2. Atomic Register Access"
This looks vaguely similar to something that was done for the
msp430
. Unsure how common this is for cortex M registers across the board. Would this be some type of very specifictarget
?