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 BSP | With BSP |
|---|---|
Output::new(peripherals.GPIO5, Level::Low, OutputConfig::default()) | board.led() |
| "Which pin is SDA again?" + checks pinout card | board.i2c() |
| Configure each peripheral manually | Pre-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 When | Use Raw HAL When |
|---|---|
| Quick prototyping | You need non-default configurations |
| Your board has a BSP | You're using custom hardware |
| You don't need fine control | You 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.