Board Support Package

About BSPs

A board support package refers to code associated with the actual evaluation board or the target board used. For example, the BSP defines functions to turn LEDs on or off, reads push-button switches, initializes peripheral clocks, etc., providing nearly any functionality to multiple products/projects.

Names of typical BSP files include:

  • bsp.c
  • bsp.h
  • bsp_os.c
  • bsp_os.h
  • bsp_os_a.a
  • cpu_bsp.c
  • cpu_bsp.h

All files are generally placed in a directory as follows:

\Micrium\Software\EvalBoards\<manufacturer>\<board_name>\BSP\

Here, <manufacturer> is the name of the evaluation board or target board manufacturer and <board_name> is the name of the evaluation or target board. BSPs are typically written in C and are generally portable. 

bsp.c and bsp.h

These files normally contain functions and their definitions such as:

BSP_Init()

This function is called by application code to initialize the BSP functionality. BSP_Init() could initialize I/O ports, setup timers, serial ports, SPI ports and so on.

cpu_bsp.c and cpu_bsp.h

These files normally contain functions and their definitions to initialize the time stamping feature needed by µC/CPU.

CPU_TS_TmrInit()

CPU_TS_TmrInit() is a function that µC/CPU expects to have in order to initialize the timer that will be used for timestamps. Note that a skeleton of CPU_TS_TmrInit() is can be found in the template file \Micrium\Software\uC-CPU\BSP\Template\cpu_bsp.c.

CPU_TS_TmrRd()

CPU_TS_TmrRd() is responsible for reading the value of a 16-, 32- or 64-bit free-running timer. CPU_TS_TmrRd() returns a CPU_TS_TMR data type which can be configured to be either a CPU_TS32 or a CPU_TS64. If a 16-bit timer is used, the implementer of this function must accumulate 16-bit values into a 32-bit accumulator in order to always have 32-bit timestamps. The timer used for timestamps must count up (0, 1, 2, 3, ...) and must rollover automatically when the maximum count for the resolution of the timer is reached. In other words, a 16-bit counter should go from 0x0000 to 0xFFFF and then roll back to 0x0000. Note that a skeleton of CPU_TS_TmrRd() is can be found in the template file \Micrium\Software\uC-CPU\BSP\Template\cpu_bsp.c.

bsp_os.c, bsp_os_a.asm & bsp_os.h

These are discussed in µC/OS-III Port and Dynamic Tick BSP.