|
|
1 năm trước cách đây | |
|---|---|---|
| .. | ||
| main | 1 năm trước cách đây | |
| rsa_key | 1 năm trước cách đây | |
| CMakeLists.txt | 1 năm trước cách đây | |
| README.md | 1 năm trước cách đây | |
| README_CN.md | 1 năm trước cách đây | |
| partitions.csv | 1 năm trước cách đây | |
| sdkconfig.ci.bluedroid | 1 năm trước cách đây | |
| sdkconfig.ci.nimble | 1 năm trước cách đây | |
| sdkconfig.defaults | 1 năm trước cách đây | |
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