赞
踩
ML302 OpenCPU的SDK中已经提供了交叉编译链工具,在Windows 7/Windows 10 X64下开箱即用,暂不支持在其他平台进行应用程序的开发。
解压官方提供的ML302_OpenCPU_TTS_2.2.1.2010091712_release.7z
压缩包即可得到如下文件:
目录或文件 | 说明 |
---|---|
doc | API说明文档 |
firmware | 固件生成目录 |
inc | 头文件目录 |
out | 编译生成的中间文件 |
prebuilt | 库文件目录 |
src | 源文件目录 |
tools | 编译工具及相关文件 |
build.bat | 编译脚本文件 |
【注】不同版本会有细微的差别。
在SDK的根目录下执行build.bat DNLM
命令即可执行编译。
.\build.bat DNLM Making ML302 DNLM Version 'compile src/cm_main.c...''' 'compile src/cmsis_os.c...''' 'compile src\demo\ssl/cm_ssl.c...''' 'compile src/demo/lcd/cm_lcd_7735s.c...''' 'compile src/demo/lcd/cm_lcd_gc9106.c...''' 'compile src/demo/lcd/cm_lcd.c...''' 'compile src/demo/libmqttsn/src/paho.mqtt-sn.embedded-c/MQTTPacket/src/MQTTConnectClient.c...''' 'compile src/demo/libmqttsn/src/paho.mqtt-sn.embedded-c/MQTTPacket/src/MQTTSubscribeServer.c...''' 'compile src/demo/libmqttsn/src/paho.mqtt-sn.embedded-c/MQTTPacket/src/MQTTUnsubscribeClient.c...''' 'compile src/demo/libmqttsn/src/paho.mqtt-sn.embedded-c/MQTTPacket/src/MQTTDeserializePublish.c...''' 'compile src/demo/libmqttsn/src/paho.mqtt-sn.embedded-c/MQTTPacket/src/MQTTSubscribeClient.c...''' 'compile src/demo/libmqttsn/src/paho.mqtt-sn.embedded-c/MQTTPacket/src/MQTTFormat.c...''' 'compile src/demo/libmqttsn/src/paho.mqtt-sn.embedded-c/MQTTPacket/src/MQTTSerializePublish.c...''' 'compile src/demo/libmqttsn/src/paho.mqtt-sn.embedded-c/MQTTPacket/src/MQTTPacket.c...''' 'compile src/demo/libmqttsn/src/paho.mqtt-sn.embedded-c/MQTTPacket/src/MQTTUnsubscribeServer.c...''' 'compile src/demo/libmqttsn/src/paho.mqtt-sn.embedded-c/MQTTPacket/src/MQTTConnectServer.c...''' "linking DNLM libs"
编译成功后会在firmware/DNLM目录下生成ML302_OpenCPU.pac
固件。
【遗留问题】在编译过程中出现了如下数量巨多的警告信息:
warning: prebuilt/LTE/Aisound.a(ivTTS_Ctrl.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
warning: prebuilt/LTE/Aisound.a(ivTTS_Input0.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
warning: prebuilt/LTE/Aisound.a(ivTTS_Input1.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
warning: prebuilt/LTE/Aisound.a(ivTTS_Inst.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
warning: prebuilt/LTE/Aisound.a(ivTTS_Main.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
warning: prebuilt/LTE/Aisound.a(ivTTS_Output.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
warning: prebuilt/LTE/Aisound.a(ivTTS_Progress.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail
上述警告信息并不影响固件的生成,暂未找到解决方案。
执行build.bat CLEAN
命令可清除编译结果。
模组支持串口和USB两种方式烧录固件。模组的97、98脚为下载的串口。使用USB下载时,需要预先安装模组USB驱动。另外在下载固件时需要将71脚的USB_BOOT拉高至1.8V,此时模组会进入紧急下载模式。固件更新使用的工具软件是UpgradeDownload。
ML302 OpenCPU Starts Boot Cause:8 SDK VERSION:CM_ML302_OpenCPU_SDK_Release_V2.2.1 BASELINE VERSION:8910_MODULE_V1_W20.23.2_CMIOT HW VERSION:ML302-MBRH2S02-DNLM waiting for network... network ready Now:2021-4-2:17:19:18 IMEI:863293051715412 IMSI:460113344457805 ICCID:89861120258034835759 OneNet FOTA version:1.2 please input cmds:
或者选择Unisoc Usb Serial Port 0所对应的串口号,波特率设置为115200,发送AT命令AT+CGMR
,若串口返回版本信息则说明固件烧录成功。
上述两种方式都能确定固件升级是否成功。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。