Skip to content

Commit 2bea9d3

Browse files
committed
feat(bsp_selector): Component for selection BSP in menuconfig
1 parent c610947 commit 2bea9d3

File tree

123 files changed

+846
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+846
-80
lines changed

.github/PULL_REQUEST_TEMPLATE/pr_template_bsp.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [ ] New BSP definitions added to [bsp_ext.py](../examples/bsp_ext.py)
1010
- [ ] BSP was added to [SquareLine](https://github.com/espressif/esp-bsp/tree/master/SquareLine/common)
1111
- [ ] BSP was added to [.pre-commit-config.yaml](.pre-commit-config.yaml) doxybook list
12+
- [ ] BSP was added to BSP Selector [Kconfig](components/bsp_selector/Kconfig) and [idf_component.yml](components/bsp_selector/idf_component.yml)
1213
- [ ] _Optional:_ Component contains unit tests
1314
- [ ] _Optional:_ BSP was added to Runner ([pytest.ini](pytest.ini), [conftest.py](conftest.py), [build-run-applications.yml](.github/workflows/build-run-applications.yml))
1415
- [ ] CI passing

.github/ci/bsp_example_update.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
2+
# SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD
33
# SPDX-License-Identifier: Apache-2.0
44

55
import os
@@ -90,6 +90,12 @@ def main():
9090

9191
manifest = load_yaml_file(example_main_yml)
9292

93+
# Try to remove BSP Selector
94+
try:
95+
del manifest['dependencies']["bsp_selector"]
96+
except KeyError:
97+
print("{}: could not remove bsp_selector".format(str(bsp_path)))
98+
9399
# Remove all BSPs
94100
for dep in list(manifest['dependencies']):
95101
if bsp_short_name(dep) in bsps:

.github/workflows/build-run-applications.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ concurrency:
3434
jobs:
3535
build:
3636
env:
37-
component_manager_ver: "2.2.*"
37+
component_manager_ver: "2.4.*"
3838
idf_build_apps_ver: "2.10.1"
3939
outputs:
4040
ignored_failure: ${{ steps.ignored-failure.outputs.failed }}

.github/workflows/upload_component.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
uses: espressif/upload-components-ci-action@v2
7070
with:
7171
components: |
72+
components/bsp_selector
7273
components/bh1750
7374
components/ds18b20
7475
components/es8311

.ignore_build_warnings.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ warning: unknown kconfig symbol 'TOUCH_SUPPRESS_DEPRECATE_WARN' assigned to*
33
warning: ignoring attribute 'section .+' because it conflicts with previous 'section .+
44
warning: #warning "This set of Touch APIs has been deprecated*
55
Warning: The smallest app partition is nearly full*
6+
warning: unknown kconfig symbol*
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
idf_component_register()
2+
3+
if(CONFIG_BSP_SELECT_NONE)
4+
message(FATAL_ERROR
5+
"No BSP selected. Please select a BSP in menuconfig (CONFIG_BSP_SELECT_*)"
6+
)
7+
endif()

components/bsp_selector/Kconfig

Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
menu "BSP Selector"
2+
3+
# Hidden variables to drive Conditional Dependencies
4+
5+
config ESP_BSP_DEVKIT
6+
int
7+
default 1 if BSP_SELECT_ESP_BSP_DEVKIT
8+
default 0
9+
10+
config ESP_BSP_GENERIC
11+
int
12+
default 1 if BSP_SELECT_ESP_BSP_GENERIC
13+
default 0
14+
15+
config ESP_WROVER_KIT
16+
int
17+
default 1 if BSP_SELECT_ESP_WROVER_KIT
18+
default 0
19+
20+
config ESP32_AZURE_IOT_KIT
21+
int
22+
default 1 if BSP_SELECT_ESP32_AZURE_IOT_KIT
23+
default 0
24+
25+
config ESP32_C3_LCDKIT
26+
int
27+
default 1 if BSP_SELECT_ESP32_C3_LCDKIT
28+
default 0
29+
30+
config ESP32_LYRAT
31+
int
32+
default 1 if BSP_SELECT_ESP32_LYRAT
33+
default 0
34+
35+
config ESP32_P4_EYE
36+
int
37+
default 1 if BSP_SELECT_ESP32_P4_EYE
38+
default 0
39+
40+
config ESP32_P4_FUNCTION_EV_BOARD
41+
int
42+
default 1 if BSP_SELECT_ESP32_P4_FUNCTION_EV_BOARD
43+
default 0
44+
45+
config ESP32_S2_KALUGA_KIT
46+
int
47+
default 1 if BSP_SELECT_ESP32_S2_KALUGA_KIT
48+
default 0
49+
50+
config ESP32_S3_EYE
51+
int
52+
default 1 if BSP_SELECT_ESP32_S3_EYE
53+
default 0
54+
55+
config ESP32_S3_KORVO_1
56+
int
57+
default 1 if BSP_SELECT_ESP32_S3_KORVO_1
58+
default 0
59+
60+
config ESP32_S3_KORVO_2
61+
int
62+
default 1 if BSP_SELECT_ESP32_S3_KORVO_2
63+
default 0
64+
65+
config ESP32_S3_LCD_EV_BOARD
66+
int
67+
default 1 if BSP_SELECT_ESP32_S3_LCD_EV_BOARD
68+
default 0
69+
70+
config ESP32_S3_USB_OTG
71+
int
72+
default 1 if BSP_SELECT_ESP32_S3_USB_OTG
73+
default 0
74+
75+
config ESP_BOX
76+
int
77+
default 1 if BSP_SELECT_ESP_BOX
78+
default 0
79+
80+
config ESP_BOX_LITE
81+
int
82+
default 1 if BSP_SELECT_ESP_BOX_LITE
83+
default 0
84+
85+
config ESP_BOX_3
86+
int
87+
default 1 if BSP_SELECT_ESP_BOX_3
88+
default 0
89+
90+
config M5_ATOM_S3
91+
int
92+
default 1 if BSP_SELECT_M5_ATOM_S3
93+
default 0
94+
95+
config M5DIAL
96+
int
97+
default 1 if BSP_SELECT_M5DIAL
98+
default 0
99+
100+
config M5STACK_CORE
101+
int
102+
default 1 if BSP_SELECT_M5STACK_CORE
103+
default 0
104+
105+
config M5STACK_CORE_2
106+
int
107+
default 1 if BSP_SELECT_M5STACK_CORE_2
108+
default 0
109+
110+
config M5STACK_CORE_S3
111+
int
112+
default 1 if BSP_SELECT_M5STACK_CORE_S3
113+
default 0
114+
115+
config M5STACK_TAB5
116+
int
117+
default 1 if BSP_SELECT_M5STACK_TAB5
118+
default 0
119+
120+
121+
choice BSP_SELECT
122+
prompt "Select BSP"
123+
default BSP_SELECT_ESP_WROVER_KIT if IDF_TARGET_ESP32
124+
default BSP_SELECT_ESP32_S2_KALUGA_KIT if IDF_TARGET_ESP32S2
125+
default BSP_SELECT_ESP_BOX_3 if IDF_TARGET_ESP32S3
126+
default BSP_SELECT_ESP32_P4_FUNCTION_EV_BOARD if IDF_TARGET_ESP32P4
127+
default BSP_SELECT_ESP32_C3_LCDKIT if IDF_TARGET_ESP32C3
128+
help
129+
Select which BSP will be used in project.
130+
131+
config BSP_SELECT_NONE
132+
bool "ESP_BSP_NONE"
133+
134+
config BSP_SELECT_ESP_BSP_DEVKIT
135+
bool "ESP_BSP_DEVKIT"
136+
137+
config BSP_SELECT_ESP_BSP_GENERIC
138+
bool "ESP_BSP_GENERIC"
139+
140+
config BSP_SELECT_ESP_WROVER_KIT
141+
depends on IDF_TARGET_ESP32
142+
bool "ESP_WROVER_KIT"
143+
144+
config BSP_SELECT_ESP32_AZURE_IOT_KIT
145+
depends on IDF_TARGET_ESP32
146+
bool "ESP32_AZURE_IOT_KIT"
147+
148+
config BSP_SELECT_ESP32_C3_LCDKIT
149+
depends on IDF_TARGET_ESP32C3
150+
bool "ESP32_C3_LCDKIT"
151+
152+
config BSP_SELECT_ESP32_LYRAT
153+
depends on IDF_TARGET_ESP32
154+
bool "ESP32_LYRAT"
155+
156+
config BSP_SELECT_ESP32_P4_EYE
157+
depends on IDF_TARGET_ESP32P4
158+
bool "ESP32_P4_EYE"
159+
160+
config BSP_SELECT_ESP32_P4_FUNCTION_EV_BOARD
161+
depends on IDF_TARGET_ESP32P4
162+
bool "ESP32_P4_FUNCTION_EV_BOARD"
163+
164+
config BSP_SELECT_ESP32_S2_KALUGA_KIT
165+
depends on IDF_TARGET_ESP32S2
166+
bool "ESP32_S2_KALUGA_KIT"
167+
168+
config BSP_SELECT_ESP32_S3_EYE
169+
depends on IDF_TARGET_ESP32S3
170+
bool "ESP32_S3_EYE"
171+
172+
config BSP_SELECT_ESP32_S3_KORVO_1
173+
depends on IDF_TARGET_ESP32S3
174+
bool "ESP32_S3_KORVO_1"
175+
176+
config BSP_SELECT_ESP32_S3_KORVO_2
177+
depends on IDF_TARGET_ESP32S3
178+
bool "ESP32_S3_KORVO_2"
179+
180+
config BSP_SELECT_ESP32_S3_LCD_EV_BOARD
181+
depends on IDF_TARGET_ESP32S3
182+
bool "ESP32_S3_LCD_EV_BOARD"
183+
184+
config BSP_SELECT_ESP32_S3_USB_OTG
185+
depends on IDF_TARGET_ESP32S3
186+
bool "ESP32_S3_USB_OTG"
187+
188+
config BSP_SELECT_ESP_BOX
189+
depends on IDF_TARGET_ESP32S3
190+
bool "ESP_BOX"
191+
192+
config BSP_SELECT_ESP_BOX_LITE
193+
depends on IDF_TARGET_ESP32S3
194+
bool "ESP_BOX_LITE"
195+
196+
config BSP_SELECT_ESP_BOX_3
197+
depends on IDF_TARGET_ESP32S3
198+
bool "ESP_BOX_3"
199+
200+
config BSP_SELECT_M5_ATOM_S3
201+
depends on IDF_TARGET_ESP32S3
202+
bool "M5_ATOM_S3"
203+
204+
config BSP_SELECT_M5DIAL
205+
depends on IDF_TARGET_ESP32S3
206+
bool "M5DIAL"
207+
208+
config BSP_SELECT_M5STACK_CORE
209+
depends on IDF_TARGET_ESP32
210+
bool "M5STACK_CORE"
211+
212+
config BSP_SELECT_M5STACK_CORE_2
213+
depends on IDF_TARGET_ESP32
214+
bool "M5STACK_CORE_2"
215+
216+
config BSP_SELECT_M5STACK_CORE_S3
217+
depends on IDF_TARGET_ESP32S3
218+
bool "M5STACK_CORE_S3"
219+
220+
config BSP_SELECT_M5STACK_TAB5
221+
depends on IDF_TARGET_ESP32P4
222+
bool "M5STACK_TAB5"
223+
224+
endchoice
225+
226+
endmenu

components/bsp_selector/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# BSP Selector
2+
3+
This component alows to select BSP in project from `menuconfig`. It shows only available BSPs ber selected target.
4+
5+
## Usage
6+
7+
Add this component into your project `idf_component.yml` file like this:
8+
9+
```
10+
...
11+
dependencies:
12+
bsp_selector: "^1.0"
13+
14+
```

0 commit comments

Comments
 (0)