{"id":31289115,"url":"https://github.com/hpmicro/hpm-hal","last_synced_at":"2026-02-03T10:19:13.585Z","repository":{"id":222702230,"uuid":"758145887","full_name":"hpmicro/hpm-hal","owner":"hpmicro","description":"Rust HAL crate for HPMicro's RISC-V MCUs: HPM6700/HPM6400, HPM6300, HPM6200, HPM5300, HPM6800, HPM6E00.","archived":false,"fork":false,"pushed_at":"2025-12-05T13:05:02.000Z","size":1017,"stargazers_count":43,"open_issues_count":6,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-14T11:35:04.302Z","etag":null,"topics":["embedded-hal","hpmicro","risc-v","rust-embedded"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hpmicro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-15T17:58:44.000Z","updated_at":"2026-01-02T20:13:27.000Z","dependencies_parsed_at":"2025-03-19T11:27:04.806Z","dependency_job_id":"78e98ecd-5247-481a-bdb1-822028b8b16a","html_url":"https://github.com/hpmicro/hpm-hal","commit_stats":null,"previous_names":["andelf/hpm-hal","hpmicro-rs/hpm-hal","hpmicro/hpm-hal"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hpmicro/hpm-hal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpmicro%2Fhpm-hal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpmicro%2Fhpm-hal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpmicro%2Fhpm-hal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpmicro%2Fhpm-hal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hpmicro","download_url":"https://codeload.github.com/hpmicro/hpm-hal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpmicro%2Fhpm-hal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29041058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded-hal","hpmicro","risc-v","rust-embedded"],"created_at":"2025-09-24T13:02:15.101Z","updated_at":"2026-02-03T10:19:13.580Z","avatar_url":"https://github.com/hpmicro.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# hpm-hal\n\nA Rust HAL and [Embassy](https://embassy.dev/) driver implementation for the HPMicro's RISC-V MCUs.\nThe PAC(Peripheral Access Crate) is based on [hpm-data].\n\nThis crate is a working-in-progress and not ready for production use.\n\n## Support Status\n\n### MCU Family Support\n\n| MCU Family | PAC | Demo | Embassy | SYSCTL | GPIO | UART | I2C | SPI | DMA | TMR | PWM | ADC | WDG | USB | CAN |\n| ---------- | --- | ---- | ------- | ------ | ---- | ---- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| HPM6700    | Y   | Y    | Y       | Y      | Y+   | Y+   | Y+  | Y+  | Y+  | ?   | Y   |     |     |     |     |\n| HPM6300    | Y   | Y    | Y       | Y      | Y+   | ?    | ?   | ?   | ?   | ?   | ?   |     |     |     |     |\n| HPM6200    | Y   | Y    | Y       | Y      | Y+   |      |     |     |     | ?   | ?   |     |     |     |     |\n| HPM5300    | Y   | Y    | Y       | Y      | Y+   | Y+   | Y+  | Y+  | Y+  | Y   | ?   | Y   | Y   | Y   | Y   |\n| HPM6800    | Y   |      |         |        |      |      |     |     |     | ?   | ?   |     |     |     |     |\n| HPM6E00    | Y   | Y    | Y       | Y      | Y+   | Y+   | Y+  | Y+  | Y+  | ?   | !   |     | Y   | Y   | Y   |\n\n- Y: Implemented\n- ?: Requires demo verification\n- !: Partially implemented\n- Blank: Not implemented\n- +: Async support\n\n### Peripheral Support\n\n- [x] Basic rt code: linker, startup\n  - [x] vectored interrupt handling\n  - [x] L1C support\n  - [ ] PMP for noncacheable memory\n  - [ ] CPU1 support - how to?\n- [x] Embassy time driver\n  - [x] MCHTMR (64-bit, default)\n  - [x] GPTMR (32-bit + period, optional)\n- [x] SYSCTL init\n  - [x] Resource group handling\n- [x] PLL setting\n- [x] GPIO, Flex, Input, Output, Async\n- [x] DMA, both HDMA and XDMA\n  - [x] DMA v2\n  - [x] DMA v1\n- [x] UART\n  - [x] Blocking driver\n  - [x] Async driver\n  - [x] Ring buffer based async\n- [x] I2C\n  - [x] Blocking driver\n  - [x] Async driver\n- [x] SPI driver\n  - [x] QSPI driver\n  - [x] Blocking\n  - [x] Async using DMA\n- [x] PWM driver (v53/v62/v67)\n  - [x] SimplePwm with type-safe pin traits\n  - [x] Multi-channel support\n  - [ ] ComplementaryPwm with dead-time\n  - [ ] InputCapture\n  - [ ] PWMV2 (v6e, HPM6E00/5E00)\n- [x] ADC driver\n  - [x] ADC16\n    - blocking one-shot\n    - blocking periodic\n    - [ ] sequence mode\n    - [ ] preemption mode\n  - [ ] ADC12, and differential mode\n- [x] DAC driver\n  - [x] direct mode\n  - [x] step mode\n  - [x] buffer mode\n  - [ ] buffer switch control using async\n  - [ ] hw trigger control\n- [x] RTC, with alarm driver and optional chrono datetime\n- [x] MBX\n  - [x] blocking and async, message mode and fifo mode\n  - [ ] DMA driver?\n- [x] FEMC\n  - [x] SDRAM init\n- [x] MCAN\n  - [x] basic `mcan` wrapper\n  - ~~[ ] async driver~~, better impl it in the App layer, see XiaoMi CyberGear motor demo\n  - [ ] TSU management\n- [x] USB via embassy-usb\n  - [x] Device\n  - [ ] Host\n- [x] XPI NOR flash driver using embedded-storage\n- [x] RNG, in blocking mode\n- [ ] power domain handling\n\n### Related Crates\n\n- [x] [andes-riscv] for Andes' specific CSRs, PLIC\n- [x] [hpm-data] and [hpm-metapac] for Chip metadata and PAC generation\n- [x] [hpm-riscv-rt] for customized runtime (riscv-rt does not fit)\n\n### Toolchain Support\n\n- [probe-rs]\n  - [x] [HPM5300 series flash algorithm support](https://github.com/probe-rs/probe-rs/pull/2575)\n    - Other series are available in the top level of this repo as `HPMicro.yaml`\n    - HPM6750 is not working(unknown bug), use OpenOCD instead\n  - [probe-rs HPM fork] (`hpmicro` branch), with DAP support and flash speed fix for HPM's RISC-V MCUs\n    - [ ] Upstream Pull Request [#2578 JTag support for DAPLink](https://github.com/probe-rs/probe-rs/pull/2578)\n\n## Usage\n\nThe best reference is the examples in the `examples` directory and Github actions workflow.\n\n### Requirements\n\n- A probe(debugger), optional if you are using official HPMicro's development board\n  - FT2232-based (official HPMicro's development board uses this chip)\n  - JLink\n  - DAPLink-based probe\n- A flash tool for your probe, choose one from:\n  - [probe-rs]\n  - [HPM OpenOCD]\n  - JLink\n  - HPMIcro Manufacturing Tool\n- A RISC-V GCC toolchain if you perfer to use OpenOCD(only GDB is needed)\n- A Rust toolchain\n  - `rustup default nightly`\n  - `rustup target add riscv32imafc-unknown-none-elf`\n\n### Guide\n\n#### Step 0. Prerequisites\n\n- Install Rust: \u003chttps://rustup.rs/\u003e\n- Download HPM SDK: \u003chttps://github.com/hpmicro/hpm_sdk\u003e\n  - Set `HPM_SDK_BASE` environment variable to the SDK path\n- Choose one debugger:\n  - OpenOCD: HPM's fork \u003chttps://github.com/hpmicro/riscv-openocd\u003e\n  - [probe-rs] or [probe-rs HPM fork]\n    - The `HPMicro.yaml` flash algorithm is provided in top level of this repo\n    - If you are using DAPLink probe, you need to use the version from PR [#2578 JTag support for DAPLink](https://github.com/probe-rs/probe-rs/pull/2578)\n\n#### Step 1. Prepare Rust Toolchain\n\n```bash\nrustup default nightly\nrustup target add riscv32imafc-unknown-none-elf\n```\n\n#### Step 2. Clone this repo\n\n```bash\ngit clone https://github.com/hpmicro/hpm-hal.git\n\n# Or if you are using SSH\n\ngit clone git@github.com:hpmicro/hpm-hal.git\n\n# Or if you are using GitHub CLI\n\ngh repo clone hpmicro/hpm-hal\n```\n\n#### Step 3. Run Examples\n\n1. Edit `examples/YOUR_BOARD/.cargo/config.toml` to set the correct flash/run command for your probe.\n\n2. (Optional) Edit and run `run-openocd.sh` if using OpenOCD.\n\n3. Connect your probe to the target board.\n\n4. Run an example:\n\n```bash\ncd examples/hpm5300evk\ncargo run --release --bin blinky\n```\n\n## License\n\nThis repo is licensed under either of\n\n- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n  \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n## Contributing\n\nThis 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.\n\n[hpm-data]: https://github.com/hpmicro/hpm-data\n[HPM OpenOCD]: https://github.com/hpmicro/riscv-openocd\n[probe-rs]: https://github.com/probe-rs/probe-rs\n[probe-rs HPM fork]: https://github.com/hpmicro/probe-rs\n[andes-riscv]: https://github.com/hpmicro-rs/andes-riscv\n[hpm-metapac]: https://docs.rs/hpm-metapac/latest/hpm_metapac\n[hpm-riscv-rt]: https://github.com/hpmicro-rs/hpm-riscv-rt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpmicro%2Fhpm-hal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhpmicro%2Fhpm-hal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpmicro%2Fhpm-hal/lists"}