Board support packages, or BSPs, target the FreeRTOS+IO code to a specific
microcontroller, on a specific board. It is the equivalent to the port layer
found in FreeRTOS itself.
The FreeRTOS+IO code includes a header file called FreeRTOS_IO_BSP.h.
This header file should ether contain the BSP information directly, or
itself just be used to include the BSP header file that is correct for
the target being used.
It is best to locate FreeRTOS_IO_BSP.h in an application directory, along side
FreeRTOSIOConfig.h, because the header file is specific to the hardware
being used by the application rather than the core FreeRTOS+IO code.
A BSP includes:
A table that defines the supported peripherals, and how
each peripheral is identified in calls to
Device specific peripheral drivers.
A set of constants that define peripheral pin outs, LED polarities,
The table that defines the supported peripherals takes the form of an
array of Available_Peripherals_t structures:
typedef struct xAVAILABLE_DEVICES
/* Text name of the peripheral. For example, "/UART0/", or "/SPI2/". */
const int8_t * const pcPath;
/* The type of the peripheral, as defined by the Peripheral_Types_t enum. */
const Peripheral_Types_t xPeripheralType;
/* The base address of the peripheral in the microcontroller memory map. */
const void *pvBaseAddress;
The Available_Peripheral_t structure
The array is assigned to the macro boardAVAILABLE_DEVICES_LIST, so appears
in a BSP configuration files as something like:
An array of Available_Peripheral_t structures assigned to the boardAVAILABLE_DEVICES_LIST macro
The above example defines three peripherals. The peripheral accessed
using the path string "/UART3/" is of type UART, and has a base address
of MCU_UART3. The same table also defines an SPI peripheral and an I2C
peripheral at their respective addresses.
Assigning the array to the boardAVAILABLE_DEVICES_LIST macro allows the same
core FreeRTOS+IO code to be used with multiple BSP configuration files,
simply by changing the BSP header file.