Targets and Environments

Choose the board you compile for, switch PlatformIO environments, pick the connected device, and tune upload and monitor settings.

Three pickers on the left of the bottom toolbar control firmware builds:

Picker Answers Needed for
Target Which board am I compiling for? Compile and Flash
Environment (layers icon) Which build profile in platformio.ini? Projects with more than one profile
Device Which port is the board plugged into? Flash and Serial Monitor

You can compile with nothing plugged in. You need a device only to flash or to open the serial monitor.

The pickers are hidden in Electronics only projects. On the home screen, the Target picker appears next to the composer when + Firmware is selected, so a new project starts on the right board.

Target

A target is a board preset. It resolves to three PlatformIO values:

Value Meaning Examples
Platform The PlatformIO platform package espressif32, atmelavr, raspberrypi, ststm32, nordicnrf52
Board The board ID within the platform esp32dev, uno, pico, bluepill_f103c8
Framework The SDK the firmware is written against arduino, espidf, zephyr, stm32cube, mbed

The esp32 target means "an ESP32 DevKit using Arduino". It does not detect or care which ESP32 is plugged in.

Choosing a target

  1. Click Target: in the toolbar (it reads Select Target when none is set).
  2. Type in Search targets.... With an empty box the list shows popular boards.
  3. Click a target.

Search matches the target ID, board ID, name, MCU, vendor, platform, framework and category. It ignores spacing and punctuation, so esp32s3, esp32-s3 and esp32 s3 find the same boards, and it tolerates small typos in queries of three or more characters. Results are ranked and capped at 50; refine the query if your board is not in view.

Hover a target to see its Platform, Framework, Board ID and Category.

Embedr ships about 200 board presets across ESP32, nRF, STM32, SAMD, RP2040, Teensy, RISC-V, NXP, Renesas, TI, Silicon Labs and other families, including ESP-IDF variants (esp32-idf, esp32-s3-idf, esp32-c3-idf, esp32-c6-idf) and Zephyr variants (for example nrf52840-zephyr). The CLI lists them:

embedr boards            # popular boards
embedr boards --all      # every preset
embedr boards -f s3      # filter by text
embedr boards -c nordic  # filter by category

What selecting a target changes

Selecting a target writes it into the project, so the choice travels with the folder:

  • platformio.ini gets an [env:<target-id>] section for the board (if it does not have one) and default_envs points at it.
  • embedr.yaml records it under capabilities.firmware as the active target.

For example, switching a new Uno project to esp32 leaves:

[env:uno]
platform = atmelavr
board = uno
framework = arduino
monitor_speed = 115200

[env:esp32]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200

[platformio]
default_envs = esp32

The old environment stays, so you can switch back from the Environment picker. Changing target does not rewrite your source. An Arduino sketch will not compile for an ESP-IDF target; ask the agent to port the code when you change framework.

Environment

An environment is one [env:name] section of platformio.ini. Use several when one project builds for more than one board, framework or configuration:

[env:esp32]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200

[env:esp32-debug]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
build_type = debug
build_flags = -DLOG_LEVEL=4

[platformio]
default_envs = esp32

The Environment button is the layers icon after Device. Its menu is headed ENVIRONMENT and lists every [env:...] section ("2 environments available"). Pick one to make Compile and Flash use it. An amber dot on the button means the selected environment is not the default one.

The tooltip reads "Environment: ". With no environments the button is disabled and the menu says "No environments in manifest".

Embedr remembers the environment you last chose for the project; otherwise it uses default_envs, then the first section.

Device

  1. Plug the board in with a USB data cable.
  2. Click Device: (Select Device when none is set). The CONNECTED DEVICES list rescans every time it opens; the rescan button (Scan for USB devices) scans again.
  3. Pick the port.

Each entry shows the port's description, or its path when the description is empty. USB serial adapters (CH340, CP210x, FTDI and other USB/UART ports) are listed first, and Bluetooth and debug-console ports are hidden. Hover an entry to see its full path.

System Typical port
macOS /dev/cu.usbserial-0001, /dev/cu.usbmodem14101 (shown without /dev/cu.)
Windows COM3, COM5
Linux /dev/ttyUSB0, /dev/ttyACM0

Embedr does not pick a port for you. It restores the last port you used if it is still connected, and clears the selection when that port disappears. Deselect Device clears it by hand.

"No devices detected" usually means a charge-only cable, a missing USB driver (Windows), missing serial permissions (Linux), or a board in a state where its USB port is off. See Troubleshooting.

In the browser, the list shows only ports you have paired; use Pair Browser Serial... to add one. See Embedr in the browser.

Target Settings

Open the Target menu and click Target Settings (gear) to tune upload and monitor settings for the active target.

Section Setting
Monitor & Serial Monitor Speed
Upload & Debug Upload Speed, Upload Protocol, Debug Tool
  • Each field shows the board's default on hover ("Default: …" or "Auto-detected"). A dot marks a value the project overrides.
  • The footer counts overrides ("2 project overrides active"). Click Save Project Settings to write them.
  • Restore saves the board defaults back over the project's values; Reload rereads the settings.

In a PlatformIO project the values are written into the active [env:...] section of platformio.ini:

[env:esp32]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 9600
upload_speed = 921600

In older projects without platformio.ini as the source of truth, they are saved in embedr.yaml and platformio.ini is regenerated from it.

Settings beyond these four (build flags, partitions, build type) go straight into platformio.ini, by hand or by asking the agent.

Custom targets

Use a custom target when PlatformIO supports your board but the list has no preset for it.

  1. Open the Target menu and click Custom Target....

  2. In Create Custom Target, fill in all four fields:

    Field Example
    Name My ESP32-S3 Board
    Framework arduino
    Platform espressif32
    Board esp32-s3-devkitc-1
  3. Click Save to keep it, or Save and Select to save it and switch the open project to it.

Custom targets are saved on this computer and are available in every project ("These presets are available across all projects on this machine."). They appear under Custom Targets at the top of the target list. Edit or delete them from Saved Targets in the same dialog. Names must be unique. Advanced upload and debug settings stay in Target Settings.

Custom targets are a desktop feature.

Projects with custom build commands

Projects that build with Make, CMake, Zephyr west, Cargo or a vendor SDK declare their own commands in embedr.yaml (see custom firmware actions). In those projects:

  • The Target and Environment pickers are disabled.
  • Compile runs your build action. Without one, its tooltip says "Add capabilities.firmware.actions.build to embedr.yaml to enable compiling".
  • Flash runs your flash action, and the Device picker is enabled only when a flash action exists. The selected port is passed to your command as EMBEDR_DEVICE_PORT.

Compile and Flash buttons

Button Tooltip when it cannot run What to do
Compile "Select a target to compile" Pick a target.
Flash "Select a target first" Pick a target.
Flash "Select a device to flash" Pick a device.

While running, the buttons read Compiling and Flashing. Build output goes to the Output tab. See Build, upload and serial.

Choosing a board to start with

For a first project, choose a common board with a simple USB upload:

Board Target Notes
Arduino Uno uno The default for new CLI projects. Slow, simple, very forgiving.
ESP32 DevKit esp32 Wi-Fi and Bluetooth. Flashable from the browser too.
ESP32-S3 DevKitC-1 esp32-s3 Native USB, more memory. Flashable from the browser too.
Raspberry Pi Pico pico Low cost, RP2040.

Learn target, device, compile, flash and serial monitor on one board before mixing families in a project.