- Rust 100%
|
|
||
|---|---|---|
| .cargo | Initial import | |
| src | static → const | |
| .dir-locals.el | Initial import | |
| .gitignore | Initial import | |
| build.rs | Add esp-config support | |
| Cargo.lock | Add morse message support | |
| Cargo.toml | Add morse message support | |
| COPYING | Add COPYING | |
| esp_config.yml | Improve wording on configuration description | |
| README.md | Improve wording on configuration description | |
| rust-toolchain.toml | Initial import | |
fuchsware
Firmware for a Draußenfuchs sender.
Building and flashing
Install Rust including a toolchain for riscv32imc-unknown-none-elf. When
using rustup, it should automatically read
rust-toolchain.toml and download the required components.
Install espflash (but see below if you intend to debug the running code):
% cargo install --locked espflash cargo-espflash
Optionally, install esp-config if you want a menu-driven configuration interface:
% cargo install --locked --features=tui esp-config
To build, flash, and connect to monitor output in one go, run:
% cargo run --release
Configuration
The following configuration options are available:
| Option | Stability | Default value | Allowed values |
|---|---|---|---|
FUCHSWARE_CONFIG_TONE_FREQUENCY Frequency in Hertz of the emitted tone |
⚠️ Unstable | 440 | |
FUCHSWARE_CONFIG_TX_DURATION_SECS Duration in seconds to transmit a tone |
⚠️ Unstable | 10 | |
FUCHSWARE_CONFIG_PAUSE_DURATION_SECS Duration in seconds to pause transmission |
⚠️ Unstable | 5 | |
FUCHSWARE_CONFIG_DIT_LEN_MS Duration in milliseconds of a morsed "dit" |
⚠️ Unstable | 125 | |
FUCHSWARE_CONFIG_MORSE_MESSAGE Message to be morsed |
⚠️ Unstable | DL0UA |
To override the defaults, specify them in the environment when building/running, e. g.:
% FUCHSWARE_CONFIG_MORSE_MESSAGE=DB0SDA cargo run --release
You may also use esp-config for a menu-driven interface. Warning:
esp-config will clobber .cargo/config.toml, do not commit the resulting changes!
Debugging
To debug, you will need to substitute espflash with probe-rs.
- Install it
- Override the runner:
% export CARGO_TARGET_RISCV32IMC_UNKNOWN_NONE_ELF_RUNNER='probe-rs run --chip=esp32c3 --preverify --always-print-stacktrace --no-location --catch-hardfault' - Build/run without
espflash, but withprobe-rsfeature:% cargo run --features=probe-rs --no-default-features
See probe-rs documentation on how to connect a debugger.
Orthogonally to the above, a debug feature is available. When active, instead
of going into power-saving deep sleep, the program will stay active and simply
loop after a delay. This way, your monitor/debugger can stay active, as the
debugging stub on the controller is also shut down when entering deep sleep.
To use both at once:
% cargo run --features=probe-rs,debug --no-default-features