va108xx-rs/flashloader
Robin Mueller 60f4a52953 Rework library structure
Changed:

- Move most library components to new [`vorago-shared-periphs`](https://egit.irs.uni-stuttgart.de/rust/vorago-shared-periphs)
  which is mostly re-exported in this crate.
- All HAL API constructors now have a more consistent argument order: PAC structures and resource
  management structures first, then clock configuration, then any other configuration.
- Overhaul and simplification of several HAL APIs. The system configuration and IRQ router
  peripheral instance generally does not need to be passed to HAL API anymore.
- All HAL drivers are now type erased. The constructors will still expect and consume the PAC
  singleton component for resource management purposes, but are not cached anymore.
- Refactoring of GPIO library to be more inline with embassy GPIO API.

Added:

- I2C clock timeout feature support.
2025-04-24 16:54:29 +02:00
..
2025-04-24 16:54:29 +02:00
2025-04-24 16:54:29 +02:00
2025-04-24 16:54:29 +02:00
2025-04-24 16:54:29 +02:00
2025-04-24 16:54:29 +02:00
2025-04-24 16:54:29 +02:00
2025-01-10 16:31:15 +01:00
2025-04-24 16:54:29 +02:00

VA108xx Flashloader Application

This flashloader shows a minimal example for a self-updatable Rust software which exposes a simple PUS (CCSDS) interface to update the software. It also provides a Python application called the image-loader.py which can be used to upload compiled images to the flashloader application to write them to the NVM.

Please note that the both the application and the image loader are tailored towards usage with the bootloader provided by this repository.

The software can quickly be adapted to interface with a real primary on-board software instead of the Python script provided here to upload images because it uses a low-level CCSDS based packet interface.

Using the Python image loader

The Python image loader communicates with the Rust flashload application using a dedicated serial port with a baudrate of 115200.

It is recommended to run the script in a dedicated virtual environment. For example, on UNIX systems you can use python3 -m venv venv and then source venv/bin/activate to create and activate a virtual environment.

After that, you can use

pip install -r requirements.txt

to install all required dependencies.

After that, it is recommended to use ./image-load.py -h to get an overview of some options. The flash loader uses the UART0 with the Pins PA8 (RX) and PA9 (TX) interface of the VA108xx to perform CCSDS based communication. The Python image loader application will search for a file named loader.toml and use the serial_port key to determine the serial port to use for serial communication.

Examples

You can use

./image-loader.py -p

to send a ping an verify the connection.

You can use

cd flashloader/slot-a-blinky
cargo build --release
cd ../..
./image-loader.py -t a ./slot-a-blinky/target/thumbv6m-none-eabi/release/slot-a-blinky

to build the slot A sample application and upload it to a running flash loader application to write it to slot A.

You can use

./image-loader.py -s a

to select the Slot A as a boot slot. The boot slot is stored in a reserved section in EEPROM and will be read and used by the bootloader to determine which slot to boot.

You can use

./image-loader.py -c -t a

to corrupt the image A and test that it switches to image B after a failed CRC check instead.