富芮坤进行OTA升级
下载官方SDK
进入链接即可下载官方例程:FR8000官方SDK
代码修改
打开工程下的ble_simple_peripheral例程,路径如下:fr8000\examples\none_evm\ble_simple_peripheral\keil
在profiles文件夹下添加ota.c与ota_service.c两个文件,文件路径如下:fr8000\components\ble\profiles\ble_ota,可将文件复制到当前工程code路径下进行添加
需注意proj_main.c文件下的代码:
1
2
3
4
5const struct jump_table_image_t _jump_table_image __attribute__((section("jump_table_1"))) =
{
.image_type = IMAGE_TYPE_APP,
.image_size = 0x19000,
};
其中.image_size代表的是编译固件大小,需根据当前固件大小进行更改
在初始化中添加OTA服务即可,代码如下:
1
2
3
4
5
6
7
8
9
10
void proj_init(void)
{
LOG_INFO(app_tag, "BLE Peripheral\r\n");
// Application layer initialization, can included bond manager init,
// advertising parameters init, scanning parameter init, GATT service adding, etc.
simple_peripheral_init();
ota_gatt_add_service();
}
如上,即可完成富芮坤蓝牙芯片的OTA升级功能,使用官方的OTA app(BLE OTA)即可进行OTA升级。