https://github.com/antoinevg/hello-d1
Bare-metal Rust explorations of the Allwinner D1
https://github.com/antoinevg/hello-d1
audio baremetal rust
Last synced: 6 months ago
JSON representation
Bare-metal Rust explorations of the Allwinner D1
- Host: GitHub
- URL: https://github.com/antoinevg/hello-d1
- Owner: antoinevg
- License: mit
- Created: 2022-07-17T18:15:03.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-25T13:39:32.000Z (almost 3 years ago)
- Last Synced: 2025-04-10T04:55:55.839Z (6 months ago)
- Topics: audio, baremetal, rust
- Language: Rust
- Homepage:
- Size: 108 KB
- Stars: 15
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hello-d1
A starter project for the Lichee RV D1. There are many like it, but this one is mine.
## Dependencies
### Rust
rustup target add --toolchain nightly riscv64imac-unknown-none-elf
rustup component add --toolchain nightly llvm-tools-preview
cargo install cargo-binutils### xfel
Build:
git clone https://github.com/xboot/xfel.git xfel.git
cd xfel.git
makePut device into xfel mode:
* Power off
* Hold xfel button
* Power on
* Release xfel buttonTest:
./xfel version
## Debugging
### Dock UART
picocom --imap lfcrlf -b 115200 /dev/cu.usbmodem224302
# ctrl-a + ctrl-x to exit### D1 UART
picocom --imap lfcrlf -b 115200 /dev/cu.usbmodem22441202
### TODO gdb
Install via homebrew:
brew tap "riscv-software-src/riscv"
brew install riscv-toolsBuild from source:
https://github.com/T-head-Semi/xuantie-gnu-toolchain
## Build, flash & run
cargo build --release --example audio_testsignal
rust-objcopy target/riscv64imac-unknown-none-elf/debug/test-d1-flash-bare \
--binary-architecture=riscv64 \
--strip-all -O binary \
target/flash.bin# put device into xfel mode
xfel ddr d1
xfel write 0x40000000 target/flash.bin
xfel exec 0x40000000## Noisy Audio Output
Add a [RC Low Pass Filter](https://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-low-pass-and-high-pass-filter) with -3dB Cutoff @ ~33.8kHz:
C = 100nF
R = 47R## Greets fly to
* [riscv-rust / riscv-rust-quickstart](https://github.com/riscv-rust/riscv-rust-quickstart)
* [luojia65 / test-d1-flash-bare](https://github.com/luojia65/test-d1-flash-bare)
* [orangecms / test-d1-flash-bare](https://github.com/orangecms/test-d1-flash-bare/tree/dram-rerere)
* [adamgreig / d1rgb](https://github.com/adamgreig/d1rgb)
* [tosc-rs / d1-playground](https://github.com/tosc-rs/d1-playground)