Skip to content

Embassy ERS#18

Open
wjeffreys96 wants to merge 78 commits into
masterfrom
ers-embassy
Open

Embassy ERS#18
wjeffreys96 wants to merge 78 commits into
masterfrom
ers-embassy

Conversation

@wjeffreys96
Copy link
Copy Markdown
Contributor

@wjeffreys96 wjeffreys96 commented Nov 14, 2025

This pull request adds new Rust-based ERS firmware for our STM32F091RCs 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.
Clarify that there is no separate build command to call when
building/flashing, but add build command if needed.
@ThirteenFish
Copy link
Copy Markdown
Member

Non-blocking:

A general thought on the location of the CANBus related Python scripts: it would be useful to have a top level project directory, possibly named 'scripts' where these development and informal, practical testing scripts could live. One or as many as needed readme files to explain what each script performs. Also to provide any invocation details, such as any parameters which are required or option when calling each script.

This is a good idea, it could go in controlSystem/RecoveryBoard/scripts next to both firmware and firmware-rs. For invocation details I'll advocate for having a properly configured ArgumentParser whose --help message is sufficient to describe the invocation.

ThirteenFish and others added 9 commits January 2, 2026 17:27
Because firmware-rs was added and then deleted from master it looks like
when trying to merge ers-embassy git really wants to delete firmware-rs
to resolve the merge. I've gone and edited things by hand to keep it
around so that when the merge back to master happens there will be no
conflicts.
0 is the ring position, 5 is the ready state
ERR doesn't really make sense. ok or not ready is clearer.
position 2 is inbetween, 3 is locked
the uart pos command will now show both the raw adc values as well as
the calculated ring state of those values for debugging purposes
Now there is an Id field for each board that will print its name, which
is different from how the chute boards were before. They would only
print a number and the sender didn't have a id field at all. Keep in
mind the sender doesnt have an actual field in its state for this
because its static. I also print a delta from the last seen values
rather than a time stamp so you dont have to do the math in your head
when looking at the last seen fields on each board. The actual state
field is still a time stamp, the display impl just does the math for you
now.
@wjeffreys96 wjeffreys96 force-pushed the ers-embassy branch 5 times, most recently from b902283 to deee64b Compare March 3, 2026 20:20
iwdg to recover from hard crashes
There are some arcane transient errors happening once every 15 to 20
avionics system tests where the sender will not send a CAN message in
response to the telemetrum signal to deploy. Buffered CAN should be more
resilient in theory and so might help with this issue.
@wjeffreys96 wjeffreys96 force-pushed the ers-embassy branch 8 times, most recently from c79561a to 51cd959 Compare March 27, 2026 22:52
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.

5 participants