LuLuu's software stack is based on the Rust embedded and rp2040 tooling.
The firmware is split into a couple of crates housed in the root Cargo workspace.
We provide our own "board support crate", luluu-bsp
, and leverage
that crate in the actual firmware, contained in the luluu
folder.
There is also luluu-enc
, a custom animated image encoding format for the LuLuu, and
luluu-cli
whose main purpose is to convert .GIF
s into .LU
s which can be read and
displayed by the devide.
Using Rust embedded crates:
rp2040-hal
embedded-hal
embedded-sdmmc-rs
display-interface
mipidsi
In order to build the firmware yourself, you'll need to:
- Initialize and update git submodules
We vendor some of our dependencies under the vendored
directory. Because of this, you'll need
to init and update git submodules in order to build.
git submodule update --init
- Install the latest Rust and the
thumbv6m-none-eabi
target. First, installrustup
. Then,
rustup self update
rustup update stable
rustup target add thumbv6m-none-eabi
- Install
flip-link
cargo install flip-link
Then you can build the firmware by changing into the luluu
directory and using
cargo build --release
. In order to install the built firmware on the LuLuu unit,
you have two options.
This does not require an ARM 2-wire SWD capable probe, but is a bit cumbersome for live development and does not provide debugging capabilities.
- Install
elf2uf2-rs
cargo install elf2uf2-rs
- Change directory to the
luluu
directory within thissoftware
directory
cd luluu
-
Put the LuLuu into "USB Bootloader mode". Do this by connecting the unit via USB to your computer, then hold
USBBOOT
button and press theRESET
button. If on Linux, you may need to manually mount the device like you would a USB storage device. -
Run
cargo run --release
to build and install the firmware to the device
cargo run --release
This requires a probe-rs
-compatible probe.
For example, a RaspberryPi Debug Probe
which LuLuu was designed to work with.
- Install
probe-rs
You may need to install prerequisites as well;
see this page. If you're
on Linux, you may also need to change your udev
rules, as specified
here.
cargo install probe-rs --features cli
-
Connect the LuLuu unit to power (i.e. plug it into a USB port; the port will not be used for data in this configuration) as well as through its SWD port to your probe.
-
Change directory to the
luluu
directory within thissoftware
directory
cd luluu
- Run
cargo embed
to execute theprobe-rs
session
This compile, flash the device through the probe, and start running a debug session
according to Embed.toml
.
To flash the fully release, no logging version:
cargo embed --release
To flash a release build but with logging enabled and start a defmt log console
cargo embed probe --release --features probe
This selects the "probe" profile from Embed.toml
and enables the probe
cargo feature
on the luluu
crate, which enables its logging functionalities.
You can enable more or less verbose logging by modifying the DEFMT_LOG
env variable
and luluu/Cargo.toml
, for example uncomment the embedded-sdmmc-rs/defmt-log
line to
enable logging from the library used to communicate with the SD card:
DEFMT_LOG=embedded_sdmmc=trace,luluu=debug cargo embed probe --release --features probe
You can convert animated gifs that are 60x60 or 120x120px in size and <= 15 frames per second
into .LU
files that are used by the device by using the luluu-cli
crate.
- Change into the
luluu-cli
directory
cd luluu-cli
- Run the tool, specifying the convert subcommand and a path to the file.
cargo run --release convert [FILE_PATH]
The tool will write the output file with the same name directly next to the original GIF provided.
You can get more help with
cargo run --release -- -h
or
cargo run --release -- convert -h