# yuge_cat1_opencpu **Repository Path**: makeval/yugecat1opencpu ## Basic Information - **Project Name**: yuge_cat1_opencpu - **Description**: 域格CAT1模块通用opencpu - **Primary Language**: C - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 5 - **Created**: 2024-09-26 - **Last Updated**: 2024-09-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 结构 1. core: OpenCPU code library,header 2. doc: document for SDK 3. sample: API sample 4. tools: makefile tool, compiler tool 5. build.bat: build command 6. readme.md: sdk说明 7. ReleaseNotes.txt: sdk更新记录,【着重关注】! ### 编译 1. 编译链:gcc-arm-none-eabi a). 下载地址: https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-win32.zip b). 解压到tools目录下,并修改文件夹名为"gcc-arm-none-eabi" c). gcc-arm-none-eabi 里面的 "gcc-arm-none-eabi\arm-none-eabi\include\sys\select.h" 需要被 disable 掉,关于 select 相关的 api 见"core\inc\lwip\sockets.h" 文件第11行改成 "#if 0" //# if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) #if 0 2. 根目录下使用以下脚本编译 1.1-os_Task_Management: a). 编译 > build.bat -c 1602c -autopkg HV9 sample\1.1-os_Task_Management b). 清空编译 > build.bat -c 1602c -autopkg HV9 sample\1.1-os_Task_Management clean 备注1:"-c",用于指定芯片型号,:1602c、1602s、1606l、1606c、1606s 备注2:"-autopkg",用于指定自动打包的模块型号:HV9、HE9EA、HE9EU、HE9NA、HV9V2、HV9G、HV9B、CV9、LV9、MV9 ### 调试日志打印 1. 调试日志输出到 调试串口 修改makefile,定义"__LOG_UART__",详见各个demo目录下的makefile 2. 调试日志输出到 CATStudio 修改makefile,定义"__LOG_ACAT__",详见各个demo目录下的makefile CATStudio 查看日志详见 doc/《SDK注意事项.doc》 CATStudio 加载固件对应的 "MDB.txt", 文件路径:tools\aboot\images\prebuilt\cp_160xx ### 固件打包 1. 手动打包 --如果编译不带 "-autopkg" 参数的话,需要手动打包 a). 打开tools\aboot\aboot.exe,切换到 Release 界面; b). 使用编译生成的 "out\app.bin", 替换目录 "tools\aboot\images" 下的app.bin; c). 根据使用模块选择对应项目后点击Release,即会再aboot根目录下生成对应的固件包。 2. 自动打包 --如果编译带 "-autopkg" 参数的话,会自动打包 编译时使用 "-autopkg" 指定模块型号,编译结束后会自动打包固件,并生成在out目录下。 ### 固件下载 1. 软件下载 a). 打开tools\aboot\aboot.exe,切换到 Download 界面; b). Download界面选择固件包,点击start,等待烧录下载; c). 重启模块或者使用指令"AT$MYDOWNLOAD=1"使模块自动进入下载模式,即可通过USB进行下载。 2. 注意事项 a). Download界面不要勾选“Production mode”,勾选后烧录会擦除模块内IMEI、SN、以及射频校准参数。 ### 用户指南 1. App available memory For 1602c (4MB RAM + 2MB Flash) version product, ROM:180KB, RAM:256KB For 1602s (4MB RAM + 4MB Flash) version product, ROM:256KB, RAM:512KB // 最大ROM:512KB, RAM:1024KB, 详见tools\aboot\images\prebuilt\readme.txt For 1606l (4MB RAM + 2MB Flash) version product, ROM:160KB, RAM:256KB For 1606c (4MB RAM + 4MB Flash) version product, ROM:180KB, RAM:320KB // 默认支持volte,ram可用空间偏少 For 1606s (8MB RAM + 8MB Flash) version product, ROM:512KB, RAM:1024KB 备注:关于各类型芯片默认版本支持功能,以及02MB模块需要支持rndis网卡等,详见 tools/aboot/images/prebuilt/readme.txt 2. C LIB By enable USE_LIBC=yes in Makefile, app can call C standard LIB API except memory management API, malloc()/free() is always available and called from system side. If enable LIBC, the final binary is bigger. note: if USE_LIBC=yes is enabled, USE_NANO=yes should enabled together. 3. Startup main() is the entry of app, it is called at system boot in a separate task, the task name is "sdkapp", priority is 150, stack is 16KB. After main() return, the "sdkapp" task will exit. Usually, app should create it's own task. ### API introduce 1. OS API API define: os_api.h API sample: sample\1.1-os_Task_Management API sample: sample\1.2-os_Event_Flags API sample: sample\1.3-os_Semaphores API sample: sample\1.4-os_Mutexes API sample: sample\1.5-os_Message_Queues API sample: sample\1.6-os_Timers API sample: sample\1.7-os_sleep_delay 2. File API API define: file_api.h API sample: sample\5.7-app_File 3. ATCmd API API define: atclient.h API sample: sample\3.1-at_Cmds 4. HW API, include GPIO,UART,i2c,spi,pwm API define: hal\gpio.h hal\uart.h API sample: sample\4.x=hal_xxx 5. BSD style socket API API define: lwip\sockets.h API sample: sample\5.1-app_Socket