ML307R编译环境搭建
官方文档上对编译环境的搭建,轻描淡写,对于初学入门来说还是有点不好操作,这里也记录一下,方便别人避坑。
ML307R的sdk是基于Python使用scons编译的,这一点和ML307A不一样,ML307A不用安装别的软件,直接命令行编译就行。
官方文档的说明:
1. 先安装Python
我是直接在Windows的应用商城里安装的Python,比较省事,安装的3.24版本,文档要求3.7以上。
2.安装scons
安装过Python后,使用官方文档上的那个命令来安装scons:
pip install scons
C:\Windows\system32>pip install scons
Defaulting to user installation because normal site-packages is not writeable
Collecting scons
Using cached SCons-4.8.0-py3-none-any.whl.metadata (9.1 kB)
Using cached SCons-4.8.0-py3-none-any.whl (4.1 MB)
Installing collected packages: scons
WARNING: The scripts scons-configure-cache.exe, scons.exe and sconsign.exe are installed in 'C:\Users\wuwei\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed scons-4.8.0
安装成功后,上面有个提示,需要把scons的路径添加到环境变量里:
3.添加环境变量
win10或者win11,打开设置,在设置里搜索“环境变量”,如下图
如下截图把scons的路径添加到环境变量里:
4. 测试编译
配置好环境变量后,重新打开一个命令行,输入scons,出现如下提示说明安装成功:
编译测试:
D:\code\ML307R_OPENCPU\ML307R_OpenCPU_Standard_1.0.0.23112116_release>
* History restored
scons: Reading SConscript files ...
Operation system: win32
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: out\obj\DC
Compiling custom\custom_main\src\custom_main.c
Compiling src\cm_lib\cm_async_dns_adapt\async_dns_adapt.c
Compiling src\cm_lib\cm_ntp\cm_ntp.c
Compiling src\modem\cm_modem.c
Compiling third-party\cJSONFiles\cJSON\cJSON.c
Compiling third-party\mbedtls\library\aes.c
Compiling third-party\mbedtls\library\asn1parse.c
Compiling third-party\mbedtls\library\base64.c
Compiling third-party\mbedtls\library\bignum.c
Compiling third-party\mbedtls\library\cipher.c
Compiling third-party\mbedtls\library\cipher_wrap.c
Compiling third-party\mbedtls\library\ctr_drbg.c
Compiling third-party\mbedtls\library\debug.c
Compiling third-party\mbedtls\library\entropy.c
Compiling third-party\mbedtls\library\error.c
Compiling third-party\mbedtls\library\md.c
Compiling third-party\mbedtls\library\md_wrap.c
Compiling third-party\mbedtls\library\oid.c
Compiling third-party\mbedtls\library\pem.c
Compiling third-party\mbedtls\library\pk.c
Compiling third-party\mbedtls\library\pkparse.c
Compiling third-party\mbedtls\library\pk_wrap.c
Compiling third-party\mbedtls\library\platform.c
Compiling third-party\mbedtls\library\platform_util.c
Compiling third-party\mbedtls\library\rsa.c
Compiling third-party\mbedtls\library\rsa_internal.c
Compiling third-party\mbedtls\library\sha1.c
Compiling third-party\mbedtls\library\sha256.c
Compiling third-party\mbedtls\library\ssl_ciphersuites.c
Compiling third-party\mbedtls\library\ssl_cli.c
Compiling third-party\mbedtls\library\ssl_cookie.c
Compiling third-party\mbedtls\library\ssl_tls.c
Compiling third-party\mbedtls\library\x509.c
Compiling third-party\mbedtls\library\x509_crt.c
Generating out\image\DC\linker.lds
Linking out\image\DC\ML307R-DC_APP.elf
Generating out\image\DC\ML307R-DC_APP.bin
Generating out\image\DC\ML307R-DC_APP.lst
Generating out\image\DC\ML307R-DC_APP.zip
generate package Done
scons: done building targets.
编译结果:
原文地址:https://blog.csdn.net/wuquan_1230/article/details/140594201
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!