🗣️ Building context - is all the difference
Khem Raj August 15, 2025 #metaAI coding agents are everywhere. If you are embedded software engineer, you might be tempted to ask away your problem directly "Write a zephyr I2C driver for photo sensor on ESP32" and the agent will spit out the code. Often this code is wrong, it has used wrong register set, peripheral addresses and HAL functions.
It is important to build a rich context before asking to write code.
- Feed the documentation, Technical Reference manuals, Specs, datasheets, User manuals pertaining to the hardware you are working on
- Ask it questions adjacent to the problem, if answers are a bit off, provide feedback
- Nudge it to think about alternatives
- Point to online forums relevant to the MCU or software at hand if it is open source It's even better
Now ask same question and see the difference.
I think Pareto principle applies here: 80% time in building the context, 20% time in generating/reviewing/applying code.