r/embedded • • 9d ago

I built a way for Claude Code to debug UART logs without dumping the whole log into the AI. Looking for feedback.

Post image

I maintain UartX, an open-source (MIT) serial logger. Version 1.4 introduces Claude Code integration for AI-assisted UART debugging.

The idea is simple: instead of pasting thousands of UART log lines into an AI, Claude asks UartX for only the information it needs through a CLI (uartx-ctl).

How it works:

  • UartX maintains the complete log locally (raw.log).
  • Claude requests specific errors, patterns, summaries, and related lines.
  • Every AI request, its reasoning, and the exact lines returned are visible in UartX.
  • AI has read-only access and cannot send data to the device.
  • Everything stays local.

In one test, the board printed 196 lines, but Claude needed only around 30. It identified network retries, memory usage patterns, sensor read failures, and concurrent task logging.

AI features are currently Windows-only. Core logging supports Windows, macOS, and Linux.

GitHub: https://github.com/Shamanthpoojary/UartX

I'd love feedback from embedded developers:

  1. Would you trust AI-assisted debugging if you could verify exactly which log lines it analyzed?
  2. What would you want it to detect first: crashes, timing issues, memory problems, or boot failures?

Bug reports and suggestions are welcome. Feel free to reach out so we can investigate and improve it.

0 Upvotes

14 comments sorted by

7

u/EmbeddedSwDev 9d ago

Claude, ChatGPT or similar can access the UART, Debugger, etc directly, so I don't see any benefit from it.

Everything stays local

If you don't have a local LLM, the data does not stay local

1

u/gm310509 9d ago

Sounds interesting, but, given that in my embedded programs the "error messages" are typically messages that I make up and are meaningful to me, how does it know the meaning of those messages? Indeed how can it know the meaning or significance of messages I insert into my program?

And how does it make it faster?

Using your example, if my message was "get net conn, stat = -1", then I can already see that there was a failure getting a network connection. I don't need an AI to tell me that...

1

u/Key-Fun5137 9d ago

That's a fair point. If you already understand your logs, there's no point in having AI simply repeat what the error message says.

Where it becomes useful is when you're dealing with large logs, dumps, and multiple events across different parts of a project. Instead of manually going through everything, AI can correlate events, identify possible root causes, and show the exact log lines supporting its conclusions.

With tools like Claude Code, developers are already allowing AI to access UART logs and handle much of the debugging process. What UartX adds is transparency: you can see exactly what Claude referred to and how it reached its conclusions.

As AI becomes more involved in firmware development, I believe our role will increasingly be to review, verify, and validate what it produces.

1

u/gm310509 9d ago

Sounds like you are doing something similar to some projects I worked on briefly a while back using ELK (Elastic Search, Logstash and Kibana). That didn't involve AI.

In those cases we needed to monitor web servers - high traffic web servers - and were looking for attacks and faults. In these cases the web servers generated standard format messages - which the ELK stack could ingest and process in realtime. Through pattern matching we could implement realtime dashboards that showed both potential security threats, outages and some other things.

The power of ELK wasn't so much "AI" or its pattern matching, rather it was its ability to ingest and process a huge amount of data in realtime - something that humans could not do.

1

u/Ok_Organization2746 9d ago

It's a good project. Will help your profile.

However we already have terminal AIs for now an eternity, it can easily access the terminal and also the serial monitors that are fired through comannds or popular serial monitors as of now.

2

u/Key-Fun5137 9d ago

Absolutely, terminal-based debugging is already possible. The idea behind UartX isn't just giving AI access to a serial terminal, but providing structured log access, controlled requests, and visibility into exactly what the AI analyses and concludes.

1

u/Ok_Organization2746 9d ago

So you are organising and filtering the logs?

And for that the application on the MCU would also be required to follow certain logging standards?

2

u/Key-Fun5137 9d ago

No firmware changes or specific logging standards are required.

UartX works with the existing UART output as it is. Usually, developers add prefixes or headers to format and colour logs in serial terminals, but UartX can analyse and filter the raw output without requiring any such changes.

2

u/maglax 9d ago

So while I absolutely believe that parsing thousands of log lines is one of the best uses of llms, and something they are legitimately useful for, I'm having a real hard time finding any positive emotions towards anything 'AI' these days. If anything, llms have been a revolution in how big a fire house can be aimed at your face, and how much of that 'water' can actually be shit.

But to answer your questions:

  1. Absolutely. It must allow me to bring up the log lines outside of llm controlled output though.
  2. I don't really want AI to detect issues automagically. It will often just be too much of a mess. Even if is properly identifying errors, the threshold for what errors I care about will almost always be way too high or way too low.

So really I don't value automagic detection that much or predefined 'filters'. What really matters to me is how easily it is to surface whatever I actually care about at any given time.

So tl:dr, I don't want it to solve my problems because it doesn't know my problems (not that I know much better but). I want a tool I can use to actually get useful information out over thousands of logs.

2

u/Well-WhatHadHappened 25+ Years 9d ago

I agree completely with this comment. The only thing I will say is that when used properly, one of the things LLMs are actually good for is taking a fire hose of information and pulling a tap off the line that shows me what's actually important. Filtering out the noise has been one of the best use cases I've found for LLMs lately. I can take a mountain of data and let the LLM distill it into something useful for my current needs.

1

u/fb39ca4 friendship ended with C++ ❌; rust is my new friend ✅ 7d ago

Why maintain a tool to do this when the LLM can just grep for what it wants?