Amazon FreeRTOS
Porting Guide

Implementing the configPRINT_STRING() macro

You must implement the configPRINT_STRING() macro before you port the Amazon FreeRTOS libraries. Amazon FreeRTOS uses configPRINT_STRING() to output test results as human-readable ASCII strings.

Prerequisites

To implement the configPRINT_STRING() macro, you need the following:

Implementation

To implement configPRINT_STRING()

  1. Connect your device to a terminal emulator to output test results.

  2. Open the file <amazon-freertos>/vendors/<vendor>/boards/<board>/aws_tests/application_code/main.c, and locate the call to configPRINT_STRING("Test Message") in the prvMiscInitialization() function.

  3. Immediately before the call to configPRINT_STRING("Test Message"), add code that uses the vendor-supplied UART driver to initialize the UART baud rate level to 115200.

  4. Open <amazon-freertos>/vendors/<vendor>/boards/<board>/aws_tests/config_files/FreeRTOSConfig.h, and locate the empty definition of configPRINT_STRING(). The macro takes a NULL-terminated ASCII C string as its only parameter.

  5. Update the empty definition of configPRINT_STRING() so that it calls the vendor-supplied UART output function.

    For example, suppose the UART output function has the following prototype:

    void MyUARTOutput( char *DataToOutput, size_t LengthToOutput );

    You would implement configPRINT_STRING() as:

    #define configPRINT_STRING( X ) MyUARTOutput( (X), strlen( (X) ) )

Testing

Build and execute the test demo project. If Test Message appears in the UART console, then the console is connected and configured correctly, configPRINT_STRING() is behaving properly, and testing is complete. You can remove the call to configPRINT_STRING("Test Message") from prvMiscInitialization().

After you implement the configPRINT_STRING() macro, you can start configuring a FreeRTOS kernel port for your device. See Configuring a FreeRTOS Kernel Port for instructions.