!zbjndUiYJDvhDRkPGw:matrix.org

rp-rs

587 Members
Rust on the Raspberry Pi Microcontrollers/Pico https://github.com/rp-rs 59 Servers

Load older messages


SenderMessageTime
22 Jul 2024
@pauldfaria:matrix.orgPaul D. FariaLooks like I was missing the top-level interrupt to trigger the waker. I understood why that was needed but definitely confused until I saw that since the current API doesn't have documentation or examples explaining its usage.21:02:48
@ithinuel:matrix.orgithinuel I guess that's either a question for the sdk or a fun experimental session. 21:03:16
@ithinuel:matrix.orgithinuel Actually it does say (or imply) that everything is discarded. 21:18:32
@ithinuel:matrix.orgithinuel In the 2.5.5.3 chapter. 21:20:21
@ithinuel:matrix.orgithinuel It doesn't explicitly talk about the FIFO though. But the way it talks about issues of aborting when the DMA isn't stalled on a dreq or even while actually doing a transfer should be enough to infer a sound expectation from the DMA. 21:21:41
@ithinuel:matrix.orgithinuelNow, the question to figure what the transfer count status this is a bit tricker. Because it may have read more data than written. In a peripheral-to-memory I guess the read count matters as much as the written count while for memory-to-memory and memory-to-periph, only the written really matters (because reads on memory don’t have side effects)21:47:06
@dirbaio:matrix.orgdirbaioTrue.. M21:49:35
@dirbaio:matrix.orgdirbaio * 21:49:41
@ithinuel:matrix.orgithinuel

From what I understand, (I’m home now and reading the datasheet).

  • There are 12channels
  • There can be up to 12 "transfer sequences" live at the same time.
  • Each channel supervise a single transfer sequence at any given time.
  • A Transfer sequence is atomic (reading between lines of the last paragraph of 2.5.5.3). 
    It would be nice to have that confirmed explicitly since the hope chapter about DMA talks about "transfer sequence" but this very important paragraph does not.
21:56:29
@ithinuel:matrix.orgithinuel

bus transfers currently in flight between the read and write master, and these transfers cannot be revoked

21:57:12
@ithinuel:matrix.orgithinuel are these referring to the read and write masters or the bus transfers (sequences) ? 🤷 21:58:06
@ithinuel:matrix.orgithinuelBut it’d make sense it’s the whole sequence to keep the system in a sound state.21:58:36
23 Jul 2024
@cesare22:matrix.org@cesare22:matrix.org joined the room.19:20:24
24 Jul 2024
@cesare22:matrix.org@cesare22:matrix.org left the room.11:11:54
26 Jul 2024
@chargedhex:beeper.comChandlerWhen using the multicore functionality, are there any constraints on what the cores can access? Can they control different ADC pins without issue?08:05:23
@chargedhex:beeper.comChandlerCan each core set up timers without them interfering?08:06:55
@henrik_alser:matrix.orghenrik_alser Chandler: Main thing to note is that core1 execution is paused during flash operations so you can’t use it for that 08:12:57
@chargedhex:beeper.comChandlerAre flash operations something that is done manually, or do they occur from time to time in the background?08:13:43
@jamesmunns:beeper.comJames MunnsOnly when you do it specifically 08:16:17
@chargedhex:beeper.comChandlerOk, great, that shouldn't be a problem, then08:17:35
@chargedhex:beeper.comChandlerAm I understanding it right that the only way to communicate between the cores is a single spinlock and a single SioFIFO? 08:18:23
@chargedhex:beeper.comChandlerI was expecting something like channel from the std library08:19:28
@henrik_alser:matrix.orghenrik_alserNo they have shared memory so you can use any sync primitives as long as they use a critical section implemented with the hardware spinlocks08:22:24
@henrik_alser:matrix.orghenrik_alser Check out embassy-sync and use them with CriticalSectionRawMutex 08:22:45
@henrik_alser:matrix.orghenrik_alserAlso make sure you enable critical-section-impl feature and not use the standard single core one in cortex-m08:23:31
@9names:matrix.org9names
In reply to @chargedhex:beeper.com
Am I understanding it right that the only way to communicate between the cores is a single spinlock and a single SioFIFO?
there are 32 spinlocks, rp2040-hal and embassy-rp use 1 of them to provide a multi-core safe critical-section but the rest of them are free for you to use.
the sio fifo is a good way to send signals between cores, as henrik says you would usually use shared memory to copy data. both cores have the same access to memory and peripherals, but you want to ensure that only one core is accessing a specific peripheral or section of memory at a time.
most of the time it's easiest to not use both cores.
09:35:18
@chargedhex:beeper.comChandlerThanks, this looks like what I wanted09:40:08
@slusheea:matrix.org@slusheea:matrix.org left the room.11:30:14
@thejpster:matrix.orgthejpster

you can use any sync primitives as long as they use a critical section implemented with the hardware spinlocks

Note that on other platforms you could also use core::sync::atomic::AtomicXX types, but on Cortex-M0+ you only get load/store primitives and not compare-and-swap and communication between cores using only load/stores is a race hazard.

18:34:17
@thejpster:matrix.orgthejpsterhttps://docs.rs/portable-atomic uses critical-section to fix the problem, but that counts as "a sync primitive that uses a critical section implemented with hardware spinlocks" provided you turn on the critical-section-spinlock feature of your HAL.18:35:40

There are no newer messages yet.


Back to Room ListRoom Version: 6