#risc-v #wch #ch32v #handle #qingke

no-std qingke-rt

Minimal runtime / startup for WCH's RISC-V MCUs, managed by the ch32-rs team

11 releases (4 breaking)

0.5.0 Nov 3, 2024
0.4.0 Oct 20, 2024
0.3.0 Oct 10, 2024
0.2.1 May 14, 2024
0.1.7 Jan 1, 2024

#2073 in Embedded development

Download history 38/week @ 2024-09-24 24/week @ 2024-10-01 220/week @ 2024-10-08 138/week @ 2024-10-15 52/week @ 2024-10-22 450/week @ 2024-10-29 136/week @ 2024-11-05 301/week @ 2024-11-12 93/week @ 2024-11-19 73/week @ 2024-11-26 97/week @ 2024-12-03 145/week @ 2024-12-10 124/week @ 2024-12-17 111/week @ 2024-12-24 105/week @ 2024-12-31 64/week @ 2025-01-07

466 downloads per month
Used in ch58x-hal

MIT/Apache

54KB
1K SLoC

Rust 1K SLoC // 0.1% comments Alex 183 SLoC Shell 3 SLoC

qingke-rt

Replaces ch32v-rt as the name is not suitable for publishing.

QingKe is the name of the RISC-V core.

Usage

#[qingke_rt::entry]
fn main() -> ! {
    loop {}
}

// Or if you are using the embassy framework
#[embassy_executor::main(entry = "qingke_rt::entry")]
async fn main(spawner: Spawner) -> ! { ... }

#[qingke_rt::interrupt]
fn UART0() {
    // ...
}

// Interrupt provided by the IP core (not peripherals)
#[qingke_rt::interrupt(core)]
fn SysTick() {
    // ...
}

#[qingke_rt::highcode]
fn some_highcode_fn() {
    // ...
    // This fn will be loaded into the highcode(SRAM) section.
    // This is required for BLE, recommended for interrupt handles.
}

lib.rs:

Differences vs the riscv-rt version

  • The structure of exception handlers is different
  • The structure of core interrupt handlers is different
  • Hardware stack push is available, so no need to push manually

Dependencies

~0.6–1MB
~22K SLoC