take-a-look-inside-your-first-board-support-package
take-a-look-inside-your-first-board-support-package

Take a look inside your first board support package

Nishant Nishant
Microcontroller chip on printed circuit board
Developing embedded software is difficult and resource intensive. A good board support package can help simplify and accelerate the process.

One thing that characterizes all hardware in an embedded system is uniqueness. Each board is designed for a specific purpose. Each board has its own combination of components. The bill of materials (BoM) could comprise systems-on-chips (SoCs), systems-on-modules (SoMs), microprocessors, microcontrollers, discrete memory, integrated peripherals and more.

This singular purpose makes the software equally specific, even when the underlying operating system is standard or off the shelf. Developers operate in layers that abstract the application from the operating system and the operating system from the hardware platform.

Abstraction is not an easy task. The rapid advancements in technology and the demand for smarter and more connected devices make embedded design more and more complex.

This is where the board support package (BSP) comes into play. A BSP is a collection of software resources that support a hardware target, giving developers a solid foundation for embedded software development.

You can think of a BSP as the foundations for a house. The material used in the foundations will be standard, but the shape of the foundations will depend on the footprint of the building. Once the foundations are in place, the building process can begin.

What is inside a BSP?

A BSP is also known as a software development kit (SDK). When embarking on a microcontroller or embedded design project, developers can rely on a BSP to streamline the software development process and enhance overall efficiency. But what exactly can developers expect to find inside a typical BSP?

A well-rounded BSP typically includes the following software components:

Initialization/start-up code
The initialization code, also known as start-up code, is a vital component of a BSP. It plays a crucial role in the booting process of an embedded system. The start-up code is responsible for initializing the essential hardware components of the target system, such as the processor, memory and peripherals.

Start-up code sets up the initial state and configuration of the major components, ensuring that they are ready for operation. Additionally, the initialization code may also perform tasks like configuring interrupt handlers, setting up the stack, and enabling necessary system features. The code is typically written in assembly language or a low-level language to ensure direct control over the hardware and to provide a reliable and efficient booting process

Hardware abstraction layer (HAL)
The hardware abstraction layer (HAL) is a software layer that provides an interface between the hardware and the software components of the system. Its purpose is to abstract the low-level details of the hardware, allowing the software to be written in a more portable and hardware-independent manner.

The HAL serves as a bridge between the hardware-specific functionality and the higher-level software components such as device drivers, operating systems and application software. It provides a consistent and standardized set of functions, data structures and definitions that the software can use to interact with the underlying hardware, regardless of the specific hardware implementation. 

Device drivers
BSPs provide prewritten device drivers that enable seamless interaction between the underlying hardware and the software application. These drivers handle low-level operations, such as managing interrupts, memory and peripherals, allowing developers to focus on higher-level functionality.

Middleware
BSPs often include middleware components that facilitate the integration of complex software stacks and protocols. This may include networking stacks, file systems, graphical user interfaces (GUIs) and communication protocols like USB, Bluetooth or Ethernet.

Operating System
Many BSPs come bundled with an embedded operating system, such as FreeRTOS or Zephyr RTOS. These operating systems provide a robust foundation for running applications, managing resources and supporting multitasking.

Toolchains and libraries
BSPs offer a set of development tools, compilers, debuggers and libraries that assist developers in building and optimizing their applications. These tools streamline the compilation, debugging and deployment processes, leading to faster development cycles.

three young professionals at computer

Developers can gain significant advantages from selecting the right BSP for their project.

By utilizing a BSP, developers gain several advantages:

Accelerated development
A BSP provides a ready-to-use software platform, saving developers from the arduous task of writing low-level code from scratch. This significantly reduces development time and allows developers to focus on application-specific features.

Hardware abstraction
BSPs abstract the complexities of the underlying hardware, enabling developers to write portable code that can run across different hardware platforms. This flexibility enhances code reusability and simplifies the migration of applications to new hardware targets.

Stability and reliability
BSPs undergo rigorous testing and validation processes, ensuring that the software components are stable and reliable. This minimizes the risk of encountering bugs or compatibility issues and improves the overall quality of the final product.

