一般故障排除

cargo-embed问题

大多数cargo-embed问题要么与未正确安装udev规则(在Linux上)有关,要么与在嵌入中选择了错误的芯片配置有关。 Embed.toml确保你两个都是对的。

如果上述方法不适用于您,您可以在discovery issue tracker打开问题。 或者,您也可以访问Rust Embedded matrix channel或者probe-rs matrix channel并在那里寻求帮助。

Cargo 问题

"找不到corecrate"

症状

   Compiling volatile-register v0.1.2
   Compiling rlibc v1.0.0
   Compiling r0 v0.1.0
error[E0463]: can't find crate for `core`

error: aborting due to previous error

error[E0463]: can't find crate for `core`

error: aborting due to previous error

error[E0463]: can't find crate for `core`

error: aborting due to previous error

Build failed, waiting for other jobs to finish...
Build failed, waiting for other jobs to finish...
error: Could not compile `r0`.

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

原因

您忘记为微控制器安装正确的目标(对于v2,thumbv7em-none-eabihf,对于v1thumbv6m-none-eabi)。

修复

安装正确的目标。

# micro:bit v2
$ rustup target add thumbv7em-none-eabihf

# micro:bit v1
$ rustup target add thumbv6m-none-eabi