我尝试在Ubuntu22.04主机上设置工具链来运行来自https://github.com/lancaster-university/microbit-samples/的示例,但是我只是无法设置Yotta,我一直遇到不同的依赖问题。确切的步骤是什么?
发布于 2022-09-28 07:53:11
在尝试设置工具链一段时间之后,我终于决定用谷歌搜索一个带有工具链的Docker映像,并找到了来自微:Bit基金会员工Carlos的https://github.com/carlosperate/docker-microbit-toolchain 在这次承诺中,这完全奏效了:
# Get the Docker image.
docker pull ghcr.io/carlosperate/microbit-toolchain:latest
# Get examples.
git clone https://github.com/lancaster-university/microbit-samples
cd microbit-samples
git checkout 285f9acfb54fce2381339164b6fe5c1a7ebd39d5
# Select a sample. It builds one at a time. The default one is the hello world.
cp source/examples/hello-world/* source
# Build and flash.
docker run -v $(pwd):/home --rm ghcr.io/carlosperate/microbit-toolchain:latest yotta build
# Flash.
cp build/bbc-microbit-classic-gcc/source/microbit-samples-combined.hex "/media/$USER/MICROBIT/"然后,您可以闪现要运行的示例:
cp build/counter.hex "/media/$USER/MICROBIT/"#include "MicroBit.h"
MicroBit uBit;
int main()
{
uBit.init();
uBit.display.scroll("HELLO WORLD! :)");
release_fiber();
}Atencios的Docker安装程序解释了如何让yotta工作,如果您还想这样做的话:https://github.com/carlosperate/docker-microbit-toolchain/blob/master/Dockerfile,关键可能是使用他神奇构建的requirements.txt,这很可能是从事情真正发生的那一天起,以避免yotta无限多的依赖问题。他在Ubuntu 20.04。
发布于 2022-09-28 11:13:39
您已经找到了一项工作来编译微:位的C,这是很好的。为了回答您最初的问题,下面是我在Debian11.5上安装yotta的工作原理。我安装了Pythonv3.9.2。
sudo aptitude install python-setuptools cmake build-essential ninja-build python-dev libffi-dev libssl-dev
pip3 install yotta --userhttps://stackoverflow.com/questions/73877965
复制相似问题