CLOUD SERVICE · AWS

FreeRTOS - FreeRTOS is an open-source real-time operating system for microcontrollers, with libraries for embedded connectivity, security, and integration with AWS IoT services.

FreeRTOS provides a small-footprint kernel and embedded software libraries for building applications on resource-constrained microcontrollers. It runs on the device rather than as a hosted AWS service, and applications can use its networking and security libraries to communicate with AWS IoT or other endpoints.

Cloud Services Hub →

What is FreeRTOS

Read the extensive description

FreeRTOS is a real-time operating system for microcontrollers and small embedded processors. Its kernel provides task scheduling, queues, semaphores, mutexes, software timers, and other primitives used to coordinate concurrent application work. Engineers compile the kernel and selected libraries into device firmware, together with application code, hardware drivers, and a board-specific configuration. FreeRTOS is not a cloud-hosted runtime, and devices do not need an AWS connection to use the kernel.

The kernel supports priority-based scheduling, allowing time-sensitive work to run ahead of lower-priority tasks. Applications commonly separate sensor acquisition, communications, control logic, and maintenance into distinct tasks. Predictable behavior still depends on application design: long critical sections, inappropriate interrupt priorities, priority inversion, and blocking operations can cause missed deadlines. Allocate task stacks deliberately, measure stack usage under realistic workloads, and choose a memory allocation strategy that matches the product's reliability requirements.

FreeRTOS libraries address common embedded networking requirements, including MQTT messaging, HTTP communication, and TLS integration. Libraries such as coreMQTT, coreHTTP, and corePKCS11 can be selected independently according to the application. Actual connectivity depends on the board, network interface, TCP/IP stack, and TLS implementation. Before choosing hardware, verify processor-port support, toolchain compatibility, available RAM and flash, network drivers, and any secure element or cryptographic acceleration requirements.

For AWS-connected products, a common architecture uses MQTT over TLS to communicate with AWS IoT Core. Each device typically has its own identity and certificate, with an AWS IoT policy restricting access to the required topics and resources. Store private keys in protected storage where possible, and plan certificate provisioning, rotation, revocation, and recovery before production deployment. A PKCS #11 integration can help isolate cryptographic operations, but the level of key protection depends on the underlying implementation and hardware.

Fleet maintenance also requires a complete firmware update design. AWS IoT Jobs and an over-the-air update agent can coordinate update delivery, while Amazon S3 can hold firmware artifacts. The device bootloader must enforce the intended image verification and rollback behavior; downloading a new image alone does not establish a secure update process. Test interrupted downloads, power failures, invalid signatures, and failed application startup.

The FreeRTOS kernel and AWS-provided FreeRTOS libraries are available without runtime license fees under the MIT license. Review licenses for any additional components included in the firmware. AWS services used for messaging, storage, monitoring, and fleet operations are billed separately. For long-lived products, select maintained component versions, track security advisories, and establish a repeatable process for rebuilding, testing, and distributing firmware updates.

Key FreeRTOS Features

Priority-based task scheduling

Run independent application functions as tasks with assigned priorities. Configure scheduling and task behavior to keep latency-sensitive work responsive without starving lower-priority processing.

Task synchronization and communication

Use queues, task notifications, semaphores, mutexes, and event groups to coordinate work. Select interrupt-safe APIs where required and avoid blocking operations inside interrupt handlers.

Configurable memory footprint

Include only the kernel functionality and libraries needed by the device. Static allocation options and selectable heap implementations help engineers control RAM usage and allocation behavior.

Portable kernel

Supported processor ports allow the kernel to run across many microcontroller families. Hardware drivers, interrupt configuration, linker settings, and board initialization remain platform-specific responsibilities.

Embedded networking libraries

Libraries such as coreMQTT and coreHTTP provide application-layer communication capabilities. Integrate them with an appropriate transport, network stack, and TLS implementation for the target hardware.

Cryptographic interface support

corePKCS11 provides a PKCS #11 interface for cryptographic operations and object access. Use a suitable implementation to connect application authentication to software key storage or supported secure hardware.

Over-the-air update building blocks

An OTA agent and AWS IoT integrations can support remotely delivered firmware updates. Production implementations also need a compatible bootloader, image authentication, failure recovery, and carefully scoped permissions.

Long-term support releases

