# Blinking an LED with the Zephyr RTOS

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/088/622/medium800/microcontrollers_Zephyr-logo.png?1582504736)

There are lots of ways to make programming microcontrollers really easy - CircuitPython, MicroPython, and Arduino are all options to get your project up and running, even as a beginner programmer. But sometimes you don't just need easy - you need _beefy_. When it's time to break out the big guns, you might consider using an RTOS - a Real Time Operating System, sort of a very tiny version of what runs on your desktop or laptop computer, but one that's built for single-chip microcontrollers like those on an Arduino or Feather board.

![](https://cdn-learn.adafruit.com/assets/assets/000/088/624/medium800thumb/microcontrollers_blinkygif.jpg?1582505696)

An RTOS is built to handle chips with lots of features automatically, juggling sensors, buses, screens and buttons without huge messes of custom code to manage them all. Unlike Arduino's `startup`/`loop`, or Circuitpython’s `while True:`, an RTOS can run many different operations (called Tasks) in _parallel_, never allowing any one task to fall too far behind. This means an RTOS is great for big, sprawling projects that have a lot of things running at once, or for projects like sensor data collection where one task is so critical that it needs to be constantly serviced.&nbsp;

However, all this capability comes with a cost - RTOSes can be big and complex, since they're usually marketed toward corporate teams or very experienced freelancers. But they don't have to be hard to learn! In this guide, we'll be sticking to the basics - getting an LED up and running in an up-and-coming RTOS, Zephyr, which has been backed by the Linux Foundation, Intel, NXP, and many other powerful microcontroller companies.

You'll learn how to:

- Install the Zephyr core on Mac OSX or Linux computers
- Install Zephyr's custom management tool, West
- Test your setup with the RTOS's built-in sample projects
- Create your own application folder
- Blink an LED on the Feather STM32F405 Express
- Start learning RTOS concepts for custom projects

## Parts

The heart of this project is the Feather STM32F405 Express:

### Adafruit Feather STM32F405 Express

[Adafruit Feather STM32F405 Express](https://www.adafruit.com/product/4382)
ST takes flight in this Feather board. The new STM32F405 Feather ([video](https://youtu.be/CZ6TtvYJTeI)) that we designed runs CircuitPython at a blistering 168MHz – our fastest CircuitPython board ever! We put a STEMMA QT / Qwiic port on the end, so you can really easily plug...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4382)
[Related Guides to the Product](https://learn.adafruit.com/products/4382/guides)
![Angled shot of a blue rectangular microcontroller.](https://cdn-shop.adafruit.com/640x480/4382-16.jpg)

Depending on whether you want to work exclusively off of USB, or use a JLink programmer, you may also need one or more of the following parts:

### Part: USB C to USB C Cable
quantity: 1
A USB C Cable for the Feather STM32F405 for computers with USB C / Thunderbolt ports
[USB C to USB C Cable](https://www.adafruit.com/product/4199)

### Part: USB Type A to Type C Cable - approx 1 meter
quantity: 1
A USB C Cable for the Feather STM32F405 for computers with traditional USB Type A ports
[USB Type A to Type C Cable - approx 1 meter](https://www.adafruit.com/product/4474)

### Part: SWD 0.05" Pitch Connector - 10 Pin SMT Box Header
quantity: 1
A solderable STM box header, required for Jlink programming
[SWD 0.05" Pitch Connector - 10 Pin SMT Box Header](https://www.adafruit.com/product/752)

### Part: SEGGER J-Link EDU - JTAG/SWD Debugger
quantity: 1
The Educational Edition Jlink - use this for hobby or student work
[SEGGER J-Link EDU - JTAG/SWD Debugger](https://www.adafruit.com/product/1369)

### Part: SEGGER J-Link BASE - JTAG/SWD Debugger
quantity: 1
The professionally licensed Jlink - use this if you intend to do professional work
[SEGGER J-Link BASE - JTAG/SWD Debugger](https://www.adafruit.com/product/2209)

### Part: JTAG (2x10 2.54mm) to SWD (2x5 1.27mm) Cable Adapter Board
quantity: 1
Jlink SWD adapter board, required for programming the Feather with Jlink
[JTAG (2x10 2.54mm) to SWD (2x5 1.27mm) Cable Adapter Board](https://www.adafruit.com/product/2094)

### Part: 10-pin 2x5 Socket-Socket 1.27mm IDC (SWD) Cable - 150mm long
quantity: 1
Jlink SWD adapter cable, required for programming the Feather with Jlink
[10-pin 2x5 Socket-Socket 1.27mm IDC (SWD) Cable - 150mm long](https://www.adafruit.com/product/1675)

- [Next Page](https://learn.adafruit.com/blinking-led-with-zephyr-rtos/hardware-setup.md)

## Featured Products

### Adafruit Feather STM32F405 Express

[Adafruit Feather STM32F405 Express](https://www.adafruit.com/product/4382)
ST takes flight in this Feather board. The new STM32F405 Feather ([video](https://youtu.be/CZ6TtvYJTeI)) that we designed runs CircuitPython at a blistering 168MHz – our fastest CircuitPython board ever! We put a STEMMA QT / Qwiic port on the end, so you can really easily plug...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4382)
[Related Guides to the Product](https://learn.adafruit.com/products/4382/guides)
### USB Type A to Type C Cable - approx 1 meter / 3 ft long

[USB Type A to Type C Cable - approx 1 meter / 3 ft long](https://www.adafruit.com/product/4474)
As technology changes and adapts, so does Adafruit. This&nbsp;&nbsp; **USB Type A to Type C** cable will help you with the transition to USB C, even if you're still totin' around a USB Type A hub, computer or laptop.

USB C is the latest industry-standard connector for...

In Stock
[Buy Now](https://www.adafruit.com/product/4474)
[Related Guides to the Product](https://learn.adafruit.com/products/4474/guides)
### SEGGER J-Link BASE - JTAG/SWD Debugger

[SEGGER J-Link BASE - JTAG/SWD Debugger](https://www.adafruit.com/product/2209)
The SEGGER J-Link BASE is identical to the cheaper&nbsp;[J-Link EDU](https://www.adafruit.com/products/1369)&nbsp;model except for the **terms of use**.

If you're going to use your debugger strictly for personal, non-commercial projects, such as publishing...

In Stock
[Buy Now](https://www.adafruit.com/product/2209)
[Related Guides to the Product](https://learn.adafruit.com/products/2209/guides)
### JTAG (2x10 2.54mm) to SWD (2x5 1.27mm) Cable Adapter Board

[JTAG (2x10 2.54mm) to SWD (2x5 1.27mm) Cable Adapter Board](https://www.adafruit.com/product/2094)
This adapter board is designed for adapting a 'classic' 2x10 (0.1"/2.54mm pitch) JTAG cable to a slimmer 2x5 (0.05"/1.27mm pitch) SWD Cable. &nbsp;It's helpful for using products like the [JTAGulator](https://www.adafruit.com/products/1550) or <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/2094)
[Related Guides to the Product](https://learn.adafruit.com/products/2094/guides)
### 10-pin 2x5 Socket-Socket 1.27mm IDC (SWD) Cable - 150mm long

[10-pin 2x5 Socket-Socket 1.27mm IDC (SWD) Cable - 150mm long](https://www.adafruit.com/product/1675)
These little cables are handy when programming or debugging a tiny board that uses 10-pin 1.27mm (0.05") pitch SWD programming connectors. We see these connectors often on ARM Cortex dev kits, and have a few handy in our ARM-dev box. We thought you may want a backup cable as well, so now...

In Stock
[Buy Now](https://www.adafruit.com/product/1675)
[Related Guides to the Product](https://learn.adafruit.com/products/1675/guides)
### SEGGER J-Link EDU - JTAG/SWD Debugger

[SEGGER J-Link EDU - JTAG/SWD Debugger](https://www.adafruit.com/product/1369)
[Discontinued - **you can grab&nbsp;** SEGGER J-Link EDU Mini - JTAG/SWD Debugger **instead!**](https://www.adafruit.com/product/3571)

The SEGGER J-Link EDU is identical to the more expensive [J-Link BASE](https://www.adafruit.com/products/2209) model except...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1369)
[Related Guides to the Product](https://learn.adafruit.com/products/1369/guides)
### SEGGER J-Link EDU Mini - JTAG/SWD Debugger

[SEGGER J-Link EDU Mini - JTAG/SWD Debugger](https://www.adafruit.com/product/3571)
Doing some serious development on any ARM-based platform, and tired of 'printf' plus an LED to debug? A proper JTAG/SWD HW debugger can make debugging more of a pleasure and less of a pain. It allows you to program your devices at the click of a button, read or write memory addresses...

In Stock
[Buy Now](https://www.adafruit.com/product/3571)
[Related Guides to the Product](https://learn.adafruit.com/products/3571/guides)

## Related Guides

- [Adafruit STM32F405 Feather Express](https://learn.adafruit.com/adafruit-stm32f405-feather-express.md)
- [CAN Bus with CircuitPython: Using the canio module](https://learn.adafruit.com/using-canio-circuitpython.md)
- [Introducing Adafruit Feather](https://learn.adafruit.com/adafruit-feather.md)
- [Reverse Engineering a Bluetooth Low Energy Light Bulb](https://learn.adafruit.com/reverse-engineering-a-bluetooth-low-energy-light-bulb.md)
- [Debugging CircuitPython On SAMD w/Atmel Studio 7](https://learn.adafruit.com/circuitpython-samd-debugging-w-atmel-studio-7.md)
- [Debug Header for the Feather [M0]](https://learn.adafruit.com/make-a-simple-debugging-featherwing-for-the-m0.md)
- [Adafruit nRF52 Pro Feather with Mynewt](https://learn.adafruit.com/adafruit-nrf52-pro-feather.md)
- [Adafruit Metro M4 Express featuring ATSAMD51](https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51.md)
- [Debugging the SAMD21 with GDB](https://learn.adafruit.com/debugging-the-samd21-with-gdb.md)
- [Adafruit seesaw](https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout.md)
- [Programming an M0 using an Arduino](https://learn.adafruit.com/programming-an-m0-using-an-arduino.md)
- [Proper Debugging of ATSAMD21 Processors](https://learn.adafruit.com/proper-step-debugging-atsamd21-arduino-zero-m0.md)
- [CircuitPython Powered Sip & Puff with ST LPS33HW Pressure Sensor](https://learn.adafruit.com/st-lps33-and-circuitpython-sip-and-puff.md)
- [Bootloading Basics](https://learn.adafruit.com/bootloader-basics.md)
- [Introducing the Adafruit nRF52840 Feather](https://learn.adafruit.com/introducing-the-adafruit-nrf52840-feather.md)
- [Programming Microcontrollers using OpenOCD on a Raspberry Pi](https://learn.adafruit.com/programming-microcontrollers-using-openocd-on-raspberry-pi.md)
