DEV Community

Cover image for Zephyr CMake Hell is Dead: Why I Let Google Antigravity Write My Firmware
Errata Hunter
Errata Hunter

Posted on • Originally published at reversetobuild.com

Zephyr CMake Hell is Dead: Why I Let Google Antigravity Write My Firmware

I just burned another weekend chasing a ghost I2C timeout that wasn't even in the datasheet. Decided it was time to ditch the proprietary vendor lock-in and migrate to the modern Zephyr RTOS. My reward? Welcome to west and CMakeLists.txt hell.

Technical diagram of the Zephyr RTOS build pipeline illustrating how CMake processes Kconfig and Devicetree inputs to generate headers like autoconf.h and devicetree_generated.h before GCC compilation into zephyr.elf.

A high-level representation of Zephyr's build pipeline complexity. Before the HN pedants start arguing about exact CMake module dependencies in the comments—yes, this is simplified. The point is that you shouldn't need a PhD in build systems just to toggle a GPIO.

Bare-metal firmware debugging is painful enough on its own. We shouldn't have to bleed over build system setups too. Web devs have AI agents scaffolding their entire async microservice architectures while we’re still grepping through 2010-era PDFs just to figure out a device tree path.

Why I Brought Antigravity into the Embedded World

I got sick of it. I decided to throw Google's new agent-centric IDE, Antigravity, at my firmware problems.

The software world is moving at warp speed with AI, while the embedded industry remains a walled garden of bloated IDEs and slow iteration. We need to adapt. By offloading the massive barrier to entry—Kconfig labyrinths, linker scripts, and toolchain paths—to an AI agent, we can actually focus on what matters: the core logic and hardware interactions. I’m documenting this because we need to lower the barrier to entry in bare-metal engineering. Stop fighting the build system. Get your ideas out there.

Arming Antigravity: Mandatory & Recommended Extensions

It’s not some bloated enterprise tool. Setup is dead simple.

  1. Download the OS-specific build from [antigravity.google](https://antigravity.google/download).
  2. It’s a VS Code fork under the hood, so your muscle memory for shortcuts and UI remains intact.

But since we are forcing an AI agent to write firmware, we have to arm it with traditional weapons for hardware debugging. Go to the Extensions tab and install these:

1. Mandatory Extensions (The Core) The nRF Extensions Quirk: In standard VS Code, you'd just lazy-install the nRF Connect for VS Code Extension Pack and call it a day. However, Antigravity’s extension search currently doesn't index the consolidated pack. Don't panic. You just have to manually search and install its four horsemen individually:

  • nRF Connect for VS Code: The absolute backbone for SDK, toolchain management, building, and debugging.
  • nRF DeviceTree: Visualizes and edits the nightmare that is device tree structures.
  • nRF Kconfig: GUI editor for project settings so you don't go blind reading Kconfig files.
  • nRF Terminal: Serial and RTT logging terminal.

2. Recommended Auxiliary Extensions To actually read the code the agent spits out and survive debugging, you should install these for development efficiency:

  • Cortex-Debug (marus25.cortex-debug): Provides ARM Cortex-M debugging capabilities. Do not skip this. You can't debug bare-metal if you can't dump your hardware registers.
  • C/C++ (Microsoft): Essential for code compilation, IntelliSense (autocomplete), and debugging support.
  • CMake Tools (Microsoft): Manages the CMake build system, which is the beating heart of Zephyr.

The Antigravity Workflow: Navigating the nRF Connect Sidebar

Once you have the extensions installed, you'll see the Nordic icon pop up on your left activity bar. Open it up, and you get three beautiful panels:

  • Welcome: This is your entry point. You use this panel to manage your SDK versions, set up toolchains, and create new projects from templates.
  • Application: This shows the structure of your loaded Zephyr projects. It’s where you manage not just your source code, but also keep an eye on your device tree overlays and Kconfig (prj.conf) files.
  • Build: The holy grail. You don't have to constantly wrestle with west build commands in the terminal anymore. Once your board target is set, you just hit the "Build" and "Flash" buttons right here. Need to open the Kconfig GUI or start a Debug session? One click. It’s a completely frictionless workflow.

What’s Next: NCS and Project Architecture

The toolchain is ready, and the workflow is set. But before we unleash the AI to actually write our firmware, there’s a multi-gigabyte elephant in the room: installing the Nordic Connect SDK (NCS) and structuring your repository.

If you dump your code inside the vendor SDK folder ("In-tree") like beginner tutorials suggest, your Git history will become a dumpster fire.

In Part 2, I’ll walk you through taming the massive NCS installation without breaking your python paths. More importantly, we’ll deep-dive into the architectural holy war of Zephyr project management: Freestanding Applications vs. T2 Topology (Workspace). I’ll break down their pros, cons, exact use cases, and how to set them up so you don't hate yourself later. Stay tuned.

Top comments (0)