The firmware loop is simple:
- edit,
- compile,
- upload,
- observe serial output,
- change one thing,
- repeat.
Embedr keeps those steps in one workspace.
Compile
Compile turns source code into firmware for the selected target. It does not require a physical board.
Before compiling:
- select a target,
- make sure the project has
embedr.yaml, - make sure
platformio.inihas a valid environment, - save edited files.
Click Compile in the toolbar. Build output streams into the Output tab.
Read compile output
Compiler output can look noisy, but it has structure.
Look for:
- the first real error, not the last line,
- the file path and line number,
- missing header names such as
DHT.h, - type mismatches,
- unsupported board or framework packages,
- failed dependency installs.
If the Output tab shows an error state, click Ask agent to fix. The agent will receive the output and can inspect files before proposing a patch.
Upload
Upload flashes the compiled firmware to a device. It requires:
- selected target,
- selected device,
- board in bootloader or normal upload mode depending on board family,
- serial port not held by another process.
Click Upload. Do not unplug the board during upload.
Serial Monitor
Serial Monitor is how firmware speaks back to you. It is not only for printing text. It is an instrument for checking timing, state, sensor readings, connection status, protocol frames, and boot logs.
To use it:
- Select a device in the toolbar.
- Open the Serial Monitor tab.
- Choose a baud rate.
- Click Connect.
- Send text if your firmware reads serial input.
The baud rate must match your firmware. If your Arduino code uses Serial.begin(115200), set Serial Monitor to 115200.
Serial output as evidence
When debugging, treat serial output as evidence.
Good log:
boot
sensor init ok
raw=512 voltage=1.65V
threshold crossed
Weak log:
here
here2
works?
Descriptive logs make it easier for you, your teacher, your teammate, and the agent to reason about behavior.
Upload failures
If compile succeeds but upload fails, start at the physical layer:
- wrong port selected,
- charge-only cable,
- missing USB serial driver,
- another app has the port open,
- board requires BOOT button during upload,
- board is underpowered,
- target does not match physical board.
ESP32 boards sometimes need the BOOT button held while upload starts. Arduino Uno usually does not.
When to clean
Use a clean build when:
- switching frameworks,
- changing target families,
- stale generated files appear suspicious,
- PlatformIO reports odd dependency state,
- a compile error remains after a clearly correct fix.
The CLI exposes embedr clean; the app build flow may regenerate the needed state.
A reliable embedded debugging loop
Change only one variable at a time:
- Compile unchanged starter firmware.
- Upload starter firmware.
- Confirm serial output.
- Add one library.
- Compile again.
- Add one sensor read.
- Compile and upload again.
This is slower than guessing, until it saves your afternoon.
