Skip to content

Conversation

@wjeffreys96
Copy link
Contributor

This pull request adds new Rust-based ERS firmware for our STM32F0919RCs in its entirety to the repository. The firmware is located at ./controlSystem/RecoveryBoard/firmware-rs. It also adds Rust build files and dirs to the .gitignore.

= and others added 30 commits September 28, 2025 14:54
create feature flags to manage can ids between images
This wrapper around the motor pins and the dac allows for much simpler
and less verbose interaction with the peripherals related to the motors.
Instead of having to lock each peripheral's mutex and pass each pin into
functions that require the motor interface, we can now simply lock and
use the Motor struct. Additionally, to change the mode of the motor,
simply pass in a MotorMode enum variant for whichever mode you'd like to
set it to.
not handling the error thrown when with_timeout times out was causing
the panic. To avoid these panics in the future, whenever something can
throw an error, be sure to handle it in some way.
Watch is more suitable for this application as it discards the previous
value when it is no longer useful data whereas Channel will wait until a
value was received before updating it, leading to stale data.
This is a comprehensive overhaul of the project structure that aims to
improve ergonomics as it pertains to the motor and the sensors.

key changes:
        - moved everything in the shared dir to the project src dir
        - moved all motor logic into motor.rs.
        - motor functions are now impls
        - created the ring struct in ring.rs
        - sensor functions are now ring impls
        - created ring and motor mutex's
        - updated "u" and "l" commands to accept pulse and force flags
          as well as to utilize the motor struct.
        - updated CAN reader to utilize the motor struct.
This use case fits watch much better than channel. See embassy_sync docs
for more info as to why.
sender will spam unlock message until it receives an acknowledgement.
This will have main/drogue send those messages when it receives the fire
can message.
add the same command that's on the sender board to the parachute boards.
sending "batt" over picocom will print the last read of the battery
voltage from the adc.
flashing blinky with "--features=main" will now flash blinky onto an
actual ers board. Before it would only work on a nucleo
This also renames some things to have their intended purpose be clearer.
Namely,the can ids and the names of the frames
When the command "beep" is received over uart, access the buzzer's mode
and update it accordingly. If it's off turn it to low. If it's anything
else, turn it off.
wjeffreys96 and others added 26 commits October 15, 2025 14:15
When the motor is driven the adc will read motor_isense and defmt will
print the readings as a csv at a debug level log.
There were many instances where there were arguments being unecessarily
passed into tasks or struct constructors that could just be imported and
used inside the module where the task or struct is defined. Removing
these unneeded arguments reduces the amount of "spaghetti code" in the
codebase and makes it much easier to read.
The conditional compilation scope should be around this entire arm of
the match statement, otherwise the main board will send out the drogue
acknowledgement message
It's not the telemetrum that sends the heartbeat its the sender board
README explains the shared modules found in src dir

Fix typo
pytest looks for files named test_*.py, so this would conflict with it's
usage. Also, this is just a clearer name for the purpose of the script
These two tests should send messages to the drogue and main boards and
verify they respond with appropriate acknowledgement messages.
parachute motor constants moved to src/motor.rs
echo_can task to be used with echo_can.py, not test_can.py
If the motor runs for longer than expected the buffer holding the csv
values can overflow. I added a check that makes sure that wont happen
Create a flash driver and mutex and use it to store the number of times
the motor has been actuated. Create cli commands to print and erase this
data.
Embedded test is probe-rs's testing suite for running tests on board.
This commit adds the crate with some necessary configs in the Cargo.toml
as well as creates a tests directory, blinky sample test, and adds the
necessary linker args to the build.rs file.
Using try_get instead of changed when reading the ring position will
allow the heartbeat and "pos" cli command to tell users that the ring is
not yet intialized instead of blocking until it is initialized.
Instead of using feature flags, which aren't supposed to be mutually
exclusive, use the BOARD environment variable to flash the parachute
image to either the main or the drogue board. For the main board, set
BOARD = "main", or for the drogue board set BOARD = "drogue"
@wjeffreys96 wjeffreys96 force-pushed the ers-embassy branch 2 times, most recently from e60c572 to 53015d6 Compare November 20, 2025 07:26
Instead of hard coding the environment variable in .cargo/config.toml,
you can now specify the BOARD environment variable through a commmand
line override. This was previously not possible because setting it
through the command line wouldnt trigger a rerun of the build. Adjusting
the build.rs file fixed this issue. I also wrote cargo aliases to
simplify the flash commands, and updated the READMEs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants