Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest master head 6a96e5c fails to build #2

Open
sheref-sidarous opened this issue Apr 29, 2020 · 1 comment
Open

Latest master head 6a96e5c fails to build #2

sheref-sidarous opened this issue Apr 29, 2020 · 1 comment

Comments

@sheref-sidarous
Copy link

$ git log -n1
commit 6a96e5cc86cbb888e3e11443a2b942fcff0fe669 (HEAD -> master, origin/master, origin/HEAD)
Author: luojia65 <[email protected]>
Date:   Wed Apr 29 13:44:17 2020 +0800

    Fix GPIO input
$ cargo build
    Updating crates.io index
error: failed to select a version for `bare-metal`.
    ... required by package `riscv v0.5.6`
    ... which is depended on by `k210-example v0.1.1 (/home/public/projects/rust/k210-example)`
versions that meet the requirements `>= 0.2.0, < 0.2.5` are: 0.2.4, 0.2.3, 0.2.1

all possible versions conflict with previously selected packages.

  previously selected package `bare-metal v0.2.5`
    ... which is depended on by `k210-pac v0.2.0`
    ... which is depended on by `k210-hal v0.2.0`
    ... which is depended on by `k210-example v0.1.1 (/home/public/projects/rust/k210-example)`

failed to select a version for `bare-metal` which could resolve this conflict

To resolve this error, I downgraded riscv-rt to "0.6.1" and removed explicit dependency on riscv, here is the edited cargo file

[package]
name = "k210-example"
version = "0.1.1"
authors = ["The RISC-V Team <[email protected]>"]
edition = "2018"

[dependencies]
panic-halt = "0.2.0"
riscv-rt = "0.6.1"
k210-hal = "0.2.0"

But still, I get the following build error

$ cargo build
   Compiling bit_field v0.9.0
   Compiling r0 v0.2.2
   Compiling vcell v0.1.2
   Compiling void v1.0.2
   Compiling nb v0.1.2
   Compiling k210-example v0.1.1 (/home/public/projects/rust/k210-example)
   Compiling panic-halt v0.2.0
   Compiling semver v0.9.0
   Compiling proc-macro2 v0.4.30
   Compiling syn v0.15.44
   Compiling rand_core v0.3.1
   Compiling riscv v0.5.4
   Compiling riscv-rt v0.6.1
   Compiling k210-pac v0.2.0
   Compiling embedded-hal v0.2.3
   Compiling rand v0.5.6
   Compiling rustc_version v0.2.3
   Compiling quote v0.6.13
   Compiling bare-metal v0.2.5
   Compiling riscv-rt-macros v0.1.6
   Compiling k210-hal v0.2.0
error[E0603]: module `fpioa` is private
 --> src/main.rs:7:15
  |
7 | use k210_hal::fpioa;
  |               ^^^^^

error[E0599]: no method named `constrain` found for type `k210_pac::SYSCTL` in the current scope
  --> src/main.rs:14:27
   |
14 |     let sysctl = p.SYSCTL.constrain();
   |                           ^^^^^^^^^ method not found in `k210_pac::SYSCTL`

error[E0599]: no method named `split` found for type `k210_pac::FPIOA` in the current scope
  --> src/main.rs:16:25
   |
16 |     let fpioa = p.FPIOA.split(&mut sysctl.apb0);
   |                         ^^^^^ method not found in `k210_pac::FPIOA`

error[E0061]: this function takes 3 parameters but 2 parameters were supplied
  --> src/main.rs:23:27
   |
23 |     let serial = p.UARTHS.configure(
   |                           ^^^^^^^^^ expected 3 parameters

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0061, E0599, E0603.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `k210-example`.

To learn more, run the command again with --verbose.

Thanks,
Sheref

@Disasm
Copy link
Member

Disasm commented May 1, 2020

You need to build this example from a workspace: https://github.com/riscv-rust/k210-crates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants