wanghechen 281cc91e4d 2023.12.25出货版本 | 10 months ago | |
---|---|---|
.. | ||
main | 10 months ago | |
rsa_key | 10 months ago | |
CMakeLists.txt | 10 months ago | |
README.md | 10 months ago | |
README_CN.md | 10 months ago | |
partitions.csv | 10 months ago | |
sdkconfig.ci.bluedroid | 10 months ago | |
sdkconfig.ci.nimble | 10 months ago | |
sdkconfig.defaults | 10 months ago |
ble ota demo
is based on the ble ota component
, it receives firmware via BLE and writes it to flash, sector by sector, until the upgrade is complete.
The component contains two services:
DIS Service
: Displays software and hardware version informationOTA Service
: It is used for OTA upgrade and contains 4 characteristics, as shown in the following table:Characteristics | UUID | Prop | description |
---|---|---|---|
RECV_FW_CHAR | 0x8020 | Write, notify | Firmware received, send ACK |
PROGRESS_BAR_CHAR | 0x8021 | Read, notify | Read the progress bar and report the progress bar |
COMMAND_CHAR | 0x8022 | Write, notify | Send the command and ACK |
CUSTOMER_CHAR | 0x8023 | Write, notify | User-defined data to send and receive |
unit | Command_ID | PayLoad | CRC16 |
---|---|---|---|
Byte | Byte: 0 ~ 1 | Byte: 2 ~ 17 | Byte: 18 ~ 19 |
Command_ID:
The format of the firmware package sent by the client is as follows:
unit | Sector_Index | Packet_Seq | PayLoad |
---|---|---|---|
Byte | Byte: 0 ~ 1 | Byte: 2 | Byte: 3 ~ (MTU_size - 4) |
The format of the reply packet is as follows:
unit | Sector_Index | ACK_Status | CRC6 |
---|---|---|---|
Byte | Byte: 0 ~ 1 | Byte: 2 ~ 3 | Byte: 18 ~ 19 |
ACK_Status:
To construct the BLE OTA demo for the ESP32-H2 device, ensure you're using ESP-IDF version 5.0 or later. Currently, the ESP32-H2 doesn't support NimBLE OTA updates, so omit the instructions in section 5. Maintain the default configuration for the Bluetooth framework, where Bluedroid - Dual-mode
is selected. To ensure compatibility with the sample app mentioned in section 3, deactivate BLE 5.0 features by navigating to:
Component config
> Bluetooth
> Bluedroid Options
and deselect Enable BLE 5.0 features
.Component config
> Bluetooth
> Controller Options
and deselect Enable BLE 5 feature
.idf.py menuconfig
Note: For maximum throughput, set maximum MTU using
idf.py menuconfig
idf.py menuconfig