Skip to content

Commit 6563380

Browse files
committed
Merge branch 'feature/add_c61_support_on_bootloader_plus' into 'master'
feat: add c61 support on bootloader plus Closes AEG-2775 and AEG-2782 See merge request ae_group/esp-iot-solution!1369
2 parents e507029 + fd2d69e commit 6563380

File tree

12 files changed

+76
-31
lines changed

12 files changed

+76
-31
lines changed

.gitlab/ci/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,10 @@ build_example_ota_simple_ota_example:
690690
matrix:
691691
- IMAGE: espressif/idf:release-v5.0
692692
- IMAGE: espressif/idf:release-v5.1
693+
- IMAGE: espressif/idf:release-v5.2
694+
- IMAGE: espressif/idf:release-v5.3
695+
- IMAGE: espressif/idf:release-v5.4
696+
- IMAGE: espressif/idf:release-v5.5
693697
variables:
694698
EXAMPLE_DIR: examples/ota/simple_ota_example
695699
WARNING_STR: "1/2 app partitions are too small"

components/bootloader_support_plus/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# ChangeLog
22

3+
## v0.4.0 - 2025-09-08
4+
5+
### Improve:
6+
7+
- Add ESP32-C61 and ESP32-S3 support.
8+
39
## v0.3.9 - 2025-06-17
410

511
### Improve:

