Skip to content

Commit bb6d92f

Browse files
[ESP32]: Fixed the lighting-app build with external platform enabled. (project-chip#38070)
* [ESP32]: Fixed the lighting-app external platform build * Move the external platform example CI build to regular CI builds * Fix the external platform failure for BLEManagerImpl
1 parent ef66cd8 commit bb6d92f

File tree

5 files changed

+47
-17
lines changed

5 files changed

+47
-17
lines changed

.github/workflows/examples-esp32.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ jobs:
119119
- name: Build example Lighting App (Target:ESP32C6)
120120
run: scripts/examples/esp_example.sh lighting-app sdkconfig.wifi_thread.defaults esp32c6
121121

122+
- name: Build example Lighting App (external platform)
123+
run: scripts/examples/esp_example.sh lighting-app sdkconfig.ext_plat.defaults
124+
122125
- name: Uploading Size Reports
123126
uses: ./.github/actions/upload-size-reports
124127
if: ${{ !env.ACT }}
@@ -165,9 +168,6 @@ jobs:
165168
- name: Build example Light Switch App (Target:ESP32C3)
166169
run: scripts/examples/esp_example.sh light-switch-app sdkconfig.defaults esp32c3
167170

168-
- name: Build example Lighting App (external platform)
169-
run: scripts/examples/esp_example.sh lighting-app sdkconfig.ext_plat.defaults
170-
171171
- name: Build example Energy Gateway App
172172
run: scripts/examples/esp_example.sh energy-gateway-app sdkconfig.defaults
173173

examples/platform/esp32/external_platform/ESP32_custom/BUILD.gn

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import("//build_overrides/chip.gni")
1616

1717
import("${chip_root}/build/chip/buildconfig_header.gni")
18+
import("${chip_root}/src/lib/core/core.gni")
1819
import("${chip_root}/src/platform/device.gni")
1920

2021
declare_args() {
@@ -24,11 +25,13 @@ declare_args() {
2425
chip_use_factory_data_provider = false
2526
chip_use_device_info_provider = false
2627
chip_config_software_version_number = 0
27-
chip_enable_chipoble = true
28-
chip_bt_nimble_enabled = true
29-
chip_bt_bluedroid_enabled = true
28+
chip_enable_chipoble = false
29+
chip_bt_nimble_enabled = false
30+
chip_bt_bluedroid_enabled = false
3031
chip_max_discovered_ip_addresses = 5
32+
chip_enable_ble_controller = false
3133
chip_enable_route_hook = false
34+
chip_memory_alloc_mode = "default"
3235
}
3336

3437
buildconfig_header("custom_buildconfig") {
@@ -48,6 +51,7 @@ buildconfig_header("custom_buildconfig") {
4851
"CHIP_DEVICE_LAYER_TARGET_ESP32=1",
4952
"CHIP_DEVICE_LAYER_TARGET=ESP32_custom",
5053
"CHIP_USE_TRANSITIONAL_COMMISSIONABLE_DATA_PROVIDER=1",
54+
"CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=${chip_enable_chipoble}",
5155
"BLE_PLATFORM_CONFIG_INCLUDE=<external_platform/ESP32_custom/BlePlatformConfig.h>",
5256
"CHIP_DEVICE_PLATFORM_CONFIG_INCLUDE=<external_platform/ESP32_custom/CHIPDevicePlatformConfig.h>",
5357
"CHIP_PLATFORM_CONFIG_INCLUDE=<external_platform/ESP32_custom/CHIPPlatformConfig.h>",
@@ -110,23 +114,46 @@ static_library("ESP32_custom") {
110114
"${chip_root}/src/platform:platform_base",
111115
]
112116

113-
if (chip_enable_ota_requestor) {
114-
sources += [
115-
"OTAImageProcessorImpl.cpp",
116-
"OTAImageProcessorImpl.h",
117-
]
117+
if (chip_config_memory_management == "platform") {
118+
if (chip_memory_alloc_mode == "internal") {
119+
sources += [ "CHIPMem-PlatformInternal.cpp" ]
120+
} else if (chip_memory_alloc_mode == "external") {
121+
sources += [ "CHIPMem-PlatformExternal.cpp" ]
122+
} else {
123+
sources += [ "CHIPMem-PlatformDefault.cpp" ]
124+
}
118125
}
119126

120-
if (chip_enable_chipoble) {
127+
if (chip_enable_ble) {
121128
sources += [ "BLEManagerImpl.h" ]
122-
}
129+
if (chip_enable_ble_controller) {
130+
sources += [ "ChipDeviceScanner.h" ]
131+
}
123132

124-
if (chip_bt_nimble_enabled) {
125-
sources += [ "nimble/BLEManagerImpl.cpp" ]
133+
if (chip_bt_nimble_enabled) {
134+
sources += [ "nimble/BLEManagerImpl.cpp" ]
135+
if (chip_enable_ble_controller) {
136+
sources += [
137+
"nimble/ChipDeviceScanner.cpp",
138+
"nimble/blecent.h",
139+
"nimble/misc.c",
140+
"nimble/peer.c",
141+
]
142+
}
143+
}
144+
if (chip_bt_bluedroid_enabled) {
145+
sources += [ "bluedroid/BLEManagerImpl.cpp" ]
146+
if (chip_enable_ble_controller) {
147+
sources += [ "bluedroid/ChipDeviceScanner.cpp" ]
148+
}
149+
}
126150
}
127151

128-
if (chip_bt_bluedroid_enabled) {
129-
sources += [ "bluedroid/BLEManagerImpl.cpp" ]
152+
if (chip_enable_ota_requestor) {
153+
sources += [
154+
"OTAImageProcessorImpl.cpp",
155+
"OTAImageProcessorImpl.h",
156+
]
130157
}
131158

132159
if (chip_enable_wifi) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../src/platform/ESP32/CHIPMem-PlatformDefault.cpp
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../src/platform/ESP32/CHIPMem-PlatformExternal.cpp
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../src/platform/ESP32/CHIPMem-PlatformInternal.cpp

0 commit comments

Comments
 (0)