Luigi Lavezzaro's PicoSem Increases RP2040 Inter-Core Communication Flexibility in the Arduino IDE

Designed for enhanced flexibility, PicoSem offers an alternative to the inter-core communication built into the RP2040 Arduino core.

Gareth Halfacree
1 year ago β€’ HW101

Developer Luigi Lavezzaro is hoping to make exploitation of the two Arm Cortex-M0+ cores on the Raspberry Pi Pico, and other RP2040-based development boards, both easier for beginners and more flexbile with a new library for inter-core data exchange.

"I'm a beginner with the [Raspberry] Pi Pico but from the first glance I understood that the processing speed combined with the presence of the two cores can provide an interesting potential compared to the Arduino and ESP16 families," Lavezzaro explains of his work. "But in order to be able to delegate different tasks to the two cores by transferring information produced during their respective processing, it is necessary to have a system of message exchange and synchronization."

Implementing such a system isn't always easy, which is where Lavezzaro's PicoSem library comes in. "[It's a] simple library that implements semaphores," the developer explains, "to exchange data between two cores of a Raspberry Pi Pico under Arduino IDE framework."

The Arduino core for the Raspberry Pi RP2040 microcontroller already includes integrated multi-core processing capabilities, but with one key restriction: information passed between the cores is limited to a single uint32_t type variable. "So, for this reason," Lavezzaro says, "I started thinking about a different solution in which the size of the exchange data buffers could be potentially limited only by the available memory."

That solution became PicoSem, which is built to be as easy to use as possible. Its semaphore-based communication system allows a core to pass arbitrary information, send signals to advise that buffers are emptied ready to receive new data, signal when writes have occurred, and signal when transmitted data has been read.

PicoSem has been released on GitHub under the reciprocal GNU General Public License 3, with two example projects β€” a multi-core blink and a sample bidirectional communication sketch β€” provided along with basic documentation.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles