Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10,832 changes: 10,832 additions & 0 deletions controlSystem/ERSRemoteControl/ERSRemoteControl.kicad_pcb

Large diffs are not rendered by default.

687 changes: 687 additions & 0 deletions controlSystem/ERSRemoteControl/ERSRemoteControl.kicad_pro

Large diffs are not rendered by default.

13,046 changes: 13,046 additions & 0 deletions controlSystem/ERSRemoteControl/ERSRemoteControl.kicad_sch

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions controlSystem/ERSRemoteControl/sym-lib-table
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(sym_lib_table
(version 7)
(lib (name "J-TE-2-1734592-0-oresat-debug-connector") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/J-TE-2-1734592-0-oresat-debug-connector.kicad_sym") (options "") (descr ""))
(lib (name "psas-graphics") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/psas-graphics.kicad_sym") (options "") (descr ""))
(lib (name "psas-ics") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/psas-ics.kicad_sym") (options "") (descr ""))
(lib (name "psas-power") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/psas-power.kicad_sym") (options "") (descr ""))
(lib (name "psas-testpoint") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/psas-testpoint.kicad_sym") (options "") (descr ""))
(lib (name "U-MonolithicPower-MP26123DR-LF-Z-battery-charger-li-ion") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/U-MonolithicPower-MP26123DR-LF-Z-battery-charger-li-ion.kicad_sym") (options "") (descr ""))
(lib (name "U-onsemi-H11F3M-optocoupler") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/U-onsemi-H11F3M-optocoupler.kicad_sym") (options "") (descr ""))
(lib (name "U-Rohm-BD62120AEFJ-E2-h-bridge-motor-driver") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/U-Rohm-BD62120AEFJ-E2-h-bridge-motor-driver.kicad_sym") (options "") (descr ""))
(lib (name "U-Rohm-BD63150AFM-E2-h-bridge-motor-driver") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/U-Rohm-BD63150AFM-E2-h-bridge-motor-driver.kicad_sym") (options "") (descr ""))
(lib (name "U-STMicro-STM32F091C-microcontroller") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/U-STMicro-STM32F091C-microcontroller.kicad_sym") (options "") (descr ""))
(lib (name "U-TI-DRV5056-Q1-hall-effect-sensor") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/U-TI-DRV5056-Q1-hall-effect-sensor.kicad_sym") (options "") (descr ""))
(lib (name "U-TI-TCAN330-can-transciever") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/U-TI-TCAN330-can-transciever.kicad_sym") (options "") (descr ""))
(lib (name "U-TI-TPS63070x-buck-boost-regulator") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/U-TI-TPS63070x-buck-boost-regulator.kicad_sym") (options "") (descr ""))
(lib (name "U-Vishay-TCMT1107-optocoupler") (type "KiCad") (uri "${PSAS_LIBRARIES}/psas-kicad-main/psas-symbols/U-Vishay-TCMT1107-optocoupler.kicad_sym") (options "") (descr ""))
)
29 changes: 17 additions & 12 deletions controlSystem/RecoveryBoard/firmware-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
[package]
name = "firmware-rs"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
license = "MIT OR Apache-2.0"

[dependencies]
embassy-stm32 = { version = "0.4.0", features = [ "defmt", "memory-x", "stm32f091rc", "time-driver-tim2", "exti", "unstable-pac"] }
embassy-stm32 = { version = "0.6.0", features = [ "defmt", "memory-x", "stm32f091rc", "time-driver-tim2", "exti", "unstable-pac"] }
cortex-m = { version = "0.7.7", features = ["inline-asm", "critical-section-single-core"] }
cortex-m-rt = "0.7.5"
defmt = "1.0.1"
defmt-rtt = "1.0.0"
defmt-rtt = "1.1.0"
panic-probe = { version = "1.0.0", features = ["print-defmt"] }
embassy-sync = { version = "0.7.2", features = ["defmt"] }
embassy-executor = { version = "0.9.1", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
embassy-time = { version = "0.5.0", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
portable-atomic = { version = "1.11", features = ["unsafe-assume-single-core"] }
embedded-io-async = "0.6.1"
embassy-sync = { version = "0.8.0", features = ["defmt"] }
embassy-executor = { version = "0.10.0", features = ["platform-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
embassy-time = { version = "0.5.1", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
portable-atomic = { version = "1.13", features = ["unsafe-assume-single-core"] }
embedded-io-async = "0.7.0"
static_cell = "2.1.1"
embedded-hal-nb = "1.0.0"
noline = "0.5.1"
heapless = "0.9.1"
format_no_std = "1.2.0"
heapless = "0.9.2"
embedded-test-linker-script = { version = "0.1.0" }
embedded-cli = { git = "https://github.com/funbiscuit/embedded-cli-rs", branch = "main" }
ufmt = "0.2.0"
embedded-io ={ version = "0.7.1", features = ["defmt"] }

[dev-dependencies]
embedded-test = { version = "0.7.0", features=["embassy", "defmt"] }
embedded-test = { version = "0.7.0", features = ["embassy", "defmt"] }

[lib]
harness = false # Important: As we bring our own test harness for all tests
Expand All @@ -34,4 +35,8 @@ name = "blinky"
harness = false

[profile.release]
lto = true
opt-level = "s"
incremental = false
codegen-units = 1
debug = 2
52 changes: 45 additions & 7 deletions controlSystem/RecoveryBoard/firmware-rs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Embassy requires Rust nightly, but `rust-toolchain.toml` should handle this for

You will also need to install the target platform:

```bash
```sh
rustup target add thumbv6m-none-eabi
```

Expand All @@ -19,15 +19,15 @@ In this case, you may need to build probe-rs from source.

With all the dependencies installed, you should now be able to navigate to the directory containing the Cargo.toml file and run:

```rust
```sh
cargo run --bin blinky --release
```

If you are flashing blinky directly onto one of the ERS boards, you will need to set the BOARD environment variable to `"main"`.

After it builds, terminal output should look like this if everything went according to plan:

```bash
```sh
Finished `release` profile [optimized + debuginfo] target(s) in 0.21s
Running `probe-rs run --chip STM32F091RCTX target/thumbv6m-none-eabi/release/blinky`
Erasing ✔ 100% [####################] 16.00 KiB @ 46.76 KiB/s (took 0s)
Expand All @@ -46,7 +46,7 @@ and the led should be blinking.
If you are planning on flashing, you can just call the commands in the Flashing section after this and building will be handled automatically.
If you need to build separately for some reason, run:

```bash
```sh
cargo build -r --bin blinky
```

Expand All @@ -58,18 +58,56 @@ The commands to flash the binaries are as follows:

*Sender*:

```rust
```sh
cargo sender
```

*Drogue parachute*:

```rust
```sh
BOARD=drogue cargo parachute
```

*Main parachute*:

```rust
```sh
BOARD=main cargo parachute
```

## Note on CLI usage with picocom

Be sure to configure picocom to remap outgoing deletes to backspaces, or you will not be able to backspace properly.

Example command:

```sh
picocom -b 115200 -e "b" /dev/tty{USB0} --omap delbs
```

Replace {USB0} with where the device has been enumerated to

## Sender CLI Commands

- `help`: Display all available commands
- `state`: Print internal system state
- `drogue`: Send drogue deployment command
- `main`: Send main deployment command
- `rr`: Toggle Rocket Ready signal override
- `batt`: Display current battery voltage
- `beep`: Toggle periodic beeping
- `version`: Display firmware version information

## Parachute CLI Commands

- `help`: Display all available commands
- `state`: Print internal system state
- `batt`: Display current battery voltage
- `beep`: Toggle periodic beeping
- `version`: Display firmware version information
- `l`: Move the ring towards the lock position. Adding the `--force` flag will ignore the sensor readings and drive the motor until timeout. Adding the `--pulse` flag will drive the motor for only 100ms rather than the full duration.
- `u` Similar to l, this will move the ring towards the unlocked position instead. The `--force` and `--pulse` flags are the same as for `l`.
- `pos`: Prints the current sensor readings and ring state.
- `acts`: Print the count of motor actuations stored in flash memory
- `erase`: Erase motor actuation count data from flash memory
- `limits`: Changes the hall sensor voltage thresholds stored in flash that are used to determine ring position. Pass an argument formatted like over1,under1,active1,unactive1,over2,under2,active2,unactive2. There must be exactly 8 values separated by commas.
- `version`: Display firmware version information
8 changes: 7 additions & 1 deletion controlSystem/RecoveryBoard/firmware-rs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ use std::env;

fn main() {
println!("cargo::rerun-if-env-changed=BOARD");
println!("cargo::rerun-if-env-changed=DISABLE_BEEP");
println!("cargo:rustc-link-arg-bins=--nmagic");
println!("cargo:rustc-link-arg-bins=-Tlink.x");
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
println!("cargo::rustc-link-arg=-Tembedded-test.x");
println!("cargo:rustc-link-arg-tests=-Tdefmt.x");
println!("cargo:rustc-link-arg-tests=-Tlink.x");

println!("cargo::rustc-check-cfg=cfg(drogue,main)");
println!("cargo::rustc-check-cfg=cfg(drogue,main,disable_beep)");
if let Ok(board) = env::var("BOARD") {
if board == "drogue" {
println!("cargo::rustc-cfg=drogue");
Expand All @@ -18,4 +19,9 @@ fn main() {
println!("cargo::rustc-cfg=main");
}
}
if let Ok(disable_beep) = env::var("DISABLE_BEEP") {
if disable_beep == "true" {
println!("cargo::rustc-cfg=disable_beep");
}
}
}
Loading