FreeRTOS LTS releases provide designated component versions with security fixes and critical bug fixes during their published support periods. Track the support dates for the specific release rather than assuming all versions have the same maintenance window.

FreeRTOS Use Cases

Connected sensors

Schedule sampling, filtering, and MQTT publishing on a microcontroller. Buffer a bounded amount of telemetry during network outages and reconnect without interrupting essential local measurements.

Industrial monitoring and local control

Separate time-sensitive acquisition or control tasks from cloud reporting. Validate worst-case execution times and fault behavior independently of network availability; FreeRTOS alone does not establish functional safety compliance.

Connected appliances

Coordinate user interfaces, sensors, actuators, and network communication within a constrained device. Use AWS IoT messaging or device shadows to exchange status and desired settings with cloud applications.

Remotely maintained device fleets

Build firmware that can receive update instructions and install authenticated images. Combine staged rollouts with device-side recovery so unsuccessful updates do not require physical access.

Cloud-independent embedded products

Use the kernel for concurrent local processing without connecting to AWS. This fits controllers and instruments that need task scheduling and synchronization but have no cloud requirement.

FreeRTOS pricing models

No runtime license fee

The FreeRTOS kernel and AWS-provided FreeRTOS libraries are distributed under the MIT license without per-device runtime fees. Hardware, engineering, third-party components, and any separately contracted support remain independent costs.

Usage-based connected services

AWS integrations are billed separately under each service's pricing. Estimate MQTT messaging and connectivity, device management operations, firmware storage and downloads, rule processing, and downstream compute or logging based on fleet behavior.

Services FreeRTOS integrates with

<p>A common connected architecture runs FreeRTOS tasks for sensing and local control while a communication task exchanges MQTT messages with AWS IoT Core over TLS. Give each device a distinct identity and restrict its policy to the topics and operations it needs. Device shadows can represent desired and reported settings, but firmware must reconcile those settings with local state and handle reconnects.</p><p>Cloud processing typically begins with AWS IoT rules rather than direct calls from the microcontroller to every backend service. Rules can invoke Lambda for validation or application workflows, keeping cloud credentials and business logic off the device. Use bounded device queues, explicit retry behavior, and duplicate-tolerant processing to handle intermittent connectivity.</p><p>For maintenance, AWS IoT Device Management jobs can coordinate firmware rollouts using artifacts held in Amazon S3. Pair this workflow with authenticated images, a compatible bootloader, and tested recovery behavior. CloudWatch provides visibility into cloud-side connectivity and processing, while device diagnostics need a separately designed upload path. Monitor firmware versions and update outcomes alongside service metrics so fleet operators can distinguish network failures from application defects.</p>

Amazon CloudWatch image Amazon CloudWatch

CloudWatch can monitor the AWS-side services supporting a FreeRTOS fleet, including AWS IoT metrics and enabled AWS IoT logging. For example, use alarms to detect elevated connection failures or message-processing errors. Device application logs require an explicit ingestion path, such as MQTT messages routed through an AWS IoT rule; FreeRTOS does not automatically stream its logs to CloudWatch.

Open Amazon CloudWatch →
AWS Lambda image AWS Lambda

AWS IoT Core rules can invoke Lambda functions in response to messages published by FreeRTOS devices. For example, a temperature event can trigger validation and an application notification without embedding that business logic in firmware. Design the function and event processing to tolerate retries and duplicate messages.

Open AWS Lambda →
Amazon Simple Storage Service image Amazon S3

Amazon S3 can store firmware artifacts used in an OTA workflow. For example, an update job can reference an image stored in S3, with delivery to the device using the transport supported by the chosen OTA implementation. Configure artifact access carefully and ensure the device verifies image authenticity before installation.

Open Amazon S3 →
AWS IoT Core image AWS IoT Core

A FreeRTOS application can use coreMQTT with a TLS transport to publish and subscribe through AWS IoT Core. For example, a sensor can publish measurements to a device-specific topic and receive configuration changes through another topic or a device shadow. Provision device credentials and restrict the AWS IoT policy to the required resources.

Open AWS IoT Core →
AWS IoT Device Management image AWS IoT Device Management

AWS IoT Jobs can coordinate operations that device firmware executes, including firmware updates through an appropriate OTA agent. For example, target a test group with a new firmware version before expanding the rollout to production devices. The application or agent must process job documents and report execution status; creating a job does not automatically implement the operation on the device.

Open AWS IoT Device Management →