Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Dev Environment

The device firmware can be found in the firmware repository.
You can download the source code as a ZIP or simply clone the repository:

git clone "https://codeberg.org/precious-blocks/firmware"

Precious Blocks are built around the ESP32S3 microcontroller, which uses an Xtensia architecture.
Because the architecture is not supported by upstream Rust (and LLVM), we have to use the downstream Expressif forks.

If you plan on setting up the build system on your host device, you can follow the esp32-rs book.
The firmware repo also contains a Dockerfile, which allows you to easily build the project inside a container.
You can use the provided docker/quickaccess file to build the docker container and create aliases, which allow you to cargo, clippy and espflash commands.

source docker/quickaccess
# simply use cargo and espflash as you normally would
# the commands will execute in the container

Once you have set up everything, you can simply use cargo run --release to build and flash the binary to the chip.

Note that you have to wake up the block before being able to flash it, because the serial interface is not available in deep sleep mode.