Most active commenters
  • ebenupton(4)
  • ryukoposting(4)
  • robomartin(3)
  • vardump(3)

←back to thread

700 points elipsitz | 20 comments | | HN request time: 1.918s | source | bottom
Show context
ryukoposting ◴[] No.41195070[source]
I can't imagine someone using an RP2040 in a real product, but the RP2350 fixes enough of my complaints that I'd be really excited to give it a shot.

There's a lot going for the 2040, don't get me wrong. TBMAN is a really cool concept. It overclocks like crazy. PIO is truly innovative, and it's super valuable for boatloads of companies looking to replace their 8051s/whatever with a daughterboard-adapted ARM core.

But, for every cool thing about the RP2040, there was a bad thing. DSP-level clock speeds but no FPU, and no hardware integer division. A USB DFU function embedded in boot ROM is flatly undesirable in an MCU with no memory protection. PIO support is extremely limited in third-party SDKs like Zephyr, which puts a low ceiling on its usefulness in large-scale projects.

The RP2350 fixes nearly all of my complaints, and that's really exciting.

PIO is a really cool concept, but relying on it to implement garden-variety peripherals like CAN or SDMMC immediately puts RP2350 at a disadvantage. The flexibility is very cool, but if I need to get a product up and running, the last thing I want to do is fiddle around with a special-purpose assembly language. My hope is that they'll eventually provide a library of ready-made "soft peripherals" for common things like SD/MMC, MII, Bluetooth HCI, etc. That would make integration into Zephyr (and friends) easier, and it would massively expand the potential use cases for the chip.

replies(13): >>41195311 #>>41195541 #>>41195612 #>>41195790 #>>41196002 #>>41196768 #>>41197714 #>>41197884 #>>41198538 #>>41199263 #>>41199401 #>>41200014 #>>41200125 #
robomartin ◴[] No.41196768[source]
For my work, the lack of flash memory integration on the 2040 is a deal breaker. You cannot secure your code. Not sure that has changed with the new device.
replies(1): >>41196825 #
1. ebenupton ◴[] No.41196825[source]
It has: you can encrypt your code, store a decryption key in OTP, and decrypt into RAM. Or if your code is small and unchanging enough, store it directly in OTP.
replies(3): >>41196896 #>>41197713 #>>41198417 #
2. XMPPwocky ◴[] No.41196896[source]
What stops an attacker from uploading their own firmware that dumps out everything in OTP?
replies(1): >>41196960 #
3. ebenupton ◴[] No.41196960[source]
Signed boot. Unless someone at DEF CON wins our $10k bounty of course.
replies(1): >>41198170 #
4. robomartin ◴[] No.41197713[source]
Nice! Thanks for the direct communication BTW.

I guess you are very serious about competing with industrial MCU’s.

We had to use a 2040 shortly after it came out because it was impossible to get STM32’s. Our customer accepted the compromise provided we replaced all the boards (nearly 1000) with STM32 boards as soon as the supply chain normalized.

I hope to also learn that you now have proper support for development under Windows. Back then your support engineers were somewhat hostile towards Windows-based development (just learn Linux, etc.). The problem I don’t think they understood was that it wasn’t a case of not knowing Linux (using Unix before Linux existed). A product isn’t just the code inside a small embedded MCU. The other elements that comprise the full product design are just as important, if not more. Because of this and other reasons, it can make sense to unify development under a single platform. I can’t store and maintain VM’s for 10 years because one of the 200 chips in the design does not have good support for Windows, where all the other tools live.

Anyhow, I explained this to your engineers a few years ago. Not sure they understood.

I have a project that I could fit these new chips into, so long as we don’t have to turn our workflow upside down to do it.

Thanks again.

replies(1): >>41199432 #
5. phire ◴[] No.41198170{3}[source]
Do you have any protection against power/clock glitching attacks?
replies(2): >>41198355 #>>41199421 #
6. geerlingguy ◴[] No.41198355{4}[source]
I was reading in I believe the Register article that yes, that's one of the protections they've tested... will be interesting to see if anyone can break it this month!
7. ryukoposting ◴[] No.41198417[source]
You can certainly do that, sure, but any Cortex-M MCU can do that, and plenty of others have hardware AES acceleration that would make the process much less asinine.

Also, 520K of RAM wouldn't be enough to fit a the whole application + working memory for any ARM embedded firmware I've worked on in the last 5 years.

replies(2): >>41198829 #>>41199028 #
8. TickleSteve ◴[] No.41198829[source]
520K RAM is huge for most typical embedded apps. Most micros are typically around the 48K->128K SRAM.
replies(1): >>41203278 #
9. dmitrygr ◴[] No.41199028[source]
> Also, 520K of RAM wouldn't be enough to fit a the whole application + working memory for any ARM embedded firmware I've worked on in the last 5 years.

