Live data from Hacker News

I like the RP2040

dgroshev.com

81–90 of 413 posts

Re: I like the RP2040

#81
We've been using the RP2040 in the electronic badges[1] for the RVASec security conference[2] for the past several years, and it's been very nice to write software for. Here's the github repo for this year's badge (there's a software-only badge simulator so you can kind of play around with it even without the hardware, although some of the multi-player things that rely on infrared badge-to-badge communication won't be any fun): https://github.com/HackRVA/badge2024

[1] Video of the 2023 badge: https://www.youtube.com/watch?v=KWZriUMNpLc [2] https://rvasec.com/

Re: I like the RP2040

#82
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.…

You're right about the technicals, but I think its about the use cases. RP2040 is indeed one of its kind and is suddenly a great choice for so many projects, both hobby/educational and proffessional embedded devices. With its price vs possibilities it just covers soooo much when You know it's just one single chip version. To me, this is what tech progress is all about.

Re: I like the RP2040

#83
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.

Re: I like the RP2040

#84
post #60

Earlier quoted context omitted.

I was on the fence about using it for a small commercial project I'm doing, but the lifetime has been put out long enough (2041 at this point), and it's so freaking cheap that I'm going to do a one-time buy of 10 years worth of parts. Lack of code security and onboard flash weren't dealbreakers for me here, but others will have more stringent requirements. QSPI is so incredibly cheap now.

Ok. One thing I'm worried about is that the tooling is made for hobbyists only. Is there a way to do everything from the commandline with FOSS tools and without installing e.g. the Arduino-IDE?

I'm not sure how things are in the C land, but if you write Rust take a look at this book [1], Embassy has a very good support for the RP2040.

Probe-rs [2] works perfectly well with GDB and the CLion debugger.

[1]: https://embassy.dev/book/

[2]: https://probe.rs/

Re: I like the RP2040

#85
post #60

Earlier quoted context omitted.

I was on the fence about using it for a small commercial project I'm doing, but the lifetime has been put out long enough (2041 at this point), and it's so freaking cheap that I'm going to do a one-time buy of 10 years worth of parts. Lack of code security and onboard flash weren't dealbreakers for me here, but others will have more stringent requirements. QSPI is so incredibly cheap now.

Ok. One thing I'm worried about is that the tooling is made for hobbyists only. Is there a way to do everything from the commandline with FOSS tools and without installing e.g. the Arduino-IDE?

Yes. Pico SDK is C with CMake and Rust is bare metal (I think).

Re: I like the RP2040

#86
post #49
post #45

Earlier quoted context omitted.

Definitely not. My understanding is they got significant market share on lunch - since it was during the pandemic chip shortage and they were the only ones with sub year lead times.

Ok, but does it fulfill military or automotive standards?

Probably yes, but it doesn't have the paperwork AFAIK.

Re: I like the RP2040

#87
post #48

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.

...because that means there's a lot of support and documentation for that 1 variant and lots of people have solved problems and written about it, This is like the iPhone strategy against Nokia. When I worked at Nokia it produced many variant phones - each with a little more ram or a bit less or a better screen or a different chipset. This was because they thought that people bought on price and wanted to have a produ…

Making software for all those models was exhausting. It took an entire team just to profile phones and make configurations for compilers (what is the screen resolution? does it have feature x? is there a physical keyboard, and how many buttons does it have? where are the crucial buttons located? ...), and then you ended up with hundreds of targets taking days or weeks to make a build. I know many programmers that quit the industry altogether during those times.

Re: I like the RP2040

#88

Earlier quoted context omitted.

I ended up cutting a section on Rust support from the post, but if you're open to Rust (iirc you were sceptical at some point?), async Rust is really pleasant to use in embedded. Dario Nieuwenhuis, one of the main people behind Embassy, gave a great overview talk at RustNL: https://www.youtube.com/watch?v=H7NtzyP9q8E

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, forcing you to write event-driven code. Rust async makes this easy, and a bit of function coloring is no big deal compared to converting blocking code into event-driven code the traditional way...

Re: I like the RP2040

#89
post #18

How are people using this in practice? I’ve never worked with a BGA device. I’m guessing you need to design a board send it to say pcbway and then have the equipment to solder the bga in?

I built a custom RP2040-based board by designing it KiCad and then sending it off to JLCPCB to be fabbed and they assembled the SMT components. I didn't do a direct comparison, but it was cheap - cheap enough that it's possible that getting the board pre-assembled from JLC was cheaper than buying the raw parts in low quantities from Digikey and assembling it myself (which, given my experience level, would be pushing the edge of my capabilities). I made a second run recently and even added some through-hole to the assembly and the board cost was still single digit dollars per board. The major problem was that shipping prices from JLC seem to have gone up significantly in the past year.

Keep in mind that it's not just the RP2040 that is difficult to solder. To do a decent PCB layout you'll need to use very small passives in order to get the placement right. I did my layout with mostly 0402 resistors and capacitors - I know plenty of people are capable of hand-soldering those but I think it would be difficult for most. Perhaps easier if you had a decent microscope, which I do not have yet. I don't think my magnifying visor would be nearly enough.

Re: I like the RP2040

#90
post #60

Earlier quoted context omitted.

I was on the fence about using it for a small commercial project I'm doing, but the lifetime has been put out long enough (2041 at this point), and it's so freaking cheap that I'm going to do a one-time buy of 10 years worth of parts. Lack of code security and onboard flash weren't dealbreakers for me here, but others will have more stringent requirements. QSPI is so incredibly cheap now.

Ok. One thing I'm worried about is that the tooling is made for hobbyists only. Is there a way to do everything from the commandline with FOSS tools and without installing e.g. the Arduino-IDE?

I'm using the CircuitPython environment. I'm editing in vi and writing directly to the USB storage on the RP2040, which reboots upon write and runs the code. It's no big deal. There's also a virtual UART off that USB connection for light debugging.
Post reply on HN