Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/riscv-peripheral.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
build-riscv:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.75.0
toolchain: [ stable, nightly, 1.75.0 ]
# All generated code should be running on stable now, MRSV is 1.81.0
toolchain: [ stable, nightly, 1.81.0 ]
target:
- riscv32i-unknown-none-elf
- riscv32imc-unknown-none-elf
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/riscv-rt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
build-riscv:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.68.0
toolchain: [ stable, nightly, 1.68.0 ]
# All generated code should be running on stable now, MRSV is 1.81.0
toolchain: [ stable, nightly, 1.81.0 ]
target:
- riscv32i-unknown-none-elf
- riscv32im-unknown-none-elf
Expand All @@ -27,11 +27,6 @@ jobs:
# Nightly is only for reference and allowed to fail
- toolchain: nightly
experimental: true
exclude:
- toolchain: 1.68.0
target: riscv32im-unknown-none-elf
- toolchain: 1.68.0
target: riscv32imafc-unknown-none-elf
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/riscv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
build-riscv:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.68.0
toolchain: [ stable, nightly, 1.68.0 ]
# All generated code should be running on stable now, MRSV is 1.81.0
toolchain: [ stable, nightly, 1.81.0 ]
target:
- riscv32i-unknown-none-elf
- riscv32imc-unknown-none-elf
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
run-build:
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.68.0
toolchain: [ stable, nightly, 1.68.0 ]
# All generated code should be running on stable now, MRSV is 1.81.0
toolchain: [ stable, nightly, 1.81.0 ]
target:
- riscv32i-unknown-none-elf
- riscv32im-unknown-none-elf
Expand All @@ -36,11 +36,6 @@ jobs:
# Nightly is only for reference and allowed to fail
- toolchain: nightly
experimental: true
exclude:
- toolchain: 1.68.0
target: riscv32im-unknown-none-elf
- toolchain: 1.68.0
target: riscv32imafc-unknown-none-elf
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || false }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
This repository contains various crates useful for writing Rust programs on RISC-V microcontrollers:

* [`riscv`]: CPU registers access and intrinsics
* [`riscv-pac`]: Common traits to be implemented by RISC-V PACs
* [`riscv-peripheral`]: Interfaces for standard RISC-V peripherals
* [`riscv-rt`]: Startup code and interrupt handling
* [`riscv-semihosting`]: Semihosting for RISC-V processors
* [`riscv-target-parser`]: Utility crate for parsing RISC-V targets in build scripts
* [`riscv-types`]: Common traits to be implemented by RISC-V PACs

This project is developed and maintained by the [RISC-V team][team].

Expand All @@ -24,7 +24,7 @@ Conduct][CoC], the maintainer of this crate, the [RISC-V team][team], promises
to intervene to uphold that code of conduct.

[`riscv`]: https://crates.io/crates/riscv
[`riscv-pac`]: https://crates.io/crates/riscv-pac
[`riscv-types`]: https://crates.io/crates/riscv-types
[`riscv-peripheral`]: https://crates.io/crates/riscv-peripheral
[`riscv-rt`]: https://crates.io/crates/riscv-rt
[`riscv-semihosting`]: https://crates.io/crates/riscv-semihosting
Expand Down
1 change: 1 addition & 0 deletions riscv-pac/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- This crate has been deprecated. Use `riscv-types` instead.
- Updated the license to `MIT or Apache-2.0`

