How do you share memory and tasks between multiple MCUs in one project?

Dec 02, 2026 Last reply: 9 hours ago 4 Replies

First reply

mharper_1960

The short answer to your direct question is no, one MCU cannot read another MCU's memory directly. Even on dual-core chips, where the two cores literally sit in the same package, you have to be very careful about coherency between them. Two seperate chips have no path into each…

Read the full reply

So I'm sketching out a project where a few separate chips each do one job. One would be the main brain doing the heavy lifting, internet stuff, reading and writing to the SD card and general data crunching. A second chip just pushes pixels to an SPI display and a third handles sound playback.



My first thought was the usual master and slave arrangement, master tells the slaves what to do over SPI or I2C. But that feels bloated. If the master has to send the display chip every shape and bit of text to draw, I might as well hang the display off the master directly. The reason I don't want that is the display library eating up time on the main chip while other things need doing. What makes more sense to me is the master writes what needs to be drawn somewhere shared, and the display slave reads that same spot and pushes the pixels itself. Then there's the audio chip, it also needs the sound files sitting on the same card the master is using.



So how do people actualy wire this up? Can a slave read the master's memory directly, or is there some shared memory both sides can read and write?


The short answer to your direct question is no, one MCU cannot read another MCU's memory directly. Even on dual-core chips, where the two cores literally sit in the same package, you have to be very careful about coherency between them. Two seperate chips have no path into each other's RAM at all, so the shared scratchpad idea does not work the way you're picturing it. And on the bus question, I2C is painfully slow for chip-to-chip traffic. SPI is the better choice there by a wide margin. But before you get deeper into this, I'd stop and ask what's actually forcing you onto multiple chips in the first place. Is it memory? CPU load? Raw I/O count? The answer changes everything. I avoid splitting across separate MCUs whenever I possibly can. It's a pain to keep two independent chips in lockstep, and multi-core processors are cheap these days and vastly easier to keep synchronized, since you get shared peripherals and hardware-level coordination for free.

If you do end up splitting, the pattern that actually works is exclusive ownership. The display slave owns the screen and keeps its graphics data in its own flash, the audio slave owns the SD card exclusively, and the master just sends commands. Two independent hosts touching the same card will corrupt the filesystem, because the card and the FAT layer both keep cached state, so one chip has to own the card and serve the other one.

For the link itself, I've had good luck with a simple approach: an IRQ pin from each side for signaling, plus a messaging library running over the bus. UART is a very common point-to-point choice for this, and it keeps the protocol dead simple. No shared memory, no coherency headaches, just short commands flying back and forth.

Honestly, I'd look hard at a single dual-core part doing everything before I committed to three boards on a bench.

One thing I'd nail down before wiring anything: what's actually slowing your main chip down? If it's the drawing library hogging cycles, a beefier single chip with more RAM might make the whole split unnecessary. But if the graphics assets are big, remember the display slave needs them stored somewhere too, so someone has to load that flash in the first place. Who does that job in your plan?

Something keeps nagging at me in the advice here, the framing that a dual-core chip gives you coordination 'for free'. Free compared to juggling three separate boards, maybe, but does it fix your actual complaint? Your worry was the drawing work crowding out everything else on the main chip. Move it to a second core in the same package and it still burns the same cycles, it just stops tripping over the networking and card code. That might well be enough for you, but it isn't the same as the workload disappearing. Do you have any feel yet for how big a slice of the main chip's time the drawing really takes? That number seems to decide the whole thing.

Update: okay, the card ownership point stung a bit, I genuinely had both chips talking to the one card in my sketch and never questioned it. So now I'm leaning toward one of those multi-core chips instead of three separate boards. One thing still nagging me though, if the display work moves to the second core, do the cores end up fighting over the same RAM, or is that split handled for me?

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required