README.md

December 13, 2024 ยท View on GitHub

FreeRTOS_Queues_ThreadFlags Application Description

This application demonstrates the use of message queues, thread flags with CMSIS_RTOS2 API.

The application creates 4 Tasks and 1 Queue:

  • 'ProducerThread': Sends message (incrementing value "ProducerValue") to the queue.

  • 'ConsumerThread': Gets message from the queue Checks if it's the correct message (ProducerValue == ConsumerValue) Prints message to the serial port

  • 'GenThread': Waits for the message on the queue to reach a specific "GenerationValue" Sets ReceiveThread' flag to 1

  • 'ReceiveThread': Waits for the thread flag settings Toggles LED_GREEN

Expected success behavior

Successful operation is marked by turning ON Green LED.

Information about the application will be printed to the serial port.

Error behaviors

On failure, the green LED is turned OFF and an error message is printed to the serial port.

Assumptions if any

None

Known limitations

None

Notes

None

FreeRTOS usage hints

The FreeRTOS heap size configTOTAL_HEAP_SIZE defined in FreeRTOSConfig.h is set accordingly to the OS resources memory requirements of the application with +10% margin and rounded to the upper Kbyte boundary.

For more details about FreeRTOS implementation on STM32Cube, please refer to UM1722 "Developing Applications on STM32Cube with RTOS".

Keywords

FreeRTOS, Threading, GPIO, Message, Queues, ThreadFlags

Hardware and Software environment

  • This application runs on STM32C031C6Tx devices.

  • This application has been tested with STMicroelectronics NUCLEO-C031C6 board MB1717 Rev. B02 and can be easily tailored to any other supported device and development board.

  • This application uses USART2 to display output, the hyperterminal configuration is as follows:

    • BaudRate = 115200 baud
    • Word Length = 8 Bits
    • Stop Bit = 1
    • Parity = None
    • Flow control = None

How to use it ?

In order to make the program work, you must do the following :

  • Open the project in your preferred toolchain
  • Rebuild all files and load your image into target memory
  • Run the application