Embedded Programming
Toolchains & Workflows: How We Get Our Boards Working!
What I Understood About Toolchains ?
When we started working with microcontrollers, we thought we’d just write code, press upload, and everything would magically work. Turns out, there’s a whole behind-the-scenes process that makes it happen—that’s what a toolchain is!
Basically, a toolchain is the set of tools that helps us write, compile, debug, and upload code to a microcontroller. Without it, our code is just words on a screen. Each board has a slightly different way of handling this, so we had to figure out what works best for each one.
-
A compiler to convert our code into something the board understands.
-
A linker that organizes the code and makes it executable.
-
A debugger to help us fix any issues.
-
A flashing tool to upload the program to the board.
-
An IDE (like Arduino IDE, VS Code, or Thonny) where we write and test the code.
How We Programmed Different Boards ?
Board | Toolchain Used | Our Experience | Best For |
---|---|---|---|
Arduino (ATmega328P) | AVR-GCC, AVRDUDE | The easiest! Just write code in Arduino IDE and click upload. Great for quick prototyping. | Beginners, simple projects |
ESP32 (WiFi + Bluetooth) | ESP-IDF, Arduino-ESP32 | A little tricky at first, especially setting up ESP-IDF. But once it works, it’s super powerful for IoT! | Wireless projects, IoT |
RP2040 (Raspberry Pi Pico) | GCC ARM, OpenOCD | Supports both C++ and MicroPython. Flashing is easy—just drag and drop a file onto the board! | Robotics, real-time control |
What We Learned?
At first, toolchains felt overwhelming, but once we saw them in action, they made sense. Each board has a different workflow, but all follow the same basic steps:
writing code → compiling → debugging → flashing.
The right toolchain makes this process smoother, and choosing the right board depends on what we want to build!
My First Time with Wokwi – A Journey of Debugging, Trial, and Success
Getting Started – First Look at Wokwi
Wokwi is an online simulator, so you don't need to download anything. You can access it directly from your browser
Wokwi looked like a fun and simple way to simulate circuits, so I jumped in without much thought. The interface was clean, and there was already a default program running on the screen. It felt easy—until I started making changes.
What I expected : "I’ll tweak some values, and everything will work."
What actually happened : "Why is nothing working? What did I break?"
Step-by-Step Process & My Experiments
1.Running the Default Program – Success
To begin, I didn’t touch anything and just clicked "Run Simulation." The pre-written code ran smoothly, and I saw the circuit working. A great start, but I wasn’t here to just watch—I wanted to experiment.
2.Changing Color Names to Blood, Muscle, and Vein – Instant Failure
My first thought was, "Let’s make the colors more human-like!" So, instead of red, green, and blue, I replaced them with blood, muscle, and vein.
Result: It didn’t work at all.
Why? Turns out, computers don’t understand creative color names. Unlike humans, they need precise numeric values or predefined words like "red" or "blue."
Lesson learned: Computers aren’t poetic. They’re logical.
3.Swapping Color Values – Small Change, Big Success
After failing with custom names, I decided to just swap the existing RGB values instead.
Code Change:
Red → Green Green → Blue Blue → Red
Result: The colors changed as expected! This showed me how modifying simple numerical values instead of inventing new ones actually works.
4.Printing Text – Displaying "I am Devanshi"
Since colors were tricky, I thought, "Let’s try something simpler—just print my name!"
Code Change: I modified the program to print "I am Devanshi" on the serial monitor.
Result: It worked exactly as expected! Seeing my own name appear on the screen was oddly satisfying.
Lesson learned: If one thing doesn’t work, try another approach. Sometimes, text-based outputs are easier to debug than visual ones.
5.Trying Neil Gershenfeld’s Fab Academy Code – Server Issues Excited by my previous successes, I found a code linked on the Fab Academy website by Neil Gershenfeld and pasted it into Wokwi.
Issue: The website wouldn’t load properly due to high traffic. I refreshed, reloaded, and even tried a different browser, but the simulation never started.
Lesson learned: Online tools have limitations—sometimes external factors (like traffic) affect the experience.
6.Debugging Code – Removing Unnecessary Elements
Since the simulation wasn’t running, I thought, "Maybe it’s overloaded with too many elements. Let me simplify it."
What I did:
1.Removed extra components that weren’t essential.
2.Focused only on the part that blinks a light to see if that works.
New Problem: Unexpected errors appeared!
I double-checked the syntax. It looked fine. I verified the hardware components. They were correct. I searched online for solutions but couldn’t figure out why it wasn’t working. Lesson learned: Modifying someone else’s code isn’t always easy—it requires understanding their logic. Just deleting parts randomly can break dependencies.
7.Final Attemp – Building My Own Circuit
I decided to stop fixing existing code and instead build my own circuit from scratch.
This project uses an XIAO ESP32-C3, a servo motor, an LED, and two push buttons to create a simple control system.
Button 1 → Moves the servo left (0°) and turns the LED ON Button 2 → Moves the servo right (90°) and turns the LED OFF The components are connected to the ESP32-C3’s GPIO pins, and the code reads button inputs to control the servo and LED.
Result: It finally worked!
After struggling with multiple errors, getting a fully functioning circuit felt amazing. This was a major moment of learning—turns out, starting fresh is sometimes easier than fixing broken code!
Key Takeaways from My Wokwi Experience
Not all changes are valid – Just because something makes sense to me (like "blood" as a color) doesn’t mean the computer understands it. Errors aren’t always obvious – Some problems took a long time to figure out, and others had no clear reason. Debugging is an art as much as a skill. Tool limitations exist – Online platforms depend on factors like server traffic. Sometimes, an issue isn’t in our code but in the tool itself. Writing my own code was easier – Instead of modifying a complex program, starting from scratch gave me more control. Persistence pays off – After multiple failures, getting a working circuit felt like a real achievement. This was my first embedded simulation, and it was totally worth it!