When the Raspberry Pi Pico runs with two cores, vital resources must be protected by semaphores (Mutual Exclusion). This examples uses Peterson’s algorithm, which is rather simple for two threads / cores. Note: The semaphore variables and the housekeeping variables are set up as ‘volatile’. This turned out to be necessary for the code to …
Month: September 2021
The RP2040 processor of the Raspberry Pi Pico has dual ARM Cortex-M0+ cores that can be used in an Arduino-style sketch as follows: /* * Test Rspberry Pi Pico dualcore mode * * Classical ‘blink’ example but split into two tasks, running on the two RP2040 cores: * – Core 0 sets the state of …