Skip to main content

Getting Started with TinyCLR

Install the dev tools, flash firmware to a SITCore board, and deploy your first blinking-LED program over USB. About 15 minutes start to finish.

What is TinyCLR?​

TinyCLR is a .NET runtime for embedded products from GHI Electronics. You write C# in Visual Studio or Visual Studio Code (VS Code), deploy and debug over USB, and the same code runs across every SITCore hardware form factor — chipsets, modules, single-board computers, and dev boards. No JTAG, no external programmer, no separate toolchain.

Out of the box: modern C# (generics, async/await, top-level statements), step debugging in your IDE, full peripheral coverage (GPIO, SPI, I²C, UART, networking, displays, file system), security (TLS, secure boot, IP protection, encrypted firmware updates), and cloud SDKs for Azure and AWS. Browse the full features list for the deep dive.

TinyCLR is royalty-free for SITCore customers.

What you'll need​

  • A SITCore board — chipset, module, SBC, or Dev Board. New to TinyCLR? The FEZ Flea is the cheapest entry at $14.95 — plug it into USB and you're running. For a structured hands-on path, the Experimenter Kit bundles a FEZ Bit with sensors, a robot, and a companion eBook.
  • A Windows PC with Visual Studio 2026 — any edition works, including the free Community Edition
  • A USB cable
  • A machine that already builds C#: the .NET desktop development workload in Visual Studio, or a .NET SDK for VS Code. Being comfortable creating a project and adding NuGet packages is assumed — this page teaches TinyCLR, not C# or .NET tooling.
note

TinyCLR development requires Windows. The deployment tooling is Windows-only — macOS and Linux aren't supported.

Prefer a lighter editor? VS Code is supported as well. This page uses Visual Studio throughout; the VS Code page covers its project type and workflow.

No JTAG probe, no external programmer, no separate toolchain.

How a SITCore board starts up​

A SITCore device runs three firmware components in order:

  1. GHI Electronics Bootloader — initializes the chip and hands off to TinyCLR. Hardcoded into the device — can't be changed and never needs to be updated.
  2. TinyCLR firmware — executes your managed code.
  3. Your managed application — the C# program you write.

The LDR pin controls which component runs. Holding LDR low at startup stops the device at the bootloader — that's how you load or update firmware. With LDR high (the default), the device boots into TinyCLR and runs your application.

Two other pins matter at startup:

  • APP — stops the managed application from running.
  • MOD — selects USB or UART for communication with your PC (USB by default).

After startup, all three pins return to default GPIO state and are available as normal GPIO (or peripheral pins) in your application. See Special Pins for the full reference, including which pins to expose on custom PCB designs.

Install or update firmware​

Before TinyCLR can run your code, your SITCore device needs the TinyCLR firmware loaded. The firmware includes the Common Language Runtime — it interprets compiled C# IL on the device, manages execution, and lets your IDE deploy and debug over USB.

When do I need this?

A board that's already running current firmware needs nothing. The usual sign that it doesn't is a deploy that fails with a checksum error:

Error: the reference mscorlib cannot be used with this version of the firmware.
Firmware checksum 0x8FF20F1B does not match the assembly checksum 0x04F4012C.

That means the firmware on the device is older than the NuGet packages your project references. Update the firmware with the steps below, then deploy again.

The firmware update procedure is the same for every SITCore product:

  1. Activate the bootloader — hold LDR low while resetting or power cycling the board. Boards bring LDR out to a button marked LDR, so in practice that means holding that button down while you press reset or re-plug the USB cable. (Each board's pinout shows where it is.)
  2. Open the TinyCLR Config tool.
  3. Connect to the device — select the correct COM port and click Connect. If the device doesn't appear, it isn't in loader mode — recheck the LDR pin and reset.
  4. Download the firmware from the Downloads page. Select the file in TinyCLR Config and click Update Firmware.

For manual firmware updates without TinyCLR Config, see the GHI Electronics Bootloader page.

Build your first project​

Let's get Visual Studio set up and the starter running.

Set up and run the starter​

  1. Install Visual Studio 2026. Any edition works, including the free Community Edition. During install, check the .NET desktop development workload.

  2. Install the TinyCLR Project System extension. In Visual Studio, go to Extensions → Manage Extensions.... Search for tinyclr, and install TinyCLR OS Project. Restart Visual Studio to finish installation.

  3. Open Visual Studio and select Create a new project.

  4. In the Create a new project window, pick TinyCLROS from the Platforms dropdown.

  5. Pick the TinyCLR Application template, then click Next.

  6. Give the project a name and select a location, then click Create.

  7. Plug your board into USB and hit Start (or press F5). Visual Studio compiles, finds your device, and deploys. (Need to pick the device manually? Use Project → Properties.) The template's starter code prints an incrementing counter to the Output window — confirming that your dev machine and the SITCore board are talking. Stop the program when you're satisfied.

Using VS Code instead?

VS Code is fully supported, with its own TinyCLR project type — a project made in one IDE doesn't open in the other, so pick per project. The VS Code page walks through creating a project and adding resources there. Everything after this section is identical in both.

From here on, the steps are the same whichever editor you use.

  1. Install the GHIElectronics.TinyCLR.Devices.Gpio and GHIElectronics.TinyCLR.Pins NuGet packages.

  2. Replace Program.cs with the code below. TinyCLR offers two GPIO APIs, and both ship in that one package — pick either tab, they do the same thing:

using System.Device.Gpio;
using System.Threading;
using GHIElectronics.TinyCLR.Pins;

// Adjust the pin for your board. For example:
// SCM13048Q Dev Board: SC13048.GpioPin.PA8
// SC20100S Dev Board: SC20100.GpioPin.PE11
// SCM20260D Dev Board: SC20260.GpioPin.PB0
using GpioController controller = new GpioController();
controller.OpenPin(FEZFlea.GpioPin.Led, PinMode.Output);

while (true) {
controller.Write(FEZFlea.GpioPin.Led, PinValue.High);
Thread.Sleep(100);

controller.Write(FEZFlea.GpioPin.Led, PinValue.Low);
Thread.Sleep(100);
}

Microsoft's standard System.Device.Gpio — the same API you'd write against .NET IoT on a Raspberry Pi.

  1. Press F5 again. The on-board LED starts blinking.

Both APIs work on the same hardware, and you can mix them in one application. GPIO covers the choice; the Electronics Lab lessons use the .NET IoT one throughout.

What's next​

You've shipped your first TinyCLR program. From here:

  • Create graphics — your first graphics tutorial: bounce a ball and draw text with BasicGraphics, then with the full graphics engine.
  • Build a touch UI — design two touch screens in the TinyCLR UI Designer and navigate between them.
  • VS Code — working in VS Code day to day: creating projects and adding fonts, images, and other resources.
  • Browse features — debugging, security, networking, displays, file system, multithreading, and a lot more.
  • Find your board's pinout and specs in the SITCore Hardware section.
  • Set up firmware updates and device options with TinyCLR Config.