What would you actually use the PLAY peripheral for?

Nov 23, 2026 Last reply: 23 hours ago 4 Replies

First reply

BirchScout

It's not a gimmick, but it is easy to misjudge because it's not trying to be a real FPGA. Think of it as a tiny CPLD that happens to live inside the MCU, not a logic-dumping ground. With the small number of LUTs you get, the trick is to stop picturing 'logic design' and start…

Read the full reply

I've been reading through the docs on the Programmable Logic ArraY on the newer STM32s and I'm honestly not sure what I'd use it for. There are so few LUTs in there that anything I try to picture gets pretty basic.



So is anyone here finding real uses for it? Is it just good for simple on/off logic, or am I missing something and it's actualy a gimmick?



The one idea I keep coming back to is some kind of emergency shutdown that would still fire even if the CPU hangs or crashes outright. Beyond that I'm drawing a blank, so I'd love to hear what others are doing with it.


It's not a gimmick, but it is easy to misjudge because it's not trying to be a real FPGA. Think of it as a tiny CPLD that happens to live inside the MCU, not a logic-dumping ground. With the small number of LUTs you get, the trick is to stop picturing 'logic design' and start picturing the handful of odd jobs where a few gates running independently of the CPU are exactly what you want. Your emergency shutdown idea is honestly one of the best use cases for it. Since the array keeps running off its inputs regardless of what the core is doing, you can wire the shutdown condition purely in hardware and it still fires if the firmware locks up or the CPU crashes outright. That's the kind of thing that normally forces you to bolt on an external supervisor or small CPLD, and if you can fold it into a peripheral you're already paying for, that's a win.

The other place it makes sense is simple glue logic and power sequencing. Sequencing rails or gating supplies with a small bit of logic kept separate from the main code is a classic job, and doing it in the array keeps it out of your interrupt handlers entirely. It also can't be broken by a bad code update the way firmware-driven sequencing can. Then there's the signalling angle. Sometimes you need some nonstandard protocol or handshake that the built-in timers just can't produce, and you don't want to burn your CPU budget bit-banging it. A few LUTs plus some flip-flops is basically a very small CPLD standing in for the external chip you'd otherwise add to the board.

I also think of it as STM32's answer to the PIO on the Raspberry Pi Pico. The Pico crowd uses PIO for custom interfaces all the time, and that's a reasonable way to look at this: not 'implement a design', but 'implement a small custom interface the standard peripherals don't cover.' I haven't shipped anything with it yet, and nothing in my current motor control project needs it, but the emergency-shutdown role alone would justify its existence on a board where that matters.

This is helpful, I'd been picturing it as a baby FPGA and wondering why anyone bothered. The power sequencing thing clicks for me, keeping that stuff out of the main code so a bad update can't break it makes sense. When you say a few LUTs plus flip-flops can stand in for a custom interface, does that mean you'd have to learn some hardware description language to set it up, or can you configure it like a normal peripheral?

The custom signalling angle is what got my attention. I've got a project where I needed a weird handshake and ended up bit-banging it, eating my CPU budget the whole time. If a few LUTs can do that instead, that's the kind of odd job I'd actually reach for it on. One thing I'd want to know before committing: does the tooling for it let you describe the logic in plain C or config registers, or are you stuck learning some HDL? That alone decides whether I'd bother.

Count me as another one who hasn't shipped anything with it yet, but the safety angle is what pulls me in. I've got a project where a watchdog plus some GPIO fiddling is doing what you're describing, and honestly it feels fragile. If the shutdown condition can live in hardware where a hung core can't touch it, that alone makes it worth reading the docs. Curious whether anyone's actually wired one up for that yet though.

Join the Discussion

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

Didn't find your answer?

Ask the community — no account required