# Air 2nd Stage Bootloader

The Ruuvi Air second stage bootloader is based on [MCUboot](https://docs.mcuboot.com/) and it handles cryptographic security of installed firmware images as well as validates any updates to be installed.

There are two slots for second stage bootloader, which allows for updating the second stage over the air without risking bricking the OTA update capablity. The first stage is responsible for selecting the instance to run.

The second stage bootloader is responsible for installing update to main application or firmware loading application as well as selecting which one to start.

The source code is available at <https://github.com/ruuvi/ruuvi.air.mcuboot>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ruuvi.com/ruuvi-air-firmware/air-2nd-stage-bootloader.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
