在 docker 中新创建了 micropython 编译环境容器

MicroPython相关代码、库、软件、工具
回复
头像
shaoziyang
帖子: 3917
注册时间: 2019年 10月 21日 13:48

在 docker 中新创建了 micropython 编译环境容器

#1

帖子 shaoziyang »

为了方便大家,在docker中创建新的容器,可以方便的编译源码。目前已经可以方便的编译 STM32、NRF、SAMD,其它型号将逐步加入。

图片
隐藏内容
你必须登入/注册才可观看隐藏内容
 

头像
shaoziyang
帖子: 3917
注册时间: 2019年 10月 21日 13:48

Re: 在 docker 中新创建了 micropython 编译环境容器

#2

帖子 shaoziyang »

安装 docker 后,可以用下面命令获取容器。

代码: 全选

docker pull shaoziyang/micropython-builder
如果直接下载比较慢,可以网上搜索加速的方法。

如:  

maysrp
帖子: 2
注册时间: 2021年 2月 19日 16:22

Re: 在 docker 中新创建了 micropython 编译环境容器

#3

帖子 maysrp »

大佬! 有教程吧,docker下的编译及修改源码教程?

头像
shaoziyang
帖子: 3917
注册时间: 2019年 10月 21日 13:48

Re: 在 docker 中新创建了 micropython 编译环境容器

#4

帖子 shaoziyang »

不需要特别教程吧,都是按照相关说明操作就行。做成docker只是为了方便大家,不用重复在做一次。

lemon1394
帖子: 4
注册时间: 2022年 10月 7日 10:36

Re: 在 docker 中新创建了 micropython 编译环境容器

#5

帖子 lemon1394 »

编译报错


# cd /micropython
# ls
ACKNOWLEDGEMENTS    CODEOFCONDUCT.md  LICENSE    docs     examples  lib   mpy-cross  py      tests
CODECONVENTIONS.md  CONTRIBUTING.md   README.md  drivers  extmod    logo  ports      shared  tools
# make -C port/esp32
make: *** port/esp32: No such file or directory.  Stop.
# make -C ports/esp32
make: Entering directory '/micropython/ports/esp32'
idf.py -D MICROPY_BOARD=GENERIC -B build-GENERIC  build
make: idf.py: Command not found
make: *** [Makefile:34: all] Error 127
make: Leaving directory '/micropython/ports/esp32'
#


 

头像
shaoziyang
帖子: 3917
注册时间: 2019年 10月 21日 13:48

Re: 在 docker 中新创建了 micropython 编译环境容器

#6

帖子 shaoziyang »

编译的目录不对,需要在micropython目录下编译,或者到port/esp32下编译
 

lemon1394
帖子: 4
注册时间: 2022年 10月 7日 10:36

Re: 在 docker 中新创建了 micropython 编译环境容器

#7

帖子 lemon1394 »

shaoziyang/micropython-builder - Docker Image | Docker Hub
按照上面提供的命令编译的,但是/micropython里没有 port 目录,只有ports目录,所以改用 make -C ports/esp32
报的错是 没有找到 idf.py

lemon1394
帖子: 4
注册时间: 2022年 10月 7日 10:36

Re: 在 docker 中新创建了 micropython 编译环境容器

#8

帖子 lemon1394 »

重装了一下esp-idf,编译的时候还要写什么用户名密码

# make -C ports/esp32
make: Entering directory '/micropython/ports/esp32'
idf.py -D MICROPY_BOARD=GENERIC -B build-GENERIC  build
Executing action: all (aliases: build)
Running cmake in directory /micropython/ports/esp32/build-GENERIC
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DMICROPY_BOARD=GENERIC -DCCACHE_ENABLE=0 /micropython/ports/esp32"...
-- IDF_TARGET not set, using default target: esp32
-- Found Git: /usr/bin/git (found version "2.25.1") 
-- Initialising new submodule components/bt/controller/lib_esp32c3_family...
Submodule 'components/bt/controller/lib_esp32c3_family' (https://gitee.com/espressif/esp32c3-bt-lib.git) registered for path 'components/bt/controller/lib_esp32c3_family'
Cloning into '/esp/esp-idf/components/bt/controller/lib_esp32c3_family'...
Username for 'https://gitee.com': 
Password for 'https://gitee.com': 

remote: [session-0945ecb7] Unauthorized
fatal: Authentication failed for 'https://gitee.com/espressif/esp32c3-bt-lib.git/'
fatal: clone of 'https://gitee.com/espressif/esp32c3-bt-lib.git' into submodule path '/esp/esp-idf/components/bt/controller/lib_esp32c3_family' failed
Failed to clone 'components/bt/controller/lib_esp32c3_family'. Retry scheduled
Cloning into '/esp/esp-idf/components/bt/controller/lib_esp32c3_family'...
Username for 'https://gitee.com': 
Password for 'https://gitee.com': 

remote: [session-f045cfa5] Unauthorized
fatal: Authentication failed for 'https://gitee.com/espressif/esp32c3-bt-lib.git/'
fatal: clone of 'https://gitee.com/espressif/esp32c3-bt-lib.git' into submodule path '/esp/esp-idf/components/bt/controller/lib_esp32c3_family' failed
Failed to clone 'components/bt/controller/lib_esp32c3_family' a second time, aborting
CMake Error at /esp/esp-idf/tools/cmake/git_submodules.cmake:48 (message):
  Git submodule init failed for components/bt/controller/lib_esp32c3_family
Call Stack (most recent call first):
  /esp/esp-idf/tools/cmake/build.cmake:80 (git_submodule_check)
  /esp/esp-idf/tools/cmake/build.cmake:237 (__build_get_idf_git_revision)
  /esp/esp-idf/tools/cmake/idf.cmake:53 (__build_init)
  /esp/esp-idf/tools/cmake/project.cmake:12 (include)
  CMakeLists.txt:22 (include)


-- Configuring incomplete, errors occurred!
cmake failed with exit code 1, output of the command is in the /micropython/ports/esp32/build-GENERIC/log/idf_py_stderr_output_856 and /micropython/ports/esp32/build-GENERIC/log/idf_py_stdout_output_856
make: *** [Makefile:34: all] Error 2
make: Leaving directory '/micropython/ports/esp32'
#

头像
shaoziyang
帖子: 3917
注册时间: 2019年 10月 21日 13:48

Re: 在 docker 中新创建了 micropython 编译环境容器

#9

帖子 shaoziyang »

是ports,前面写错了。

esp32c3的编译还没有尝试,好像看到说有些地方稍有不同,等有空了试试。

回复

  • 随机主题
    回复总数
    阅读次数
    最新文章