项目地址:https://github.com/xiaguangbo/custom_rv32_rust
picorv32 + rust
各种适配要被搞麻了,所以打算都自己写
离线
出错代码:
program_picorv32ec/project/src/main.rs
```
#[picorv32asm::entry]
fn main() -> ! {
loop {}
}
```
现在的错误:
```
$ cargo build
Compiling picorv32asm v0.1.0 (/home/xiaguangbo/linux/project/custom_rv32_rust/program_picorv32ec/picorv32asm)
Compiling project v0.1.0 (/home/xiaguangbo/linux/project/custom_rv32_rust/program_picorv32ec/project)
Compiling picorv32entrymacro v0.1.0 (/home/xiaguangbo/linux/project/custom_rv32_rust/program_picorv32ec/picorv32asm/picorv32entrymacro)
error: unsafe attribute used without unsafe
--> src/main.rs:6:1
|
6 | #[picorv32asm::entry]
| ^^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute
|
= note: this error originates in the attribute macro `picorv32asm::entry` (in Nightly builds, run with -Z macro-backtrace for more info)
help: wrap the attribute in `unsafe(...)`
|
6 | unsafe(#[picorv32asm::entry])
| +++++++ +
error: could not compile `project` (bin "project") due to 1 previous error
```
奇了怪了,我看别的项目也这么写就可以用,比如wch rust项目的
最近编辑记录 Xiagb (2025-03-15 15:03:55)
离线
删除`program_picorv32ec/picorv32asm/picorv32entrymacro/Cargo.toml`里的 `edition = 2024`
离线
仓库里的已经可以运行了,效果就是闪灯。正在进行下一步
离线
离线
此项目地址修改到:https://github.com/xiaguangbo/picorv32_and_rust
离线