Using AI (CodeX) for embedded work

Started by Jim Fouch, Oct 28, 2026, 11:29 PM

Previous topic - Next topic

Jim Fouch

Is anyone else using AI for embedded work? I have mad amazing gains the last 3 weeks on a very complex project.

It's a two part system with an I/O module and a Head unit with a touchscreen. Both units have an STM32 as well as an ESP32-S3.

The STM32's are for the real heavy lifting. An STM32G474 and an STM32H743. They will do all of the collection and displaying of rider information. The ESP32's on each unit will act as a link between the two, but also as programmers of the STM32's.

One of the things that has been bouncing around in my head for at least 2-1/2 years was how to get the STM32H743 to keep the display going during the flashing process. I knew it could probably be done doing a custom RAM based bootloader. I have never written a bootloader in my life. So, to say this was something I was afraid of digging into is an understatement.

I want the display to inform the user as the flashing process happens. I don't want it to simply have a blank screen during the maybe 15-20 minute process. So I explained to CodeX what I wanted to do. I had already made the screen work and it was able to use that example to build a RAM bases transport that used the factory bootloader to load he custom bootloader into RAM. This takes maybe 2-3 seconds that the screen has no way displaying anything, but after that the ESP32 has full commands to paint anything on the screen. Text, lines even images. It also has full use of the touch panel.

I was expecting this to take me months to sort it all out. Even three weeks would have been great. CodeX had it running in like 10 minutes for the first working version. Now mind you it's actually the PC that I tested it with and programming the STM32H743, but the RAM bases bootloader was part of that test. I probably have less than 6 hours total now into that function.

Now that it's proven to work I had it create the programming side on the ESP32-S3. It crunched for 30 minutes. I'll test that in the next few days.

Chris Savage

I have not yet tried it in the manner you're doing. The closest I have come is asking Gemini for an example of something, originally thinking it was going to show me an example found on the web, only to realize it was actually writing the code for me.

I've done it with a handful of Z80 math calculation examples as well as some Visual BASIC code that I am trying to update to modern Windows. That has worked out well for me.

                     Bringing concepts to life through engineering.

Jim Fouch

It always tries to steer me to C# when I ask it make a PC App. I always force it to code in VB.Net as that's what I have decades of experience in. And when the AI goes away, I want a fighting chance to make sense of what ever it's writing for me...LOL

18 months ago it would have only been able to help you with coding tasks and write functions. Now, it's starting from scratch and writing mid to large sized applications. Like I will tell it to create a complete communications protocol and just give it basic guidelines like all messages will be framed with STX/ETX characters and allow binary data using ESC. And Add a CRC16 on all messages. It does all the rest. Figures out how to pack the data. Things I would spend weeks or months designing in the past.

Chris Savage

Yeah, I can see where that would be useful, especially for VB.NET, which, while I have written many apps in the past 15 years, they're few and far between. Sometimes I have to relearn things because of changes. I remember going through that back when I wrote software at Parallax. My old code would lock up using the serial port because of multi-threading. Took me a while to figure that out. As a joke, I asked Gemini about it and it had already accounted for it based on the version of VB.NET I am using.

                     Bringing concepts to life through engineering.

SMF spam blocked by CleanTalk