## [v0.2.0] - 2024-10-19
Expand Down
2 changes: 1 addition & 1 deletion riscv-pac/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "riscv-pac"
version = "0.2.0"
version = "0.3.0"
edition = "2021"
rust-version = "1.60"
repository = "https://github.com/rust-embedded/riscv"
Expand Down
4 changes: 4 additions & 0 deletions riscv-pac/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[![crates.io](https://img.shields.io/crates/d/riscv-pac.svg)](https://crates.io/crates/riscv-pac)
[![crates.io](https://img.shields.io/crates/v/riscv-pac.svg)](https://crates.io/crates/riscv-pac)

# Deprecation notice

This crate has been deprecated. Use [`riscv-types`](https://crates.io/crates/riscv-types) instead.

# `riscv-pac`

> Target-specific traits to be implemented by PACs
Expand Down
4 changes: 4 additions & 0 deletions riscv-pac/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! # Deprecation notice
//!
//! This crate has been deprecated. Use [`riscv-types`](https://crates.io/crates/riscv-types) instead.

#![no_std]

pub mod result;
Expand Down
1 change: 1 addition & 0 deletions riscv-peripheral/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- Bump MSRV to 1.81 due to `riscv`
- Update license to `MIT or Apache-2.0`

### Fixed
Expand Down
3 changes: 1 addition & 2 deletions riscv-peripheral/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "riscv-peripheral"
version = "0.4.0"
edition = "2021"
rust-version = "1.75"
rust-version = "1.81"
repository = "https://github.com/rust-embedded/riscv"
authors = ["The RISC-V Team <[email protected]>"]
categories = ["embedded", "hardware-support", "no-std"]
Expand All @@ -17,7 +17,6 @@ license = "MIT OR Apache-2.0"
embedded-hal = "1.0.0"
paste = "1.0"
riscv = { path = "../riscv", version = "0.15.0" }
riscv-pac = { path = "../riscv-pac", version = "0.2.0" }

[package.metadata.docs.rs]
all-features = true
Expand Down
4 changes: 2 additions & 2 deletions riscv-peripheral/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ This project is developed and maintained by the [RISC-V team][team].

## Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.75 and up. It *might*
This crate is guaranteed to compile on stable Rust 1.81 and up. It *might*
compile with older versions but that may change in any new patch release.

## License

Copyright 2023-2024 [RISC-V team][team]
Copyright 2023-2025 [RISC-V team][team]

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
Expand Down
2 changes: 1 addition & 1 deletion riscv-peripheral/src/aclint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub mod mswi;
pub mod mtimer;
pub mod sswi;

pub use riscv_pac::HartIdNumber; // re-export useful riscv-pac traits
pub use riscv::HartIdNumber; // re-export useful riscv-types traits

/// Trait for a CLINT peripheral.
///
Expand Down
2 changes: 1 addition & 1 deletion riscv-peripheral/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#![deny(missing_docs)]
#![no_std]

pub use riscv_pac::result; // re-export the result module
pub use riscv::result; // re-export the result module

pub mod common; // common definitions for all peripherals
pub mod hal; // trait implementations for embedded-hal
Expand Down
4 changes: 2 additions & 2 deletions riscv-peripheral/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub use paste::paste;
/// ## Base address and per-HART mtimecmp registers, private `fn new()` function
///
/// ```
/// use riscv_pac::result::{Error, Result};
/// use riscv::result::{Error, Result};
///
/// /// HART IDs for the target CLINT peripheral
/// #[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand Down Expand Up @@ -142,7 +142,7 @@ macro_rules! clint_codegen {
/// ## Base address and per-HART context proxies, private `fn new()` function
///
/// ```
/// use riscv_pac::result::{Error, Result};
/// use riscv::result::{Error, Result};
///
/// /// HART IDs for the target CLINT peripheral
/// #[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand Down
6 changes: 3 additions & 3 deletions riscv-peripheral/src/plic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ pub mod pendings;
pub mod priorities;
pub mod threshold;

// re-export useful riscv-pac traits
pub use riscv_pac::{HartIdNumber, InterruptNumber, PriorityNumber};
// re-export useful riscv-types traits
pub use riscv::{HartIdNumber, InterruptNumber, PriorityNumber};

use riscv::register::{mhartid, mie, mip};

Expand Down Expand Up @@ -200,7 +200,7 @@ impl<P: Plic> CTX<P> {
#[cfg(test)]
pub(crate) mod test {
use crate::test::HartId;
use riscv_pac::HartIdNumber;
use riscv::HartIdNumber;

#[allow(dead_code)]
#[test]
Expand Down
4 changes: 2 additions & 2 deletions riscv-peripheral/src/plic/claim.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Interrupt claim/complete register

use crate::common::unsafe_peripheral;
use riscv_pac::ExternalInterruptNumber;
use riscv::ExternalInterruptNumber;

unsafe_peripheral!(CLAIM, u32, RW);

Expand Down Expand Up @@ -32,7 +32,7 @@ impl CLAIM {
mod test {
use super::*;
use crate::test::Interrupt;
use riscv_pac::InterruptNumber;
use riscv::InterruptNumber;

#[test]
fn test_claim() {
Expand Down
2 changes: 1 addition & 1 deletion riscv-peripheral/src/plic/enables.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Interrupt enables register of a PLIC context.

use crate::common::{Reg, RW};
use riscv_pac::ExternalInterruptNumber;
use riscv::ExternalInterruptNumber;

/// Enables register of a PLIC context.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion riscv-peripheral/src/plic/pendings.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Interrupt pending bits register.

use crate::common::{Reg, RO};
use riscv_pac::ExternalInterruptNumber;
use riscv::ExternalInterruptNumber;

/// Interrupts pending bits register.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand Down
4 changes: 2 additions & 2 deletions riscv-peripheral/src/plic/priorities.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Interrupts Priorities register.

use crate::common::{Reg, RW};
use riscv_pac::{ExternalInterruptNumber, PriorityNumber};
use riscv::{ExternalInterruptNumber, PriorityNumber};

/// Interrupts priorities register.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
Expand Down Expand Up @@ -71,7 +71,7 @@ impl PRIORITIES {
mod test {
use super::*;
use crate::test::{Interrupt, Priority};
use riscv_pac::InterruptNumber;
use riscv::InterruptNumber;

#[test]
fn test_priorities() {
Expand Down
2 changes: 2 additions & 0 deletions riscv-rt/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- Bump MSRV to 1.81 due to `riscv-types`
- Use `riscv-types` instead of `riscv-pac`
- Update license to `MIT or Apache-2.0`
- Fix clippy warnings in riscv_rt_macros::strip_type_path
- Bump MSRV to 1.68 for latest syn 2.0 release
Expand Down
4 changes: 2 additions & 2 deletions riscv-rt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "riscv-rt"
version = "0.16.0"
rust-version = "1.68"
rust-version = "1.81"
repository = "https://github.com/rust-embedded/riscv"
authors = ["The RISC-V Team <[email protected]>"]
categories = ["embedded", "no-std"]
Expand All @@ -25,7 +25,7 @@ riscv-target-parser = { path = "../riscv-target-parser", version = "0.1.2" }

[dependencies]
riscv = { path = "../riscv", version = "0.15.0", features = ["rt"] }
riscv-pac = { path = "../riscv-pac", version = "0.2.0" }
riscv-types = { path = "../riscv-types", version = "0.1.0" }
riscv-rt-macros = { path = "macros", version = "0.6.0" }

defmt = { version = "1.0.1", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion riscv-rt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,8 @@ use riscv::register::{
mtvec::{self as xtvec, Mtvec as Xtvec, TrapMode},
};

pub use riscv_pac::*;
pub use riscv_rt_macros::{core_interrupt, entry, exception, external_interrupt};
pub use riscv_types::*;

#[cfg(feature = "post-init")]
pub use riscv_rt_macros::post_init;
Expand Down
4 changes: 3 additions & 1 deletion riscv/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed

- Bump MSRV to 1.81 due to `riscv-types`
- Use `riscv-types` instead of `riscv-pac`
- Reexport only `pac_enum` macro from `riscv-macros`
- Moved macros from `./macros/` to `../riscv-macros/`
- Updated the license to `MIT or Apache-2.0`
- Bump MSRV to 1.68 for latest version of syn 2.0
- Now, `riscv::pac_enum` macro only includes trap-related code if `rt` or `rt-v-trap` features are enabled.

## [v0.15.0] - 2025-09-08
Expand Down
4 changes: 2 additions & 2 deletions riscv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "riscv"
version = "0.15.0"
edition = "2021"
rust-version = "1.68"
rust-version = "1.81"
repository = "https://github.com/rust-embedded/riscv"
authors = ["The RISC-V Team <[email protected]>"]
categories = ["embedded", "hardware-support", "no-std"]
Expand All @@ -29,6 +29,6 @@ rt-v-trap = ["rt", "riscv-macros/rt-v-trap"]
[dependencies]
critical-section = "1.2.0"
embedded-hal = "1.0.0"
riscv-pac = { path = "../riscv-pac", version = "0.2.0" }
riscv-types = { path = "../riscv-types", version = "0.1.0" }
riscv-macros = { path = "../riscv-macros", version = "0.3.0", optional = true }
paste = "1.0.15"
4 changes: 2 additions & 2 deletions riscv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ This project is developed and maintained by the [RISC-V team][team].

## Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.61 and up. It *might*
This crate is guaranteed to compile on stable Rust 1.81 and up. It *might*
compile with older versions but that may change in any new patch release.

## License

Copyright 2019-2022 [RISC-V team][team]
Copyright 2019-2025 [RISC-V team][team]

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
Expand Down
2 changes: 1 addition & 1 deletion riscv/src/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use crate::result::Result;

// re-export useful riscv-pac traits
pub use riscv_pac::{CoreInterruptNumber, ExceptionNumber, InterruptNumber};
pub use crate::{CoreInterruptNumber, ExceptionNumber, InterruptNumber};

pub mod machine;
pub mod supervisor;
Expand Down
2 changes: 0 additions & 2 deletions riscv/src/interrupt/machine.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
interrupt::Trap,
register::{mcause, mepc, mie, mip, mstatus},
};
use riscv_pac::{
result::{Error, Result},
CoreInterruptNumber, ExceptionNumber, InterruptNumber,
};
Expand Down
2 changes: 0 additions & 2 deletions riscv/src/interrupt/supervisor.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
interrupt::Trap,
register::{scause, sepc, sie, sip, sstatus},
};
use riscv_pac::{
result::{Error, Result},
CoreInterruptNumber, ExceptionNumber, InterruptNumber,
};
Expand Down
4 changes: 2 additions & 2 deletions riscv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ pub mod register;

// Re-export crates of the RISC-V ecosystem
#[cfg(feature = "riscv-macros")]
pub use riscv_macros::*;
pub use riscv_pac::*;
pub use riscv_macros::pac_enum;
pub use riscv_types::*;

#[macro_use]
mod macros;
Expand Down
Loading