移远EC800M OpenCPU笔记 - threadX RTOS系统
EC800M 编译SDK
E:\esim\EC800M\ql-sdk>build.bat app -- 编译APP镜像(application)
E:\esim\EC800M\ql-sdk>build.bat firmware -- 生成固件
E:\esim\EC800M\ql-sdk>build.bat kernel -- 编译kernel(可选)
E:\esim\EC800M\ql-sdk>build.bat bootloader -- 编译bootloader(可选)
build_all.bat -- 提供整体编译的功能
build.bat kernel/bootloader/app clean -- 清除命令
固件包地址:

示例helloworld

E:\esim\ql-sdk\ql-application\threadx\interface\example\helloworld.c
#include "ql_application.h" #include "ql_uart.h" #include <stdarg.h> int print_bearpi_uart(const char *fmt, ...) { va_list args; int i; int count; char printk_buf[1024]; memset(printk_buf, 0, sizeof(printk_buf)); va_start(args, fmt); count = vsnprintf(printk_buf, sizeof(printk_buf), fmt, args); printk_buf[count] = 0; ql_uart_write(QL_USB_CDC_PORT, (uint8_t *)printk_buf, strlen(printk_buf)); va_end(args); return count; } #define printf(fmt, args...) print_bearpi_uart(fmt, ##args) static void helloworld(void * argv) { while(1) { printf("Hello,world!\r\n"); ql_rtos_task_sleep_s(1); } } application_init(helloworld, "helloworld", 1, 0);
E:\esim\ql-sdk\ql-application\threadx\interface\example\Makefile
#------------------------------------------------------------------------------- # Configure variable #------------------------------------------------------------------------------- TOP_DIR:=$(TOP_DIR) ROOT_DIR:=$(TOP_DIR)/../.. MAKEFILE_PATH :=$(subst $(strip \),/,$(abspath $(lastword $(MAKEFILE_LIST)))) #------------------------------------------------------------------------------- # Configure source code files #------------------------------------------------------------------------------- SRC_FILES+= \ helloworld.c \ #------------------------------------------------------------------------------- # the include directories #------------------------------------------------------------------------------- INC_DIRS+= \ -I${TOP_DIR}/ \ -I${TOP_DIR}/common/include \ #------------------------------------------------------------------------------- # Configure compile flag for C #------------------------------------------------------------------------------- U_FLAGS:= #------------------------------------------------------------------------------- # Configure compile flag for C++ #------------------------------------------------------------------------------- U_CPPFLAGS:= #------------------------------------------------------------------------------- # Configure default macro define #------------------------------------------------------------------------------- DFLAGS+= \ -D__TM_ZONE=tm_zone \ -D__TM_GMTOFF=tm_gmtoff \ -D_POSIX_THREADS \ #------------------------------------------------------------------------------- # Configure link library #------------------------------------------------------------------------------- U_LIBS:= #------------------------------------------------------------------------------- # include mk file #------------------------------------------------------------------------------- include ${TOP_DIR}/config/common/makefile.mk
E:\esim\ql-sdk\ql-application\threadx\Makefile
#------------------------------------------------------------------------------- # Configure variable #------------------------------------------------------------------------------- ifneq (${TOP_DIR},) TOP_DIR:=${TOP_DIR} else TOP_DIR:=${CURDIR} endif #------------------------------------------------------------------------------- # Configure compile directories #------------------------------------------------------------------------------- COMMPILE_DIRS:= \ interface/posix \ interface/wifi \ interface/log/src \ interface/example \ #------------------------------------------------------------------------------- # Configure default libarays #------------------------------------------------------------------------------- DEFAULT_LIBS+= \ common/lib/ql_common_api.lib \ common/lib/com_cell_locator.lib \ common/lib/com_ftp.lib \ common/lib/com_http.lib \ common/lib/com_mbedtls.lib \ common/lib/com_paho_mqtt.lib \ common/lib/com_ssl.lib \ #------------------------------------------------------------------------------- # include mk file #------------------------------------------------------------------------------- include ${TOP_DIR}/config/common/makefile.mk
使用Aboot工具进行下载

或者

烧录过程中,可能需要断电重启





qq:505645074

浙公网安备 33010602011771号