What Is a BSP?

~5 min slides

The Top of the Stack

Remember the layer cake from Part 1:

BSP    ← You are here now
Driver Crates
embedded-hal Traits
HAL (esp-hal)
PAC

A Board Support Package encapsulates board-specific knowledge:

Without BSPWith BSP
Output::new(peripherals.GPIO5, Level::Low, OutputConfig::default())board.led()
"Which pin is SDA again?" + checks pinout cardboard.i2c()
Configure each peripheral manuallyPre-configured with sensible defaults

It's Not Magic

The BSP is just Rust code that does exactly what you've been doing — but packages it up with meaningful names. Open the source and you'll see Output::new(), I2c::new(), and all the same patterns.

The value is:

  • No pin lookup errors — the board knows its own pin assignments
  • Sensible defaults — configurations chosen for the specific board's hardware
  • Convenience — less boilerplate for common setups

When to Use a BSP vs. Raw HAL

Use BSP WhenUse Raw HAL When
Quick prototypingYou need non-default configurations
Your board has a BSPYou're using custom hardware
You don't need fine controlYou want to learn the lower layers

In a workshop about ecosystem navigation, understanding the raw HAL is essential. The BSP is the reward: once you understand the layers underneath, you can appreciate what the BSP does for you.