what are you smoking? I have an entire decstation3100 system emulator that fits into 4K of code and 384bytes of ram. I boot palmos in 400KB of RAM. if you cannot fit your "application" into half a meg, maybe time to take up javascript and let someone else do embedded?

replies(2): >>41199215 #>>41203430 #
10. vardump ◴[] No.41199215{3}[source]
There are plenty of embedded applications that require megabytes or even gigabytes.

For example medical imaging.

As well as plenty that require 16 bytes of RAM and a few hundred bytes of program memory. And everything in between.

replies(1): >>41200052 #
11. ebenupton ◴[] No.41199421{4}[source]
Yes, several approaches. More here: https://x.com/ghidraninja/status/1821570157933912462
replies(1): >>41200657 #
12. ebenupton ◴[] No.41199432[source]
It's a fair comment. Give our VSCode extension a go: the aspiration is to provide uniform developer experience across Linux, Windows, and MacOS.
replies(1): >>41201662 #
13. my123 ◴[] No.41200052{4}[source]
If it's in the gigabyte range it's just not an MCU by any stretch. And if it has a proper (LP)DDR controller it's not one either really
replies(1): >>41200068 #
14. vardump ◴[] No.41200068{5}[source]
Yes and no. Plenty of such applications that use a µC + an FPGA. FPGA interfaces with some DDR memory and CMOS/CCD/whatever.

Up to you what you call it.

replies(1): >>41203740 #
15. colejohnson66 ◴[] No.41200657{5}[source]
Unrolled for those without accounts: https://threadreaderapp.com/thread/1821570157933912462.html
16. robomartin ◴[] No.41201662{3}[source]
I will when I get a break. I'll bring-up our old RP2040 project and see what has changed.

I remember we had to use either VSC or PyCharm (can't remember which) in conjunction with Thonny to get a workable process. Again, it has been a few years and we switched the product to STM32, forgive me if I don't recall details. I think the issue was that debug communications did not work unless we used Thonny (which nobody was interested in touching for anything other than a downloader).

BTW, that project used MicroPython. That did not go very well. We had to replace portions of the code with ARM assembler for performance reasons, we simply could not get efficient communications with MicroPython.

Thanks again. Very much a fan. I mentored our local FRC robotics high school team for a few years. Lots of learning by the kids using your products. Incredibly valuable.

17. ryukoposting ◴[] No.41203278{3}[source]
Define "typical."

To my recollection, every piece of Cortex-M firmware I've worked on professionally in the last 5 years has had at least 300K in .text on debug builds, with some going as high as 800K. I wouldn't call anything I've worked on in that time "atypical." Note that these numbers don't include the bootloader - its size isn't relevant here because we're ramloading.

If you're ram-loading encrypted firmware, the code and data have to share RAM. If your firmware is 250K, that leaves you with 270K left. That seems pretty good, but remember that the 2040 and 2350 are dual-core chips. So there's probably a second image you're loading into RAM too. Let's be generous and imagine that the second core is running something relatively small - perhaps a state machine for a timing-sensitive wireless protocol. Maybe that's another 20K of code, and 60K in data. These aren't numbers I pulled out out of my ass, by the way - they're the actual .text and .data regions used by the off-the-shelf Bluetooth firmware that runs on the secondary core of an nRF5340.

So now you're down to 190K in RAM available for your 250K application. I'd call that "normal," not huge at all. And again, this assumes that whatever you're running is smaller than anything I've worked on in years.

18. ryukoposting ◴[] No.41203430{3}[source]
I'm smoking multiprotocol wireless systems for industrial, medical, and military applications. To my recollection, the very smallest of those was around 280K in .text, and 180K in .data. Others have been 2-3x larger in both areas.

I would sure hope a decstation3100 emulator is small. After all, it's worthless unless you actually run something within the emulator, and that will inevitably be much larger than the emulator itself. I wouldn't know, though. Believe it or not, nobody pays me to emulate computers from 1978.

19. misiek08 ◴[] No.41203740{6}[source]
So you make hardware costing dozens of thousands of dollars and brag about memory on 5$ chip? That explains a lot why so many medical and industrial (I haven’t touch military hardware) are so badly designed, with some sad proprietary protocols and dead few months after warranty passes. Today I’ve learned!
replies(1): >>41204442 #
20. vardump ◴[] No.41204442{7}[source]
As if that depends on the engineers!

When you make 1M thingies, $5 savings each means $5M CEO comp.