> For the complete documentation index, see [llms.txt](https://docs.ruuvi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ruuvi.com/ruuvi-air-firmware/air-1st-stage-bootloader.md).

# Air 1st Stage Bootloader

The 1st stage bootloader is minimal, immutable firmware which initializes the board, provides a factory recovery option and starts the more sophisticated second stage bootloader.

The bootloader is shipped with two cryptographic keys: Development and Production \[TODO link public keys]. Development key is shared to the world, and anyone can create their own firmware variants with development key. Production keys are internal to Ruuvi only for the security of users.

By default, Ruuvi Air ships with only production key enabled. To enable the development key, factory reset must be executed. After factory reset, development keys remain enabled until production key is used for the first time. Development keys can be re-enabled with a factory reset.

The flowchart of operation is below, legend:

White: Ready, Green: Being tested, Blue: TODO. As of Air fw v0.1.5

<figure><img src="/files/XVGd1adESKFKKV0erclA" alt="Air 1st stage bootloader. Press and hold button for at least 10 seconds while connecting power to run factory reset"><figcaption></figcaption></figure>

The first stage bootloader executes quickly, the button has to be pressed at powerup or reboot for the button to be registered. To run a factory reset, press the button for at least 10 seconds until bottom leds start alternating green-led blink sequence.

To enter firmware loader for uploading firmware, release the button before 10 seconds have passed.

Source code is available at <https://github.com/ruuvi/ruuvi.air.b0>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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-1st-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.
