Monday, December 23, 2024

Raspberry Pi Pico 2 arrives with twin RISC-V cores

Must read

It’s exciting news for RISC-V fans: Raspberry Pi is adding support for the open ISA with the launch of the Pico 2 and the company’s new RP2350 microcontroller.

The Pi Pico 2 that arrived at a seaside Vulture outpost today – click to enlarge

The Pico 2 board retails for $5 and, according to the Pi team, retains backwards hardware and software compatibility with previous versions. While the on-chip memory has been upped to 520KB – there is also 4 MB of on-board QSPI flash – the two RISC-V Hazard3 CPU cores included in the microcontroller may well interest enthusiasts and implementers alike.

The Hazard3 cores are optional: Users can at boot time select a pair of included Arm Cortex-M33 cores to run, or the pair of Hazard3 cores. Both options run at 150 MHz. The more bold could try running one RV and one Arm core together rather than two RV or two Arm.

Hazard3 is an open source design, and all the materials for it are here. It’s a lightweight three-stage in-order RV32IMACZb* machine, which means it supports the base 32-bit RISC-V ISA with support for multiplication and division in hardware, atomic instructions, bit manipulation, and more.

Pi supremo Eben Upton told The Register, “RISC-V is an exciting development for us: Our goal is to give software developers a chance to experiment with a different architecture in a stable, well-supported environment, and to express our enthusiasm for the Hazard3 open-hardware core, which was developed by Luke Wren, one of our ASIC engineers, in his spare time.

“I think RISC-V provides researchers with an interesting environment for architectural experimentation, and SoC designers with a high degree of configurability. One contribution we’re making here is to legitimize Hazard3 as a mature, ‘clean’ core for verbatim use in other designs, or as a basis for further development.”

As for leaping into the world of RISC-V, Upton explained how the cores would work: “They’re selectable at boot time: Each port into the bus fabric can be connected either to an M33 or a Hazard3 via a mux. You can even, if you’re feeling obtuse, run with one of each.”

Hazard3 is a modest but capable microcontroller-grade design. It’s not for running a modern general-purpose operating system on. Then again, that’s not really the point of the Pico 2 and the RP2350.

Upton told us: “FreeRTOS is the preferred OS (as on RP2040). There’s an increasing amount of excitement around Zephyr, and some community effort to port that to the RP2 platform, and we may engage formally with that in due course.”

As with the original Pico, there are 26 multi-purpose GPIO pins, though the jump from 264KB of SRAM and 2MB of onboard flash opens the device up to more intriguing development options. Aside from the obvious, “Does it run Doom?” question – the answer is yes – the RP2040 on the original Pico has been pressed into service by the emulation community, not forgetting the recent implementation of Apple’s original Mac on the device.

Security

The Pico has also turned up in smart home implementations and proven popular with industry, although perhaps not as popular as the team would like.

Some users have described the security features, or lack thereof, of the RP2040 as enough to make it a non-starter in the embedded world; they want to keep their proprietary code on the device away from reverse engineers, and the RP2040 doesn’t help with that.

To that end, the Raspberry Pi team has implemented what it calls a “comprehensive security architecture” into the new microcontroller. This is built around Arm TrustZone for Cortex-M and incorporates signed boot, 8KB of antifuse OTP for key storage, SHA-256 acceleration, a hardware TRNG, and fast glitch detectors. There’s also secure boot ROM.

According to the Pi team, this will allow “professional users to integrate RP2350, and Raspberry Pi Pico 2, into products with confidence.”

Well Arm’d

Upton was keen to emphasize the additional performance on tap. On the Arm side, the Pico has stepped up from two Cortex-M0+ cores to a Cortex-M33 pair, which each have extra bells and whistles including an FPU and DSP.

“The extra performance, and particularly floating point and DSP performance, opens up a bunch of new applications, both for hobbyists and professional users,” he said of the Pico 2.

“Some of our music synth customers (we have a surprisingly large number of these) are quite excited about the things they’ll be able to do with the platform.”

However, he noted, “The security and low-power features are probably as interesting to industrial customers as the additional performance.”

The downside to all the improvements is the inevitable price increase – the Pico started at $4, and the Pico 2 is slated to begin at $5. While unlikely to worry enthusiasts too much, the price increase could concern customers buying in bulk.

The Pico 2 also lacks some of its predecessor’s connectivity options – a Wi-Fi version is not yet available. However, Upton told us that one would arrive “likely before the end of the year.”

Getting hold of one could also be tricky. Upton told us that “this is going to be a pretty shallowly stocked launch,” with more volume set to come through in the next few weeks. The price increase was attributed to cost growth in the platform and a slightly more expensive chip – the RP2350 is $0.10 more than the RP2040.

And the number? Sadly nothing to do with the Amiga 2000’s 2350 genlock, but instead derived from the basic chip itself. As Upton explained: “2350 = 2x Cortex-M33s, with 2^5*16KB of SRAM and 0KB of Flash.

“The 0 indicates the chip itself has no Flash included. In this generation we’ll be offering an RP2354 variant which includes 2MB (=2^4*128KB) of in-package QSPI Flash.”

As for how the hardware and software compatibility works, Upton told us, “Pretty much everything should work, though it’s a case of recompiling rather than just deploying the same binary.”

While the microcontroller business represents a tiny percentage of Raspberry Pi’s revenue, its volume is becoming substantial.

The price increase may be a shame for some, though there is that additional processing oomph on offer. The arrival of RISC-V in Hazard3 form makes the Pi Pico 2 intriguing from both a hobbyist and an industry perspective.

It will be very interesting to see what customers make of it. ®

Latest article