Skip to content

Commit f83eff6

Browse files
committed
example/thread_border_router: add ota function for otbr example
1 parent 2355709 commit f83eff6

File tree

5 files changed

+74
-13
lines changed

5 files changed

+74
-13
lines changed

examples/thread_border_router/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ $ idf.py set-target esp32h2 build
3131

3232
After flashing the Thread Border Router firmware to ESP32-S3, it will flash the RCP firmware to ESP32-H2 automatically.
3333

34+
### 1.3 Firmware for Host SoC
35+
36+
The default setting flash size is 8MB, set target and build as below:
37+
38+
```
39+
$ idf.py set-target esp32s3
40+
$ idf.py build
41+
```
42+
3443
## 2. Post Commissioning Setup
3544

3645
After commissioning the Border Router with chip-tool, you can set up the Thread network with ThreadBorderRouterManagement cluster.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
idf_component_register(SRC_DIRS "."
2-
INCLUDE_DIRS ".")
2+
INCLUDE_DIRS "."
3+
LDFRAGMENTS "linker.lf")
34

45
set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17)
56
target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H")
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[mapping:CHIP]
2+
archive: libCHIP.a
3+
entries:
4+
if SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY = y:
5+
* (extram_bss)
6+
else:
7+
* (default)
8+
9+
[mapping:esp_matter]
10+
archive: libesp_matter.a
11+
entries:
12+
if SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY = y:
13+
* (extram_bss)
14+
else:
15+
* (default)
16+
17+
[mapping:main]
18+
archive: libmain.a
19+
entries:
20+
if SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY = y:
21+
* (extram_bss)
22+
else:
23+
* (default)
24+
25+
[mapping:openthread_bss]
26+
archive: libopenthread.a
27+
entries:
28+
if SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY = y && OPENTHREAD_ENABLED = y:
29+
* (extram_bss)
30+
else:
31+
* (default)
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
# Name, Type, SubType, Offset, Size, Flags
2-
# Note: Firmware partition offset needs to be 64K aligned, initial 36K (9 sectors) are reserved for bootloader and partition table
3-
nvs, data, nvs, , 0xA000,
4-
phy_init, data, phy, , 0x1000,
5-
factory, app, factory, , 3000K,
6-
rcp_fw, data, spiffs, , 600K,
1+
# Name, Type, SubType, Offset, Size, Flags
2+
# Note: Firmware partition offset needs to be 64K aligned, initial 36K (9 sectors) are reserved for bootloader and partition table,,,,
3+
esp_secure_cert,0x3F,, 0xd000, 0x2000, encrypted
4+
nvs, data, nvs, 0x10000, 0xC000,
5+
nvs_keys, data, nvs_keys,0x1C000, 0x1000, encrypted
6+
otadata, data, ota, 0x1D000, 0x2000,
7+
phy_init, data, phy, 0x1F000, 0x1000,
8+
ota_0, app, ota_0, 0x20000, 0x250000,
9+
ota_1, app, ota_1, 0x270000, 0x250000,
10+
rcp_fw, data, spiffs, 0x4C0000, 0xA0000,
11+
fctry, data, nvs, 0x560000, 0x6000
12+

examples/thread_border_router/sdkconfig.defaults

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
1+
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
22

33
#enable BT
44
CONFIG_BT_ENABLED=y
@@ -14,6 +14,7 @@ CONFIG_CHIP_TASK_STACK_SIZE=10240
1414

1515
# partition table
1616
CONFIG_PARTITION_TABLE_CUSTOM=y
17+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
1718

1819
# USB console for Thread border board
1920
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
@@ -49,12 +50,25 @@ CONFIG_OPENTHREAD_SRP_CLIENT=n
4950
CONFIG_OPENTHREAD_DNS_CLIENT=n
5051
CONFIG_OPENTHREAD_BORDER_ROUTER=y
5152
CONFIG_THREAD_NETWORK_COMMISSIONING_DRIVER=n
53+
CONFIG_AUTO_UPDATE_RCP=y
54+
55+
#Enable chip shell
56+
CONFIG_ENABLE_CHIP_SHELL=y
57+
58+
# Matter OTA
59+
CONFIG_ENABLE_OTA_REQUESTOR=y
5260

5361
# Use platform mDNS
5462
CONFIG_USE_MINIMAL_MDNS=n
5563

56-
# Enable Matter shell
57-
CONFIG_ENABLE_CHIP_SHELL=y
58-
CONFIG_ESP_MATTER_CONSOLE_TASK_STACK=4096
59-
60-
CONFIG_AUTO_UPDATE_RCP=y
64+
# Use SPIRAM and external alloc
65+
CONFIG_SPIRAM=y
66+
CONFIG_SPIRAM_SPEED_80M=y
67+
CONFIG_SPIRAM_MODE_QUAD=y
68+
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=512
69+
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=16384
70+
CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y
71+
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
72+
CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL=y
73+
CONFIG_ESP_MATTER_MEM_ALLOC_MODE_EXTERNAL=y
74+
CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC=y

0 commit comments

Comments
 (0)