stm32-rs / stm32g0xx-hal

Peripheral access API for STM32G0 series microcontrollers
Apache License 2.0
73 stars 51 forks source link

[dependencies.stm32g0xx-hal] produces error during cargo build "uplicate key: `stm32g0xx-hal`" #100

Closed jemo07 closed 2 years ago

jemo07 commented 2 years ago

Hello,

I get the following error while trying to build after just adding entries to Cargo.toml. Here is the excerpt from that file:

[dependencies.stm32g0xx-hal]
version = "0.1.3"
features = ["rt", "stm32g030"]

[dependencies]
embedded-hal = "0.2.7"
bit_field = "~0.10"
bme280-multibus = "0.2.1"
stm32g0xx-hal = "0.1.3"

Here is the outcome changing the order by placing the [dependencies.stm32g0xx-hal] before/after [dependencies]

Caused by:
  duplicate key: `stm32g0xx-hal` for key `dependencies` at line 11 column 1
jemo@jemoLINUX:~/development/git/nuecleo-bme280$ cargo build
error: failed to parse manifest at `/home/jemo/development/git/nuecleo-bme280/Cargo.toml`

Caused by:
  could not parse input as TOML

Caused by:
  duplicate key: `stm32g0xx-hal` for key `dependencies` at line 14 column 1
jemo@jemoLINUX:~/development/git/nuecleo-bme280$ 
andresv commented 2 years ago

Try like this:

[dependencies]
embedded-hal = "0.2.7"
bit_field = "~0.10"
bme280-multibus = "0.2.1"
stm32g0xx-hal = { version = "0.1.3", features = ["rt", "stm32g030"] }
andresv commented 2 years ago

If you use it like this:

[dependencies.stm32g0xx-hal]
version = "0.1.3"
features = ["rt", "stm32g030"]

Then this must be removed, otherwise it is duplicated:

[dependencies]
embedded-hal = "0.2.7"
bit_field = "~0.10"
bme280-multibus = "0.2.1"
- stm32g0xx-hal = "0.1.3"