Example project

To illustrate the practical use of a BSP, consider an example project utilizing the Zephyr RTOS. Suppose a developer is tasked with building an IoT device that requires real-time capabilities, low power consumption and secure communication. By leveraging a Zephyr RTOS BSP, the developer gains access to a well-documented and supported software package.

A BSP for the Zephyr operating system targeting a particular board would typically include the following components:

Board-specific configuration
The BSP provides configuration files that define the specific hardware features, peripherals, memory mappings and other board-specific details. These configurations enable Zephyr to correctly initialize and interact with the hardware on the board.

Device drivers
The BSP includes device drivers for the board's peripherals, such as UART (universal asynchronous receiver/transmitter), GPIO (general-purpose input/output), SPI (serial peripheral interface), I2C (inter-integrated circuit), Ethernet and others. These drivers allow Zephyr to communicate with and control the various hardware components on the board.

Clock and power management
The BSP provides code or configuration files for managing the board's clock and power settings. This includes initializing and configuring the clock sources, setting up clock dividers and multiplexers, and implementing power-saving features like sleep modes.

Interrupt handling
The BSP handles interrupt configuration and routing for the board. It provides code or configuration files that map interrupts from different hardware peripherals to the appropriate interrupt handlers within Zephyr. This allows Zephyr to respond to external events and efficiently handle interrupt-driven operations.

Memory management
The BSP includes memory configurations and mappings for the board. It defines the memory regions available on the board, including RAM, ROM, flash memory and other memory-mapped peripherals. This information helps Zephyr manage memory resources and allocate memory for its various components.

Board-specific libraries and utilities
The BSP may include additional libraries, utilities or middleware specific to the board. These can provide additional functionality or services required by applications running on the board.

Build system integration
The BSP integrates with Zephyr's build system to ensure that the board-specific configuration and dependencies are properly included during the build process. This allows developers to easily build and generate firmware images specifically tailored for the target board.

embedded system layers

Embedded software builds comprise multiple layers. BSPs can provide the foundation for complex developments.

By providing all these components, the BSP enables Zephyr to run effectively on any particular board, leveraging its hardware capabilities and providing an abstraction layer for software development. It simplifies the process of porting Zephyr to new hardware platforms and ensures efficient utilization of the board's resources.

Conclusion

Using a BSP in embedded software development provides hardware abstraction, simplifies device initialization, facilitates peripheral access, enables portability, and ensures stability and reliability. It streamlines the development process, improves code reuse, and allows developers to focus on the application-specific logic rather than dealing with low-level hardware intricacies.

By working with its supplier partners, Avnet offers a wide range of BSPs tailored to support specific hardware targets. BSPs comprise expertise, with dedication from developers to provide reliable and comprehensive software resources.

A BSP is the ideal starting point for companies developing new products on unfamiliar hardware or porting an existing application to a new platform. By leveraging Avnet's access to BSPs, embedded developers can accelerate their projects, abstract hardware complexities, and build stable and reliable embedded systems.

About Author

Nishant Nishant
Avnet Staff

We use Avnet Staff as a collective byline when our team of editors and writers collaborate on the co...

Helpful Links

take-a-look-inside-your-first-board-support-package
take-a-look-inside-your-first-board-support-package
Related Articles
What is an AI processor?
Discover what’s special about AI processor architectures
By Avnet Staff   -   February 10, 2025
Are you and your engineering peers curious about AI processors? There’s a good chance you are, but can you agree on what makes them different, better or special? It’s not just a label; they are architected in a fundamentally different way.
Microsoft 11 IoT on laptop screen
Windows 11 IoT Enterprise LTSC 24H2 Is Out Now
By Avnet Staff   -   May 29, 2024
Windows 11 IoT Enterprise LTSC (Long-Term Servicing Channel) 24H2 emerges as the latest iteration in Microsoft's LTSC lineup, offering significant enhancements and new features that distinguish it from its predecessor, Windows 10 LTSC IoT Enterprise.