1
1
# hpm-hal
2
2
3
- A Rust HAL implementation for the HPMicro's RISC-V MCUs.
3
+ A Rust HAL and [ Embassy ] ( https://embassy.dev/ ) driver implementation for the HPMicro's RISC-V MCUs.
4
4
The PAC(Peripheral Access Crate) is based on [ hpm-data] .
5
5
6
- This crate is a working-in-progress and not ready for use.
6
+ This crate is a working-in-progress and not ready for production use.
7
7
8
- ## Project status
8
+ ## Support Status
9
9
10
10
### MCU Family Support
11
11
12
12
| MCU Family | PAC | Demo | Embassy | SYSCTL | GPIO | UART | I2C | SPI | DMA | TMR | ADC | USB | CAN |
13
13
| ------------| -----| ------| ---------| --------| ------| ------| -----| -----| -----| -----| -----| -----| -----|
14
14
| HPM6700 | ✓ | ✓ | ✓ | ✓ | ✓+ | ✓+ | ✓+ | ✓+ | ✓+ | | | | |
15
- | HPM6300 | ✓ | ✓ | ✓ | ✓ | | | | | | | | | |
15
+ | HPM6300 | ✓ | ✓ | ✓ | ✓ | ? | ? | ? | ? | ? | | | | |
16
16
| HPM6200 | ✓ | | | | | | | | | | | | |
17
17
| HPM5300 | ✓ | ✓ | ✓ | ✓ | ✓+ | ✓+ | ✓+ | ✓+ | ✓+ | | ✓ | ✓ | ✓ |
18
18
| HPM6800 | ✓ | | | | | | | | | | | | |
@@ -24,7 +24,7 @@ This crate is a working-in-progress and not ready for use.
24
24
- Blank: Not implemented
25
25
- +: Async support
26
26
27
- ### Peripherals
27
+ ### Peripheral Support
28
28
29
29
- [x] Basic rt code: linker, startup
30
30
- [x] vectored interrupt handling
@@ -71,18 +71,19 @@ This crate is a working-in-progress and not ready for use.
71
71
- [x] SDRAM init
72
72
- [x] MCAN
73
73
- [x] basic ` mcan ` wrapper
74
- - ~~ [ ] async driver~~ , better impl it in the App layer, see Mi motor demo
74
+ - ~~ [ ] async driver~~ , better impl it in the App layer, see XiaoMi CyberGear motor demo
75
75
- [ ] TSU management
76
76
- [x] USB via embassy-usb
77
77
- [x] Device
78
78
- [ ] Host
79
79
- [x] XPI NOR flash driver using embedded-storage
80
+ - [ ] power domain handling
80
81
81
- ### Long term Plans
82
+ ### Related Crates
82
83
83
- - [x] [ andes-riscv] for specific CSRs
84
- - [ ] hpm-riscv-rt for customized runtime (riscv-rt is not fit)
85
- - [ ] power domain handling
84
+ - [x] [ andes-riscv] for Andes' specific CSRs
85
+ - [x] [ hpm-data ] and [ hpm-metapac ] for Chip metadata and PAC generation
86
+ - [ ] hpm-riscv-rt for customized runtime (riscv-rt does not fit)
86
87
87
88
### Toolchain Support
88
89
@@ -129,22 +130,23 @@ The best reference is the examples in the `examples` directory and Github action
129
130
#### Step 1. Prepare Rust Toolchain
130
131
131
132
``` bash
132
- rustup default nightly
133
+ # lock to 2024-08-23 and wait for embassy-executor to be updated
134
+ rustup default nightly-2024-08-23
133
135
rustup target add riscv32imafc-unknown-none-elf
134
136
```
135
137
136
138
#### Step 2. Clone this repo
137
139
138
140
``` bash
139
- git clone https://github.com/hpmicro-rs /hpm-hal.git
141
+ git clone https://github.com/hpmicro/hpm-hal.git
140
142
141
143
# Or if you are using SSH
142
144
143
- git clone
[email protected] :hpmicro
-rs /hpm-hal.git
145
+ git clone
[email protected] :hpmicro/hpm-hal.git
144
146
145
147
# Or if you are using GitHub CLI
146
148
147
- gh repo clone hpmicro-rs /hpm-hal
149
+ gh repo clone hpmicro/hpm-hal
148
150
```
149
151
150
152
#### Step 3. Run Examples
@@ -166,7 +168,7 @@ cargo run --release --bin blinky
166
168
167
169
## License
168
170
169
- Embassy is licensed under either of
171
+ This repo is licensed under either of
170
172
171
173
- Apache License, Version 2.0 ([ LICENSE-APACHE] ( LICENSE-APACHE ) or
172
174
< http://www.apache.org/licenses/LICENSE-2.0 > )
@@ -178,8 +180,9 @@ at your option.
178
180
179
181
This crate is under active development. Before starting your work, it's better to create a "Work in Progress" (WIP) pull request describing your work to avoid conflicts.
180
182
181
- [ hpm-data ] : https://github.com/andelf /hpm-data
183
+ [ hpm-data ] : https://github.com/hpmicro /hpm-data
182
184
[ HPM OpenOCD ] : https://github.com/hpmicro/riscv-openocd
183
185
[ probe-rs ] : https://github.com/probe-rs/probe-rs
184
- [ probe-rs HPM fork ] : https://github.com/hpmicro-rs /probe-rs
186
+ [ probe-rs HPM fork ] : https://github.com/hpmicro/probe-rs
185
187
[ andes-riscv ] : https://github.com/hpmicro-rs/andes-riscv
188
+ [ hpm-metapac ] : https://docs.rs/hpm-metapac/latest/hpm_metapac
0 commit comments