Firmware for the CTS-SAT-2 mission. Runs on the STM32L4R5ZI-based Onboard Computer.
- Install Rust. It must be installed using
rustup. - Install the required dependencies for embedded rust development.
rustup update
rustup target add thumbv7em-none-eabihf
rustup component add llvm-tools
cargo install cargo-binutils probe-rs-tools cargo-expand just- Install SerialTest or a similar serial terminal tool (must allow pre-writing a message before sending).
- [FOR WINDOWS USERS ONLY] Follow this link to install the ST-Link Debugging Driver for compataiblity with OpenOCD if not already installed.
- Follow the instructions on the page to download latest.
- Unzip the downloaded file and follow instructions in the readme (inside the zip file).
- Open this repo in VS Code.
- To flash and run the firmware, run
cargo embed --target thumbv7em-none-eabihffrom the root of this repo, with the Nucleo-L4A6ZG plugged in. - Observe logs coming from the STM32. Observe the green onboard LED blinking and logs in the debug terminal.
- Disconnect power. Connect the USB-UART converter to the OBC's UART2 port.
- Connect RX to TX, TX to RX, GND to GND. RXD pin on the STM is pin PD6, and TXD pin on the STM is pin PD5. All GND's on the STM can be used.
- Google "nucleo-144 pinout" to find the UART2 pin locations.
- Ask a friend for help!
- Open SerialTest (or similar) and connect to the appropriate COM port at 115200 baud. Enable the "Suffix" checkbox.
- You should see heartbeat messages every second.
- Try sending the
hello_world()command. You should receive a "HELLO_WORLD" response.
- STM32 Nucleo-144 Boards User Manual (UM2179)
- Page 33 — Pinouts
- Run tests on host machine:
cargo test -p cts2_obc_logic- Build and flash firmware to the OBC:
cargo embed --target thumbv7em-none-eabihf- Build, test, and flash firmware at once:
cargo test -p cts2_obc_logic && cargo embed --target thumbv7em-none-eabihf