Amazon FreeRTOS
User Guide

Navigating the Demo Applications

This section contains information about directory and file organization and configuration files for the demos.

Directory and File Organization

There are two subfolders in the main Amazon FreeRTOS directory:

  • demos

    Contains example code that can be run on an Amazon FreeRTOS device to demonstrate Amazon FreeRTOS functionality. There is one subdirectory for each target platform selected. These subdirectories contain code used by the demos, but not all demos can be run independently. If you use the Amazon FreeRTOS console, only the target platform you choose has a subdirectory under demos.

    The function DEMO_RUNNER_RunDemos() located in AmazonFreeRTOS\demos\common\demo_runner\aws_demo_runner.c contains code that calls each example. By default, only the vStartMQTTEchoDemo() function is called. Depending on the configuration you selected when you downloaded the code, or whether you obtained the code from GitHub, the other example runner functions are either commented out or omitted entirely. Although you can change the selection of demos here, be aware that not all combinations of examples work together. Depending on the combination, the software might not be able to be executed on the selected target due to memory constraints. All of the examples that can be executed by Amazon FreeRTOS appear in the common directory under demos.

  • lib

    The lib directory contains the source code of the Amazon FreeRTOS libraries. These libraries are available to you as part of Amazon FreeRTOS:

    • MQTT

    • Device shadow

    • Greengrass

    • Wi-Fi

    There are helper functions that assist in implementing the library functionality. We do not recommend that you change these helper functions. If you need to change one of these libraries, make sure it conforms to the library interface defined in the libs/include directory.

Configuration Files

The demos have been configured to get you started quickly. You might want to change some of the configurations for your project to create a version that runs on your platform. You can find configuration files at AmazonFreeRTOS/<vendor>/<platform>/common/config_files.

The configuration files include:


Configures the size and quantity of static buffers available for use by the application.


Configures your device certificate and private key.


Configures the task parameters used in the demos: stack size, priorities, and so on.


Configures the parameters used to configure a Greengrass core, such as network interface IDs.


Configures the parameters related to MQTT operations, such as task priorities, MQTT brokers, and keep-alive counts.


Configures MQTT library parameters, such as the subscription length and the maximum number of subscriptions.


Configures the timeouts and the byte ordering when using SSL.


Configures the parameters used for an AWS IoT shadow, such as the number of JSMN tokens used when parsing a JSON file received from a shadow.


Configures parameters, including the Wi-Fi (SSID, password, and security type), the MQTT broker endpoint, and IoT thing name.


Configures the FreeRTOS kernel for multitasking operations.