Embedarium by SDD Labs
English Türkçe

Writing and building code

Students and participantsInstructors and assistants

Getting to know the simulation workspace; files, the code editor, the build backend and clock frequency, build output, error messages and diagnostics; the Build & Analysis module for shippable output.

When you open a project, the workspace opens full screen. You write code, build it, run the program on the simulated processor and see the circuit, all in the same place.

Parts of the workspace#

The workspace with numbered parts
Parts of the workspace; the numbers follow the list below.
  1. Views: Code (the editor), Simulation (code and the live circuit side by side) and Circuit (the schematic editor). Switching views doesn't stop a running simulation.
  2. Commands: Save, Submit to assignment, Build, Debug and Run, on the second row of the bar next to the views. While debugging, the step buttons appear here too (see Debugging).
  3. Project: the project's name, its target processor and revision, and next to them whether your changes are saved. The arrow on the left goes back to your projects.
  4. Project explorer: the project's files. Switch to another of your projects from the Active project list, or find a file with Search files. The files under Processor pack (such as device.h and device.inc) belong to the pack and are read-only. The Code Notes panel lists the TODO:, FIXME: and HACK: comments in your code; select one to jump to that line.
  5. Code editor: an editor with syntax highlighting, line numbers and error markers. You can open several files in tabs.
  6. Output panel: Build (the build log), Diagnostics (errors and warnings), Trace (instructions executed while debugging), Build Outputs (the files produced) and Assistant (the AI helper — coming later, see The AI assistant).
  7. View buttons: font size (A− / A+), editor appearance (font and colors), showing and hiding panels (file explorer, output panel, revision history, code notes) and the editor theme.
  8. Status bar: target processor and language; the Build backend list (which compiler builds the code) and the clock list (the simulated processor's frequency, for example 12 MHz — timing is calculated from it); the length of one machine cycle; while running, the total cycle count and elapsed time; the project's revision.

Working with files#

  • New file: the + New button at the top of the explorer.
  • Renaming and deleting: the ⋮ menu at the end of the file's row has Rename and Delete, and Make entry file for a file the build can start from. The entry file itself can't be deleted.
  • The ENTRY badge marks the main file the build starts from (for example main.asm or main.c).
  • The project's circuit is stored in .embedarium/schematic.json; you don't need to edit it by hand — change the circuit in the Circuit view.

To save, select Save or press Ctrl+S (⌘+S on a Mac). Saved in the header shows your changes were written to the server. Every save is a revision; you can go back to earlier versions from the revision history.

How do I build my code?#

Select Build or press Ctrl+B (⌘+B on a Mac). Progress and the result appear on the Build tab of the output panel; a successful build shows the size of the program produced (in bytes).

A successful build and the build log
A successful build: the compiler, revision and program size at the top, the steps below.

Run (F5) builds first if needed, then runs the program; you don't have to build separately.

Choosing the build backend#

Choose the compiler from the Build backend list in the status bar at the bottom of the workspace:

BackendWhen
Built-in ASMAssembly on the 8051 family. No dependencies and fast; runs in the browser.
SDCC · C/ASMC (and assembly) on the 8051 family. SDCC 4.6 runs in the browser; the toolchain is downloaded once on the first build (about 4.8 MB).
Server SDCC · C/ASMThe same compiler for the 8051 family, on the server. Nothing is downloaded into the browser.
Server gcc · CATmega328P, ATmega2560 and ATtiny85 (avr-gcc) and Cortex-M0+ (arm-none-eabi-gcc). The build runs on the server in an isolated environment.
Server SDCC (PIC) · C/ASMPIC16F877A (SDCC pic14 and gputils), on the server.

Only the backends that match your project's target processor are listed.

Reading build errors#

If the build fails, the Diagnostics tab opens and lists each error with the file name, line number and description. The faulty line is underlined with a red squiggle in the editor. Select a diagnostic to jump to that line.

A build error on the Diagnostics tab
Diagnostics: the ERROR badge, file and line (main.asm:5) and the description. The faulty line is underlined in the editor.

Tip

An AI helper that explains build errors on the Assistant tab is planned for later (see The AI assistant).

Download diagnostics report downloads a file with the environment, the project lock, the toolchain and the latest build diagnostics; it doesn't include your source code. Attach it when you ask the support team for help.

Sometimes the error comes from the server rather than your code; then the panel says "The build server failed — this is not about your code." and shows a Retry with the same sources button.

Build outputs#

The Build Outputs tab lists the files the build produced — for example the program's HEX file, the listing and the memory map. You can preview, copy or download each file.

Building for release: Build & Analysis#

A build in the simulator answers "does my code run on the processor?". The Build & Analysis module answers "can this code be shipped to real hardware?": it builds the code on the server, runs static analysis and MISRA C:2012 checks, and produces downloadable outputs. The module is licensed separately; if your license includes it, Build & Analysis appears in the sidebar.

  1. Open Build & Analysis in the sidebar and select New build.
  2. Choose the source: a Simulation project (and its revision) or a ZIP package. The target device and toolchain come from the project.
  3. Select Start build. The job appears in the list; when it finishes it is Succeeded or Failed.
Build & Analysis: the job list and a job's details
A build job: the source, duration, the analyses that ran and the files produced.

In the job's details:

  • Outputs: HEX and BIN files, the listing, the memory map, the build log and other files depending on the target. Outputs are kept for 30 days; if you mark an output as a release, it is kept permanently.
  • Compiler diagnostics and Analysis findings: each finding is linked to a line; select it to open the project at that line of that file. "No findings" only means clean if that analysis ran; the job's details say which analyses ran (for example MISRA C:2012 (10 rules) · Static analysis (7 rules)).
  • Rebuild the same source and Open the project in the workspace.

You can also start a release build from the Simulation projects page: Build for release (Build & Analysis) in the row's ⋮ menu opens the new build dialog with that project selected.

Keyboard shortcuts#

KeysAction
Ctrl+S / ⌘+SSave
Ctrl+B / ⌘+BBuild sources
F5Run / continue debugging (builds first if needed)
Shift+F5End debugging
F9Toggle the breakpoint on the cursor line
F10Step over
F11Step into

In the workspace, F5 doesn't reload the page; it runs the program.

Last updated:

Could not find what you need? Write to support — tell us the screen and what you expected to happen.