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.

编译结果:
编译结果

相关推荐

  1. ML307R OpenCPU UDP使用

    2024-07-22 04:02:04       33 阅读
  2. 基于 Docker 交叉编译环境

    2024-07-22 04:02:04       65 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-22 04:02:04       104 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-22 04:02:04       115 阅读
  3. 在Django里面运行非项目文件

    2024-07-22 04:02:04       94 阅读
  4. Python语言-面向对象

    2024-07-22 04:02:04       100 阅读

热门阅读

  1. qt 数字转字符

    2024-07-22 04:02:04       25 阅读
  2. qt log 输出为文件

    2024-07-22 04:02:04       23 阅读
  3. 谈谈如何快速学习一门技术

    2024-07-22 04:02:04       24 阅读
  4. WebGIS面试题(第八期)

    2024-07-22 04:02:04       21 阅读
  5. 算法的概述

    2024-07-22 04:02:04       22 阅读
  6. 2024年水利水电安全员考试题库及答案

    2024-07-22 04:02:04       25 阅读
  7. c语言(7.21)

    2024-07-22 04:02:04       23 阅读
  8. 原型继承和原型链

    2024-07-22 04:02:04       25 阅读
  9. 【渗透入门】反序列化

    2024-07-22 04:02:04       23 阅读
  10. Windows图形界面(GUI)-DLG-C/C++ - 月历控件(MonthCalendar)

    2024-07-22 04:02:04       25 阅读
  11. Dijkstra

    2024-07-22 04:02:04       24 阅读
  12. B树:高效的数据存储结构

    2024-07-22 04:02:04       23 阅读