Skip to content

Commit c2812e1

Browse files
Add more verbosity to multicore docs (#2114)
1 parent 683b62e commit c2812e1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/multicore.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ Pausing Cores
3737

3838
Sometimes an application needs to pause the other core on chip (i.e. it is
3939
writing to flash or needs to stop processing while some other event occurs).
40+
In most cases, however, these calls are **SHOULD NOT BE USED**. To synchronize
41+
cross-core operations use normal multiprocessor methods such as circular buffers,
42+
global ``volatile`` flags, mutexes, and the like. Stopping a core has massive
43+
implications and can kill networking and USB communications if done too long or
44+
too frequently.
4045

4146
void rp2040.idleOtherCore()
4247
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -69,7 +74,12 @@ Communicating Between Cores
6974
The RP2040 provides a hardware FIFO for communicating between cores, but it
7075
is used exclusively for the idle/resume calls described above. Instead, please
7176
use the following functions to access a software-managed, multicore safe
72-
FIFO.
77+
FIFO. There are two FIFOs, one written to by core 0 and read by core 1, and
78+
the other written to by core 1 and read by core 0.
79+
80+
You can (and probably should) use shared memory (such as ``volatile`` globals)
81+
or other normal multiprocessor communication algorithms to transfer data or
82+
work between cores, but for simple tasks these FIFO routines can suffice.
7383

7484
void rp2040.fifo.push(uint32_t)
7585
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -96,4 +106,4 @@ Reads a value from this core's FIFO and places it in dest. Will return
96106
int rp2040.fifo.available()
97107
~~~~~~~~~~~~~~~~~~~~~~~~~~~
98108

99-
Returns the number of values available in this core's FIFO.
109+
Returns the number of values available to read in this core's FIFO.

0 commit comments

Comments
 (0)