This repository contains the following packages:
bioristor-lib
: library that implements the algorithms for solving the mathematical model that describes the behavior of the Bioristor sensor for embedded devices (no_std
packages);nucleo-f767zi
: example of application of thebioristor-lib
library to a NUCLEO-F767ZI board;nucleo-l476rg
: example of application of thebioristor-lib
library to a NUCLEO-L476RG board;profiler
: library that implements a profiler based onSysTick
for Cortex-M microcontrollers.
For contributing to this project, you can either choose to work in a development container or manually setup the enviroment.
The use of a development container is strongly recommended since it allows the developers to work in the same environment and to make no additional effort to setup all the tools required during the development.
Prerequisites:
- Install Docker, Visual Studio Code and Dev Containers extension
- Read the documentation at Developing inside a Container
In a nutshell, you need to:
- Clone the repository with
git clone https://github.com/dsg-unipr/bioristor-lib.git
. - Start VS Code and run Dev Containers: Open Folder in Container... from the Command Palette.
Or:
- Start VS Code and run Dev Containers: Clone Repository in Container Volume... from the Command Palette.
- Enter
https://github.com/dsg-unipr/bioristor-lib.git
in the input box that appears and pressEnter
.
The VS Code window will reload, clone the source code, and start building the dev container. A progress notification provides status updates. After the build completes, VS Code will automatically connect to the container.
To edit this project, you must first make a clone of the repository:
git clone https://github.com/dsg-unipr/bioristor-lib.git
Install various dependencies needed to connect and debug development boards:
apt-get update
apt-get -y install --no-install-recommends \
libudev-dev \
libcapstone4 \
libftdi1-dev \
libgpiod2 \
libhidapi-hidraw0 \
libjaylink0 \
libjim0.79 \
libusb-0.1-4 \
libusb-1.0-0-dev \
pkg-config
# Install multi-arch version of objdump and nm, and create symbolic links.
apt-get -y install --no-install-recommends binutils-multiarch
ln -s /usr/bin/objdump /usr/bin/objdump-multiarch
ln -s /usr/bin/nm /usr/bin/nm-multiarch
# Install GDB for ARM systems.
apt-get -y install --no-install-recommends gdb-arm-none-eabi
# Install OpenOCD for debbuging.
apt-get -y install --no-install-recommends openocd
Then, follow the instructions in Install Rust to download Rustup, the Rust toolchain installer, and setup cargo
and rustc
.
Make sure you are using the latest stable version of Rust:
rustup toolchain install stable
rustup default stable
Install some usefull cargo
components:
rustup component add llvm-tools-preview
cargo install cargo-binutils
cargo install cargo-flash
cargo install probe-run
rustup component add clippy rustfmt
Finally, install the Rust Toolchain for Cortex-M4 and Cortex-M7 with hardware floating point:
rustup target add thumbv7em-none-eabihf
To build the project, run the following command:
cargo build [--release]
This will generate an executable program in the folder target/debug
or target/release
, depending on which build profile was selected. Use the release
profile if you care about performance.
To execute all the unit/integration tests implemented in the project, run the following command:
cargo test
- Francesco Saccani (francesco.saccani@unipr.it)