5 ms·
Thanks for educating me as to the dumpster fire of patched together steps that take place in the first milliseconds of booting my PC. With regard to this: Int
by rkagerer 4y ago
Thanks for educating me as to the dumpster fire of patched together steps that take place in the first milliseconds of booting my PC.
With regard to this:
Intel CPUs ship with built-in microcode, but it's frequently old and buggy and it's up to the system firmware to include a copy that's new enough that it's actually expected to work reliably.
...I wish companies put more effort into releasing finished, polished products. Not just Intel. I played with an ESP32-S3 recently and learned not only was the entire digi controller for ADC2 'dropped' from support due to bad silicon, but using ADC1 with DMA was fraught with gotchas and blatently incorrect info in the documentation (reported at least a dozen to EspressIf and they acknowledged).
- taspeotis 4y agoSure but I have some sympathy here … a contemporary CPU probably has a million different capabilities and if some not-even-single-digit-percentage of them don’t work that’s a lot of errata. Plus it’s hardware! So it’s hard to fix it once it’s out.
- sgtnoodle 4y agoThe ESP32 ADC is a dumpster fire. I used one to sample an analog signal at 8Khz, looking for 400uS wide pulses (pacemaker capture pulses.) I originally started with an interrupt that triggered conversion from software. It would completely miss pulses 10-20% of the time and instead drift around, as if the ADC was floating rather than connected to anything. I finally got it to work reliably by switching to DMA through the I2S peripheral. Pretty much every hobby project I look at, people complain about how bad the ADC is, and then just proceed to take N samples and average them. It's not that the ADC is bad, it's that the underlying firmware is buggy. I suspect there's a race condition with the main CPU and a coprocessor that's using the ADC for some internal wifi stuff.
- rkagerer 4y agoYeah I felt that pain :-). On the ESP32-S3 ADC2 is shared with Wifi, but I don't think that's the case for ADC1. I made headway by throwing away all their boilerplate code and setting up the raw peripheral registers myself. I actually prefer it that way without all the abstraction underneath. Was getting nice results at 80kHz sample rate. Would love to turn it into a write-up as I'm not sure anyone has done this before with that chip (at least I couldn't find any sample code around). It's actually all in MicroPython at the moment to boot... but wouldn't be hard to convert to C (and might even clean things up due to the more natural fit of that language working with bitfields). What I'd really like is to make it into a DMA-based ADC module for MicroPython but I'm not familiar enough with compiling that platform from scratch, particularly on Windows.
- matthewfcarlson 4y agoIf you do end up writing it up, consider dropping it in the hackaday tip line (https://hackaday.com/submit-a-tip/ https://hackaday.com/submit-a-tip/). It sounds incredibly useful.
- gkhartman 4y agoThanks for the tip about the ESP32-S3 ADC2. Coincidentally, I was about to embark on that trail only to learn the hard way. You've likely saved me a good deal of frustration.
- ChuckNorris89 4y agoThis is why companies still choose to buy expensive microcontrollers from big name reputable manufacturers (Microchip, TI, SiLabs, NXP, Nordic, STM, Infineon, Renesas, etc.) instead of going for the cheaper Chinese ARM microcontrollers at half the price. They tend to usually test their designs a lot more thoroughly, which adds to the final cost, and even when their products do come with flaws, they're more likely to be transparent about it and assist you with workarounds and sometimes send over field engineers on-site to help you. They also tend to be more honest about the specs, capabilities and limitations of their products in the datasheets. Finding out half-way through the design phase that some claims in the datasheet are bogus is a no-go for most companies. If you're just doing hobby work, or tinkering, or planning to ship millions of bottom of the barrel products on AliExpress with no intention of providing any warranty or customer support for them, then it's fine to go with whatever's the absolute cheapest, but serious companies like Apple, Sony, etc. who care about the customer experience, won't risk delaying a product launch because they wanted to save 50 cents on a new unproven cheap microcontroller who's ADCs don't work right.
- RicoElectrico 4y agoUh, have you ever seen the length of a typical STM32 errata sheet? ;)
- ChuckNorris89 4y agoUh, have you read the part in my comments where I said that they're morel likely to be honest about it? Having a short errata or no errata at all doesn't mean the product is flawless. It could be that they don't know all the faults yet, or aren't sharing them, or both. For ST it could be that they seem to be the most popular cheap ARM microcontrollers for hobbyists and consumer products, so it's easier to find faults in them since so many companies use them, similar how the most used pieces of software also have the most vulnerabilities reported on them. Also, maybe ST was not a great example on my end, as they seem to have an obsession lately with outsourcing and farming out everything to the cheapest offshore location possible and penny pinching to the extreme for their consumer oriented parts. I don't blame them though, competition in the generic ARM microcontroller market is cutthroats and margins are slim and salaries are low and your major customers (Sony, Apple, Samsung, LG, etc) keep putting the pressure on you to lower your prices or threaten to look somewhere else.
- rbanffy 4y ago> dumpster fire of patched together That's more or less the history of the x86, from the 8086 and on. I'd add a couple extra expletives as well. I can imagine a number of better ways seeding CPU state prior to starting it in a way they could all be neatly started in parallel. > I wish companies put more effort into releasing finished, polished products. Some do. It's just that their hardware is expensive and not very available outside some niches.
- SassyGrapefruit 4y agoI think my favorite part of this discussion is that most developers give this sort of process/code a mystical vibe. Like it's some sacred code built by a priesthood of the world's greatest and smartest programmers. Not accessible to mere mortals. I encourage developers that work for me to just read the code and documentation. My advice to them is usually something along the lines of... Think of how you would have done it as a sophomore in college completing an overdue assignment... chances are it works just like that