components/bootloader_support_plus/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
## Overview
88
The `bootloader support plus` is an enhanced bootloader based on [custom_bootloader](https://github.com/espressif/esp-idf/tree/master/examples/custom_bootloader) . The firmware update function is supported in the bootloader stage by decompressing the compressed firmware. In this solution, you can directly use the original OTA APIs (such as [esp_ota](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/ota.html#api-reference)[esp_https_ota](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/esp_https_ota.html#api-reference)). The following table shows the Espressif SoCs that are compatible with `bootloader support plus` and their corresponding ESP-IDF versions.
99

10-
| Chip | ESP-IDF Release/v5.0 | ESP-IDF Release/v5.1 | ESP-IDF Release/v5.4+ |
11-
| -------- | ------------------------------------------------------------ | ------------------------------------------------------------ |------------------------------ |
12-
| ESP32 | Supported | Supported | Supported |
13-
| ESP32-C2 | Supported | Supported | Supported |
14-
| ESP32-C3 | Supported | Supported | Supported |
15-
| ESP32-C5 | N/A | N/A | Supported |
16-
| ESP32-C6 | N/A | Supported | Supported |
17-
| ESP32-H2 | N/A | Supported | Supported |
10+
| Chip | ESP-IDF Release/v5.0 | ESP-IDF Release/v5.1 | ESP-IDF Release/v5.4+ | ESP-IDF Release/v5.5+ |
11+
| -------- | ------------------------------------------------------------ | ------------------------------------------------------------ |------------------------------ |------------------------------ |
12+
| ESP32 | Supported | Supported | Supported | Supported |
13+
| ESP32-S3 | N/A | Supported | Supported | Supported |
14+
| ESP32-C2 | Supported | Supported | Supported | Supported |
15+
| ESP32-C3 | Supported | Supported | Supported | Supported |
16+
| ESP32-C5 | N/A | N/A | Supported | Supported |
17+
| ESP32-C6 | N/A | Supported | Supported | Supported |
18+
| ESP32-H2 | N/A | Supported | Supported | Supported |
19+
| ESP32-C61 | N/A | N/A | N/A | Supported |
1820

1921
## Compression ratio
2022

components/bootloader_support_plus/README_CN.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
## 概述
88
bootloader support plus 是乐鑫基于 [ESP-IDF](https://github.com/espressif/esp-idf)[custom_bootloader](https://github.com/espressif/esp-idf/tree/master/examples/custom_bootloader) 推出的增强版 bootloader,支持在 bootloader 阶段对`压缩`的固件进行 `解压缩`,来升级原有固件。在该方案中,您可以直接使用 ESP-IDF 中原生的 OTA 接口(比如 [esp_ota](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/ota.html#api-reference)[esp_https_ota](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/esp_https_ota.html#api-reference))。下表总结了适配 `bootloader support plus` 的乐鑫芯片以及其对应的 ESP-IDF 版本:
99

10-
| Chip | ESP-IDF Release/v5.0 | ESP-IDF Release/v5.1 | ESP-IDF Release/v5.4+ |
11-
| -------- | ------------------------------------------------------------ | ------------------------------------------------------------ |------------------------------ |
12-
| ESP32 | Supported | Supported | Supported |
13-
| ESP32-C2 | Supported | Supported | Supported |
14-
| ESP32-C3 | Supported | Supported | Supported |
15-
| ESP32-C5 | N/A | N/A | Supported |
16-
| ESP32-C6 | N/A | Supported | Supported |
17-
| ESP32-H2 | N/A | Supported | Supported |
10+
| Chip | ESP-IDF Release/v5.0 | ESP-IDF Release/v5.1 | ESP-IDF Release/v5.4+ | ESP-IDF Release/v5.5+ |
11+
| -------- | ------------------------------------------------------------ | ------------------------------------------------------------ |------------------------------ |----------------------------- |
12+
| ESP32 | Supported | Supported | Supported | Supported |
13+
| ESP32-S3 | N/A | Supported | Supported | Supported |
14+
| ESP32-C2 | Supported | Supported | Supported | Supported |
15+
| ESP32-C3 | Supported | Supported | Supported | Supported |
16+
| ESP32-C5 | N/A | N/A | Supported | Supported |
17+
| ESP32-C6 | N/A | Supported | Supported | Supported |
18+
| ESP32-H2 | N/A | Supported | Supported | Supported |
19+
| ESP32-C61 | N/A | N/A | N/A | Supported |
1820

1921
## 压缩率
2022

components/bootloader_support_plus/idf_component.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
version: "0.3.9"
1+
version: "0.4.0"
22
targets:
33
- esp32c2
44
- esp32c3
55
- esp32c5
66
- esp32c6
7+
- esp32c61
78
- esp32
9+
- esp32s3
810
- esp32h2
911
description: Provide extra bootloader support, now support upgrading the firmware by decompressing the OTA firmware in the bootloader stage.
1012
url: https://github.com/espressif/esp-iot-solution/tree/master/components/bootloader_support_plus
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
MEMORY
2+
{
3+
iram_loader1_seg (RWX) : org = 0x4084A000, len = 0x6000
4+
}
5+
6+
SECTIONS
7+
{
8+
.xz :
9+
{
10+
. = ALIGN(4);
11+
*libbootloader_support_plus.a:(.literal .text .literal.* .text.*)
12+
*libespressif__bootloader_support_plus.a:(.literal .text .literal.* .text.*)
13+
*libespressif__xz.a:(.literal .text .literal.* .text.*)
14+
*libxz.a:(.literal .text .literal.* .text.*)
15+
} > iram_loader1_seg
16+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SECTIONS
2+
{
3+
.xz :
4+
{
5+
. = ALIGN(4);
6+
*libbootloader_support_plus.a:(.literal .text .literal.* .text.*)
7+
*libespressif__bootloader_support_plus.a:(.literal .text .literal.* .text.*)
8+
*libespressif__xz.a:(.literal .text .literal.* .text.*)
9+
*libxz.a:(.literal .text .literal.* .text.*)
10+
} > iram_loader_seg
11+
}

components/bootloader_support_plus/private_include/bootloader_custom_utility.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@
1010
#include "bootloader_utility.h"
1111
#include "bootloader_custom_ota.h"
1212

13+
#ifdef CONFIG_BOOTLOADER_WDT_ENABLE
14+
#include "hal/wdt_hal.h"
15+
#if !defined(RWDT_HAL_CONTEXT_DEFAULT)
16+
#if CONFIG_IDF_TARGET_ESP32H2
17+
#define RWDT_HAL_CONTEXT_DEFAULT() {.inst = WDT_RWDT, .rwdt_dev = &LP_WDT}
18+
#else
19+
#define RWDT_HAL_CONTEXT_DEFAULT() {.inst = WDT_RWDT, .rwdt_dev = &RTCCNTL}
20+
#endif
21+
#endif // RWDT_HAL_CONTEXT_DEFAULT
22+
#endif
23+
1324
#ifdef __cplusplus
1425
extern "C" {
1526
#endif

components/bootloader_support_plus/src/bootloader_custom_ota.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,8 @@ int bootloader_custom_ota_main(bootloader_state_t *bs, int boot_index)
225225
so we can know whether the watchdog reset will be triggered here at the test stage.
226226
*/
227227
#ifdef CONFIG_BOOTLOADER_WDT_ENABLE
228-
#if (defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C5))
229228
wdt_hal_context_t rtc_wdt_ctx = RWDT_HAL_CONTEXT_DEFAULT();
230-
#elif CONFIG_IDF_TARGET_ESP32H2
231-
wdt_hal_context_t rtc_wdt_ctx = {.inst = WDT_RWDT, .rwdt_dev = &LP_WDT};
232-
#else
233-
wdt_hal_context_t rtc_wdt_ctx = {.inst = WDT_RWDT, .rwdt_dev = &RTCCNTL};
234-
#endif
229+
235230
if ((custom_ota_config.dst_addr % FLASH_SECTOR_SIZE) != 0 || (custom_ota_config.dst_size % FLASH_SECTOR_SIZE != 0)) {
236231
return ESP_ERR_INVALID_SIZE;
237232
}

components/bootloader_support_plus/src/bootloader_storage_flash.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
#include "bootloader_custom_malloc.h" // Note, this header is just used to provide malloc() and free() support.
1515

1616
#ifdef CONFIG_BOOTLOADER_WDT_ENABLE
17-
#include "hal/wdt_hal.h"
18-
#if (ESP_IDF_VERSION_MAJOR == 5) && (ESP_IDF_VERSION_MINOR >= 1)
1917
static wdt_hal_context_t rtc_wdt_ctx = RWDT_HAL_CONTEXT_DEFAULT();
20-
#else
21-
static wdt_hal_context_t rtc_wdt_ctx = {.inst = WDT_RWDT, .rwdt_dev = &RTCCNTL};
22-
#endif // ESP_IDF_VERSION_MAJOR
2318
static bool rtc_wdt_ctx_enabled = false;
2419
#endif
2520

0 commit comments

Comments
 (0)