Live data from Hacker News

I like the RP2040

dgroshev.com

91–100 of 413 posts

Re: I like the RP2040

#91

Earlier quoted context omitted.

I disagree. Rust on embedded is fantastic (I do STM32 programming on rust all the time, and have used the RISC-V ESP chips and nRF-52 as well), but Async Rust on embedded suffers from the same problems of contagion and coloring that non-embedded async rust has.

Everything had tradeoffs, but the composability of the state machines built by the compiler's async support allows you to easily build multi-tasking bare-metal systems with thousands of "tasks" and no RTOS (or SRAM-wasting threads). I highly recommend playing with Embassy for a week before discounting this approach for embedded software. If you care about RAM consumption, you need to share the stack between tasks, fo…

I have - it does not avoid the structural and compatibility problems of Async in other contexts.

Re: I like the RP2040

#92

Earlier quoted context omitted.

To be frank, I don't get its appeal at all. Most hobbyist uCs were already unbrickable, and using mass storage mode for flashing is rather cumbersome and clunky to automate as soon as you're past hello worlds.

I've never had great luck with the mass storage flashing. It works fine, but boy is it slow. I bought a J-Link a few years ago and haven't looked back. (It just takes a long time for the OS to recognize a USB device. And you have to press the reset button yourself in order to enter the bootloader. With something like J-Link, your build script can handle pressing the reset button and sending the code, saving you quite…

A debug probe is nice (quite possibly a must) if you're actively developing, but for deploying in a hobbyist environment, USB is hard to beat.

I make open source espresso machine hardware (github.com/variegated-coffee), and it's nice to be able to give users a wired way to update firmwares that doesn't require extra hardware.

Re: I like the RP2040

#93

TL;DR: he likes it because there's only one version available, whereas most microcontrollers have many more than one variant. This seems like a very weak argument. IMO (just based on the specs; haven't actually used it), the main reason to use this is for the PIO stuff. That's a very niche use case though.

The real risk with the chips that offer the same die in dozens of slightly-different packages is the supply chain. Rest assured about 80% of those variants will be out of stock more or less permanently in a few years, once a few major customers have settled on a few specific parts. Good luck guessing which ones you'll be able to get.

Re: I like the RP2040

#94

Earlier quoted context omitted.

Are you gated on PCB real estate, or cost? 8 megabits of QSPI is under 50 cents. I really don't care that it's external if the entire chipset is under 2 bucks.

Not the OP, but I'll say, whenever designing a fresh board, this sort of convenience built-in is nice. Individually, it's not a huge deal, but when you start adding things that are sometimes built in (external crystal vice internal? flash? PDs on USB or a bus?), you appreciate when it's one less component to allow spacing for, that might be out of stock at a given order etc. Also note that QSPI flash has a number of…

Exactly this, it's just another thing to deal with and I save a little time by not having to.

Re: I like the RP2040

#95

The PIO's really are the star of the RP2040 show, giving it a capability that competing chips like the ESP32 can't match. They are appearing all over the place in the console hacking space for this reason. Lower power consumption in steep modes for battery-backed applications would be a welcome addition in any V2 version though.

Ditto for robotics. 8 PIO units are enough to read and log four quadrature encoders at practically no interrupt cost, so it's possible to build a perfectly performant closed loop controller in something as slow as Micropython.

Re: I like the RP2040

#96

The lack of built-in flash kills it for me. STM32 M3s with comparable throughput are cheaper and don't require an external flash chip (example: STM32F103C8T6 for $1.20 from jlc). I love the generic PIO though, I really hope other manufacturers pick up on that.

That chip has over 10x less RAM and only 60k flash. It has only one core and that core is clocked at half the speeds compared to both the RP2040 cores. And it cost six bucks from US distributors. I can buy a single RP2040 chip from Digikey for 70 cents. Even if you add another dollar for flash memory, you are still far better off.

I mean, that's sort of my point: the rp2040 has an absurd amount of RAM for a micro, I don't need it and don't want to pay for it.

I care more about the cost to manufacture boards with the part, than the cost to get sample parts mailed to me in the US :)

Re: I like the RP2040

#97

Earlier quoted context omitted.

Everything had tradeoffs, but the composability of the state machines built by the compiler's async support allows you to easily build multi-tasking bare-metal systems with thousands of "tasks" and no RTOS (or SRAM-wasting threads). I highly recommend playing with Embassy for a week before discounting this approach for embedded software. If you care about RAM consumption, you need to share the stack between tasks, fo…

I have - it does not avoid the structural and compatibility problems of Async in other contexts.

Can you go into more details? Most of the criticism I've read tends to be more abstract ("I don't like how ALL my blocking-style calls need to be async"), and doesn't propose an alternative mechanism to async that can provide a similar coding style in the same tight RAM footprint.

Re: I like the RP2040

#98
post #80

The issue is that its a comparison about apples to peaches. The RPI2040 is JUST the chip whereas the ESP32 come with tons of peripherals for your liking. From Wifi/Bluetooth Antenna, LI Battery Controller, Ethernet whatever, Display or Camera Connector - You choose. And then we have a multitude of even CPU choices and when running on a coin cell it makes a difference powering a second, unnecessary core or even wifi.…

It's safe to assume he's talking about the chip in both cases. You can connect either of them to a battery charger, camera, or nuclear reactor but all of those 'peripherals' are completely irrelevant to this comparison.

So is GP.

The silicon chip itself for an ESP has:

bluetooth, ethernet, wifi, SD/EMMC, and a bunch more "peripherals" built into it.

The RP2040 does not.

To make this painfully clear:

For an esp32 to do wifi you wire the esp32 to an antenna.

For an RP2040 to do wifi you wire the 2040 to another chip, and that other chip to an antenna.

Do you see the difference?

Re: I like the RP2040

#99
post #27

Earlier quoted context omitted.

I suspect this mostly refers to "Code Protect" or similar functions, that are designed to stop the user for extracting the firmware from a device in the field. Typically, when this is enabled, large parts of the debug interface stop working, and turning it off requires a "secure" erase, that clears the loaded firmware. While many CP implementations are flawed, or can be bypassed by a skilled attacker (power glitching…

Consider that in other fields of computer security we treat a device where attackers have physical access to be de facto compromised.

Even with chip security features this is still the case (if an attacker gets their hands on it it can be compromised). There's no chip that exists that I'm aware of that can't be compromised to have its firmware dumped.

It's like locks: Every time a manufacture claims to have made an unpickable lock someone goes and picks it. It's the same for chip security features.

Microcontroller "security" features really are security theater and not actual security. The only real reason they exist is because certain vendors/"big buyers" will require it as part of their parts checklists (which is silly) and it provides a way for chip manufacturers to wriggle more money out of each sale.

Re: I like the RP2040

#100
post #31

If you are an electronics hobbyist but don't want to make/design your own surface mount boards (like me) there are lots of very accessible RP2040 boards at very low prices. I've used it in the Raspbery Pi Pico ($5) which comes on a nice board with lots of IO. There is a W version for a bit more with WiFi. If you don't mind slightly less IO then you can order an RP-2040 Zero. I got 6 off AliExpress for about $12. Thes…

I like to shout out the pico ice. Most of the $30 price tag is for the UP5K tied at the hip, but for embedded projects where you have some sub-microsecond activities it's a (relatively) inexpensive option with open source tooling.
Post reply on HN