Share this

Artificial intelligence and ChatGPT are changing embedded programming

2026-04-06 02:22:09 · · #1

Epic Method #1 - Accelerating Programming Development Through Artificial Intelligence

One agile approach I've always liked is pair programming. Pair programming lets two developers work together on a software feature. One developer acts as the driver by writing code, while the other acts as the navigator, checking for accuracy and keeping the bigger picture in mind. I've known for a long time that writing code for embedded systems isn't the hard part. Anyone can write code; it checks if the code is correct and does what it needs to do, and that's the trick.

Artificial intelligence models can generate code. Github's Co-pilot and OpenAI's code sandboxes do this well. Pairing a human as a navigator with an AI model that will write code is a great way to accelerate developer throughput. For example, I was recently developing a software module that included unit tests, where I used Co-pilot to help speed up development. As I started typing the name of the function or test I was writing, Co-pilot began suggesting what the code would look like, such as:

TEST(HeaterGroup, CreateThread)

{

UINT status;

TX_THREAD HeaterThread;

status = tx_thread_create(&HeaterThread, "HeaterThread", HeaterTask, 0,

HeaterThreadStack, HEATER_THREAD_STACK_SIZE,

HEATER_THREAD_PRIORITY, HEATER_THREAD_PRIORITY,

TX_NO_TIME_SLICE, TX_AUTO_START);

CHECK_EQUAL(status, TX_SUCCESS);

}

The co-pilot quickly generated a test, which I had to review and bless in this case. It wasn't always correct, nor was it always a good suggestion, but overall, it improved my coding speed. A human navigator can lead to higher quality and faster code development.

Epic Approach #2 - Faster Debugging

I found ChatGPT to be relatively good at finding bugs in code or suggesting improvements. Historically, according to Ansponco's 2020 Embedded Marketing Survey, developers spend an average of 20% of their time debugging code. However, I've encountered many developers and teams who spend over 40% of their time on debugging! Reducing debugging time can save months and hundreds of thousands of dollars in development costs. AI tools will help developers achieve this goal.

I recently used code in an article demonstrating C buffer overflows. The code is as follows:

#include

#include

int main (void){

printf("Hello, world!\n");

printf ("Let's overflow the buffer!\r\n");

uint32_t array[5] = {0, 0, 0, 0, 0,};

for(int index = 0; index < 6; index++) {

printf("Index %d: %d\r\n", index, array[index]);

}

return 0;

}

I pasted this code into ChatGPT and asked it to find the bug. The result is as follows:

"There is a buffer overflow in this code. The array is defined as having a size of 5, but the for loop attempts to access an index 6, which is out of bounds. This can lead to undefined behavior, such as overwriting memory that should not be modified."

To solve this problem, you can change the for loop condition to stop at 5, as follows:

for(int index = 0; index < 5; index++) {

printf("Index %d: %d\r\n", index, array[index]);

}

This way the loop will only access the valid indices of the array, and will not cause buffer overflow."

This may seem trivial, but its potential is compelling. ChatGPT is able to find buffer overflows, suggest ways to fix them, and explain why. Developers might spend more than 10-20 seconds discovering such a bug, especially if the bug is more complex.

We've already used static and dynamic analysis tools to improve our code. Using AI tools to review the code and suggest improvements is the logical next step. I've spoken with dozens of engineers who are already using ChatGPT to help them learn Rust, improve their C++ code, find better ways to write Python, and more.

Epic Approach #3 - Guiding Developers in the Right Direction

Sometimes, developers encounter activities they haven't completed before. In these situations, developers will need to go online, do some searching, do some research, try things out, and eventually, they'll figure it out. However, this process can sometimes take longer than we'd like. With AI tools, developers can find the right direction and accelerate the process much faster.

For example, if you are starting to develop a new product and must formulate a software development plan, you could ask what artificial intelligence should include. The response might look like this:

Project Overview: A summary of the project's objectives, goals, and scope.

Requirements: A detailed description of the software's functional and non-functional requirements.

Design: A description of the overall architecture and design of the software, including any relevant diagrams or schematics.

Development timeline: A detailed plan for software development, including tasks, milestones, and deadlines.

Testing and Quality Assurance: A plan for testing and quality assurance, including any relevant testing tools and methods.

Deployment and maintenance: The plan to deploy software and maintain it during production.

Resource allocation: A description of the resources required for the project, including personnel, equipment, and budget.

Risk management: A plan to identify and mitigate potential risks throughout the project.

Communication: Communication plans between project teams and with stakeholders.

Appendix: Any additional information related to the project but not included in the main body of the plan.

ChatGPT generated the list above. Is it accurate? I think it's an excellent first pass. The software development plans I use have much more content, but all of these projects are included. Therefore, someone creating their first software development plan will have a direction to follow.

Now, I think this is a good time to point out that you can't always trust AI tools to tell you what to do. I was recently working on a project where I had to enable Error Correction Code (ECC). I hadn't done it on that microcontroller before, and I was curious if ChatGPT would give me the right answer or point me in the right direction. I read the datasheet, put together what I needed to do, and implemented it. After validating my solution, I asked ChatGPT how to do the same thing. The output was in the right direction but missed some key details. If I had relied on it alone, I probably would have also tried to figure out why ECC wasn't working.

in conclusion

Many other tools, such as ChatGPT and CoPilot, will dramatically change the way businesses and developers write software (and more). However, I don't believe we'll be handing the keys to machines anytime soon. I doubt these tools can optimize real-time performance or create the right trade-offs to ensure deadlines are met in multitasking environments. Nevertheless, their potential to empower developers and help them become more efficient is enormous. Two of the biggest challenges facing most embedded systems companies are time-to-market and development budgets. Automation and processes can help teams move along this path, but artificial intelligence may simply be the tool that ultimately solves these challenges.

Read next

CATDOLL 109CM Dora Full Silicone Doll

Height: 109 Silicone Weight: 18.5kg Shoulder Width: 26cm Bust/Waist/Hip: 52/50/57cm Oral Depth: N/A Vaginal Depth: 3-13...

Articles 2026-02-22