The RP2040 has two Cortex-M0+ cores that can run independently. Without an OS to schedule tasks across cores, you partition work at design time: decide explicitly what runs on Core 0 and what runs on Core 1.
RP2040 inter-core communication:
- SIO FIFO: hardware 8-entry FIFO in each direction, 32-bit words
- Spinlocks: 32 hardware spinlocks for atomic section protection
- Shared RAM: both cores share the same 264KB SRAM
PulsarSync-Core partitioning:
- Core 0: ADC interrupt handler, FIR filter, decimation. Timing-critical, runs every 1μs. Pushes decimated samples to shared FIFO.
- Core 1: Channeliser, dispersion correction, pulse detector. Latency-tolerant, can accumulate. Reads from FIFO, writes detections to output.
Startup sequence:
Core 0 starts automatically at reset. To start Core 1:
// Cortex-M0+ multicore launch via SIO
multicore.launch_core1(core1_main, &mut core1_stack);Race conditions without an OS: You must reason manually about every shared resource. The SIO FIFO is the only safe communication path — it has hardware synchronisation. Direct shared memory access requires spinlocks, used sparingly (spinlock contention stalls both cores).
The borrow checker cannot help you here — both cores share the same address space and Rust's ownership model is per-process. The safety argument is manual: only Core 0 writes to the ADC buffer, only Core 1 reads from it, and the FIFO is the handoff. This is documented as an explicit unsafe contract.