CH573F的MESH例程如何改成OTA第二种方式?

按照 https://www.cnblogs.com/debugdabiaoge/p/15975537.html 的方法,普通例程(如BLE_UART)可以成功改成OTA第二种方式。但是按照同样的方法修改adv_vendor_self_provision_with_peripheral例程时,却提示有些库函数找不到。

图片.png

请问如何才能修改成功?

“OTA第二种方式”是不带库升级吗,操作的时候是合成了4个hex文件吗。默认例程就是不带库的方式,不用作修改,合成bin文件烧录即可。


就是这里的方式二:

图片.png

默认的例程都是带库的吧?不是要按照 https://www.cnblogs.com/debugdabiaoge/p/15975537.html 的方法修改吗?


现在还没到合成4个文件那一步,是编译都通不过,提示错误:

e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: F:\项目\蓝牙\CH573EVT-V2.0-2022.07.15\EXAM\BLE\MESH\MESH_LIB\libMESH.a(mesh_adapt.o): in function `k_uptime_get_32':
mesh_adapt.c:(.text.k_uptime_get_32+0x4): undefined reference to `TMOS_GetSystemClock'
e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: F:\项目\蓝牙\CH573EVT-V2.0-2022.07.15\EXAM\BLE\MESH\MESH_LIB\libMESH.a(mesh_adapt.o): in function `bt_mesh_gatt_get_mtu':
mesh_adapt.c:(.text.bt_mesh_gatt_get_mtu+0x4): undefined reference to `ATT_GetMTU'
e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: F:\项目\蓝牙\CH573EVT-V2.0-2022.07.15\EXAM\BLE\MESH\MESH_LIB\libMESH.a(mesh_adapt.o): in function `bt_mesh_gatts_disconnect':
mesh_adapt.c:(.text.bt_mesh_gatts_disconnect+0x4): undefined reference to `GAPRole_TerminateLink'
e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: F:\项目\蓝牙\CH573EVT-V2.0-2022.07.15\EXAM\BLE\MESH\MESH_LIB\libMESH.a(mesh_adapt.o): in function `.L0 ':
mesh_adapt.c:(.text.bt_mesh_prov_servive_cccd_close+0xc): undefined reference to `GATTServApp_InitCharCfg'
e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: mesh_adapt.c:(.text.bt_mesh_prov_service_stop+0xe): undefined reference to `GATTServApp_DeregisterService'
e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: mesh_adapt.c:(.text.bt_mesh_proxy_service_cccd_close+0xc): undefined reference to `GATTServApp_InitCharCfg'
e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: mesh_adapt.c:(.text.bt_mesh_gatts_service_stop+0xe): undefined reference to `GATTServApp_DeregisterService'
e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: F:\项目\蓝牙\CH573EVT-V2.0-2022.07.15\EXAM\BLE\MESH\MESH_LIB\libMESH.a(mesh_adapt.o): in function `.LANCHOR5':
mesh_adapt.c:(.data.prov_attrs+0x4): undefined reference to `primaryServiceUUID'
e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: mesh_adapt.c:(.data.prov_attrs+0x14): undefined reference to `characterUUID'
e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: mesh_adapt.c:(.data.prov_attrs+0x34): undefined reference to `characterUUID'
e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: mesh_adapt.c:(.data.prov_attrs+0x54): undefined reference to `clientCharCfgUUID'
e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: F:\项目\蓝牙\CH573EVT-V2.0-2022.07.15\EXAM\BLE\MESH\MESH_LIB\libMESH.a(mesh_adapt.o): in function `.LANCHOR7':
mesh_adapt.c:(.data.proxy_attrs+0x4): undefined reference to `primaryServiceUUID'


ld文件和.s文件有做相应修改吗,下面有篇博客可以参考。

CH573 CH582蓝牙sdk实现使用固定BLE LIB - debugdabiaoge - 博客园 (cnblogs.com)

EVT中支持mesh-OTA的芯片只有582以及208,573要移植的话可以参考582那边的默认例程。582的例程是默认带有BLE功能的,但是配网是需要走BLE直连节点的,移植到573上可能会有flash或者ram不够用的情况。


看了好像是libMESH.a库的问题,你看下错误提示,是libMESH.a里面的函数找不到调用的函数。


e:/mounriver/mounriver_studio/toolchain/risc-v embedded gcc/bin/../lib/gcc/riscv-none-embed/8.2.0/../../../../riscv-none-embed/bin/ld.exe: F:\项目\蓝牙\CH573EVT-V2.0-2022.07.15\EXAM\BLE\MESH\MESH_LIB\libMESH.a(mesh_adapt.o): in function `k_uptime_get_32':
mesh_adapt.c:(.text.k_uptime_get_32+0x4): undefined reference to `TMOS_GetSystemClock'


问题可能是libMESH.a不支持CH57xBLE_ROM.h。当我去掉库LIBCH57xBLE.a,加上宏定义“CH57xBLE_ROM=1”后,libMESH.a就找不到函数了。


需求是想要用BLE进行OTA升级吗。

现在582的OTA升级是在mesh的基础上OTA升级的,是对mesh的库进行固定,提供了CH58XBLE_ROM_MESH文件,用wch mesh这个app进行升级,BLE库是和应用层一起编译的。

573不支持wch mesh的OTA,既要用mesh又要用ble,ram不够用的,所以没有提供CH57XBLE_ROM_MESH这个文件。


只有登录才能回复,可以选择微信账号登录