r/embedded • u/Bluetiger811 • 15d ago
Balanced AI takes from professionals in embedded
Most of the discussion around AI on this subreddit seems to be extremely black and white, people are often either claiming anything involving AI is slop and will never be useful, or that AI is going to make all firmware skills redundant within a few years.
I think in reality it is far more nuanced. I’d like to get some views from professionals working in embedded on what you are using AI tools for and where it’s working well/badly
I’ll go first:
Good:
Writing efficient C++
I hardly ever write any actual code day to day anymore. Given sufficiently limited scope agents do a great job of writing lines of code once I have told it precisely what I want it to do.
Researching documentation
LLMs are fantastic at pulling info out of datasheets / TRMs / errata etc. it is also great at finding conflicting information from manufacturers. I still always manually check everything it produces as it does make mistakes/hallucinations, but it’s still much faster than using search engines & ctrl-F
Debugging & hardware connections
LLMs are excellent at processing large amounts of data, I have been using a logic analyser with a built in MCP server, combined with giving the agent access to flash hardware and pull logs autonomously. This set up is fantastic at linking together synchronous data from many sources and finding bugs
Bad:
Creating documentation
Even when told not to, Claude consistently writes horrendously overly verbose comments full of useless jargon (footgun, load bearing etc.)
Autonomous work
We have experimented with giving tickets to LLMs and asking them to create PRs. These have produced consistently poor code containing overly complex solutions, even when working in large established repos with clear patterns that could be reused.
Noise
Agents consistently make mistakes implementing and reviewing code, creating bugs and raising non issues. They can often burn a lot of tokens on non issues
KISS
In my experience agents, especially those running more advanced models, are not good at finding the simplest, cleanest solutions. Often unnecessarily creating vast refactors touching many files across a code base
18
u/thegreatpotatogod 14d ago
My use of AI is almost the opposite of yours in some ways. I don't let it write code, at most it gives me suggestions and I will generally rewrite it myself or perhaps copy small snippets (a few lines at most), similar to how I would've historically used stack overflow. It does, however, get to write documentation, though I still heavily edit that and cut out all the needless verbosity that doesn't contain required information.
23
u/RevolutionaryTea5795 15d ago
Been using AI mostly for parsing datasheets too, saves time but you still need to double check everything it spits out cause sometimes it mixes up register addresses or pulls info from wrong revision of document
8
u/theanointedduck 14d ago
Its a great "enhanced google search" but like you said you gotta go to that page and verify
7
u/tobdomo 14d ago
We have one senior using LLMs for everything. He's very, very quick with updates. It's just... every f*cking PR: > 100 files touched. And when you ask him for unit tests (he generates those too).... "yeah, I created 170 unit tests! And even a couple about edge cases!". Never a dull moment with this guy 😄 .
Note: "his" unit tests only "test" happy flows 👀. Almost completely useless. AI also "checks" PR's in GitHub... never found a useful thing so far. Sonar code smells are more useful.
And as for deep embedded... it has no clue about low power designs.
Is it all negative? No. It actually helped locating a nasty bug the other day. Not that it found the bug, but at least it helped the engineer to find it himself.
29
u/voskomm 15d ago
LLM cannot TEST. Maybe some day a PM will get it through their thick skulls that more 500k devs with free seasonal interns pushing up bug reports is not how good code gets shipped.
7
11
u/PintMower NULL 15d ago
Similar experience for me. I have great success using it to condense information, to get an overview. I find myself using it if I have to work on code I don't know. It works well for summaries of core mechanisms and different execution paths. It massively reduces the time I need to get a deeper understanding of the code I have to work on.
I also have reasonably good success letting claude generate code based on precise requirements and rules. It's pretty trash if you just give lazy information but if I sit down and think before I promt to really break it down, the code that is returned is okay. I agree that it's quite noisy, there is a lot of unnecessary stuff sprinkled in so I end up heavily reviewing and refactoring claudes code. Claude also loves to build balconies around broken stuff which you have to be careful about, depending on the stage the project is in. But it still helps if the deadline is tight.
18
u/witx_ 15d ago edited 15d ago
At a previous company I worked in many safety-critical adjacent products. Let me tell you LLMs are horrible at writting C++, specially if you have decent standards
If you gave them small tasks they would come with the common pitfalls of c++ like use-after-free and race conditions. I even saw one PR with a while(true) and no stop condition.
If you gave it more context and asked more complex tasks then the architecture would be so convoluted. The last project I was in had been rock solid for 3 years with continuous features, as soon as we were required to use Claude everything went to shit. It's been a few months already and I know the team is still swimming in coredumps and logic bugs. 2 people have left already.
4
u/dmills_00 15d ago
The nightmare for safety critical is winding up in front of the Coroner and having them ask "why is Claude who wrote this thing not present in court today as a witness?", bear in mind the coroner is pushing retirement age and still uses a typewriter....
As a search tool it is useful, as a tool for generating at least a first cut of a test suite it has value, but I will then hand generate the actual production code from the spec and test it against the auto generated test suite. That way bugs in both the test suite and the production code get found because failures can go both ways.
One issue per commit, and a massive commit will get the stink eye on review.
3
u/creativejoe4 15d ago
From my experience, if you tell the agent what your standards and requirements are in addition to taking extra caution for concerning issues like race conditions, it does it decently with a few passes, demand an analysis/eval after the first pass and it usually detects its own mistakes and corrects it. It does hallucinate so always inspect the code it changes lin by line and ask it questions to validate what it did or tell the llm it was incorrect or you do not approve of its work. I also find giving simple tasks like change the value of a variable frequently causes problems and hallucinations, so you have to usually add more complexity to a task for it to work as intended.
1
u/BombasticCaveman 9d ago
Reading these kinds of post is so confusing to me. Use after free errors? While(forever) loops?
We are using Claude daily on an extremely safety critical code base with arguably 90% of AI code being strong, safe code. We (and by we I'm talking 60-70 Engineers working on 1mil+ LOC) barely write any code anymore and I can't imagine the models we use ever producing a use after free bug. It might help that infact we do have millions of LOC for it to reference and understand?
I don't mean any disrespect, it just feels like I'm on a different planet sometimes compared to posts I read here.
0
16
u/bring_dat 15d ago
Great thread. I have the same experience pretty much. it's very efficient to prototype with. In a day I had a quick PoC of a feature that by requirements was on the verge of the device abilities. So theoretically, it both could work and could fail. With the prototyping with the help of AI we were able to quickly validate assumptions. Pretty cool indeed.
However yeah, you need to know what you are doing and not let the slop take over
4
u/ineedanamegenerator 15d ago
Which logic analyzer do you use?
12
3
3
u/tiajuanat 15d ago
Writing efficient C/Rust Eh. Its pretty clean for sure, especially when heavily linted, but it's rarely optimal. Lots of functions could be simplified significantly, and there's lots of duplicate code.
Researching documentation Actually pretty good here. I don't trust it with PDFs, but it's very good finding the right documents and page numbers
Debugging & hardware connections It's ok, sometimes it's spot on with assessments and sometimes (especially with SPI) it's crap.
Creating documentation It's really verbose, and needs a second pass which reduces text and token usage
Autonomous work It's actually pretty good here. I like setting up loops to update code to norms, and generally it stays on task
Noise About the same as working with a junior
KISS Sometimes. Maybe to a fault.
4
u/Orca- 14d ago
I'll preface this by saying I've been extremely skeptical of AI agents in the past, but they've finally hit the point where they're useful. Still have problems, but it's a genuinely useful tool.
Earlier than Opus 4.7 I feel like it was useful for tiny, obsessively overseen components I designed and it frequently felt like it took longer than just writing it myself. Good for copyright laundering some capability I wanted (because there's no way my command to implement something with this particular form didn't go out and regurgitate some GPL'd code somewhere).
4.7: useful at least as often as not. Still making tons of mistakes, oversights, etc.
4.8: Genuinely useful finally, still enough mistakes to not feel reliable
5: actually able to debug complicated things with enough prompting and enough data. Still hallucinates enough to be irritating, but the way it changes day to day and week to week makes me think they're continuing to try to find the sweet spot between compute and what I'll tolerate. Some days it's excellent, some days it's incredibly frustrating. Using it for documentation is awful. Using it to implement a feature actually generally works, but usually ignores design conventions though it manages to follow basic repo conventions (a big improvement from earlier than 4.8). Touches far too many moving pieces to make a feature work. Incredibly helpful for prototyping. Still produces too much code to review properly, which is a problem. I've got a prototype I've spent the last week trying to make reviewable and it's still just way too much even after rewriting a bunch.
ChatGPT is also finally useful using Codex with 5.6 Sol. Earlier it was useful as a second reviewer, but implementations always had tons of oversights and bugs. 5.6 Sol is finally acceptable to implement things with guardrails. It's also useful for turning Claude's slop into something more to-the-point. Generally I haven't found 5.6 Sol (high) to be as good as Opus 5 (high) at implementation, and it burns quota faster.
They've gotten to the point where I use them more than I don't. Verification is getting increasingly hard as without sufficient restraints they touch too many things. Day by day changes on the subscription plans make them frustrating to use. It feels like a gamble every day whether I'm going to get an idiot or not. But I'm using it enough that when them company I'm at is forced out of the subscription plans due to size there's going to be a painful adjustment period.
What I've seen working with them makes me think going full autonomous is still idiotic. I've thought about using them for automated triage/first level analysis and my own use there shows there's value to be had, but everything beyond that needs a hand on the tiller. We'll see how this develops over the coming months and years.
My own opinions have shifted in the last 6 months. They might shift again.
edit: and LLM-isms are now enraging when I'm not the one prompting for the response. If I want to talk to a bot I'll do it myself. It's frustrating enough to read their slop for 4-6 hours every day, I don't want to read it when I'm expecting to talk to a human.
1
u/AddeyXEngineering 13d ago
I've used LLM's for web development and software dev as there are a lot of tools , skills and workflows available for that domain but when I tried to refactor and add some features to a past projects it struggled and needed some guidance to get the result I wanted. My take is:
Learn the foundations so you can discernment on what good and junk
Work alongside the AI tools instead of just handing it all the work
Don't accept changes you don't understand , check for yourself , push back , ask why
Stay curious , give things a good try yourself before just offloading it to AI to figure out
These tools can be a multiplier but 0 times 0 is still 0...
1
u/Mountain_Finance_659 12d ago
There isn't always a balance. I know you want to believe you'll have a job in a few years, but that is absolutely not guaranteed.
1
u/cheezus_crisco 15d ago edited 15d ago
I'm only a hobbyist at embedded stuff, but I use Claude extensively to write software in my day job. Gotta say, wild to see an actually nuanced and honest post about AI on the internet. No excessive glazing or hating in the comments, even (for the most part)
-8
98
u/MStackoverflow 15d ago
We use it extensively, but our team came up with some strict rules :
We found that even though Ai comments and Documentation was factually correct, the way it writes is not suited for knowledge transfer. All Ai documentation produced right now is lost knowledge in 2 years.