Skip to content

Commit 3c3ee9e

Browse files
authored
Merge pull request #705 from espressif/feat/bsp_selector
feat(bsp_selector): Component for selection BSP in menuconfig
2 parents 102554f + ea54c8f commit 3c3ee9e

File tree

106 files changed

+776
-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.

106 files changed

+776
-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: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
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_C3_LCDKIT
21+
int
22+
default 1 if BSP_SELECT_ESP32_C3_LCDKIT
23+
default 0
24+
25+
config ESP32_LYRAT
26+
int
27+
default 1 if BSP_SELECT_ESP32_LYRAT
28+
default 0
29+
30+
config ESP32_P4_EYE
31+
int
32+
default 1 if BSP_SELECT_ESP32_P4_EYE
33+
default 0
34+
35+
config ESP32_P4_FUNCTION_EV_BOARD
36+
int
37+
default 1 if BSP_SELECT_ESP32_P4_FUNCTION_EV_BOARD
38+
default 0
39+
40+
config ESP32_S3_EYE
41+
int
42+
default 1 if BSP_SELECT_ESP32_S3_EYE
43+
default 0
44+
45+
config ESP32_S3_KORVO_1
46+
int
47+
default 1 if BSP_SELECT_ESP32_S3_KORVO_1
48+
default 0
49+
50+
config ESP32_S3_KORVO_2
51+
int
52+
default 1 if BSP_SELECT_ESP32_S3_KORVO_2
53+
default 0
54+
55+
config ESP32_S3_LCD_EV_BOARD
56+
int
57+
default 1 if BSP_SELECT_ESP32_S3_LCD_EV_BOARD
58+
default 0
59+
60+
config ESP32_S3_USB_OTG
61+
int
62+
default 1 if BSP_SELECT_ESP32_S3_USB_OTG
63+
default 0
64+
65+
config ESP_BOX_3
66+
int
67+
default 1 if BSP_SELECT_ESP_BOX_3
68+
default 0
69+
70+
config M5_ATOM_S3
71+
int
72+
default 1 if BSP_SELECT_M5_ATOM_S3
73+
default 0
74+
75+
config M5DIAL
76+
int
77+
default 1 if BSP_SELECT_M5DIAL
78+
default 0
79+
80+
config M5STACK_CORE
81+
int
82+
default 1 if BSP_SELECT_M5STACK_CORE
83+
default 0
84+
85+
config M5STACK_CORE_2
86+
int
87+
default 1 if BSP_SELECT_M5STACK_CORE_2
88+
default 0
89+
90+
config M5STACK_CORE_S3
91+
int
92+
default 1 if BSP_SELECT_M5STACK_CORE_S3
93+
default 0
94+
95+
config M5STACK_TAB5
96+
int
97+
default 1 if BSP_SELECT_M5STACK_TAB5
98+
default 0
99+
100+
101+
choice BSP_SELECT
102+
prompt "Select BSP"
103+
default BSP_SELECT_ESP_WROVER_KIT if IDF_TARGET_ESP32
104+
default BSP_SELECT_ESP32_S2_KALUGA_KIT if IDF_TARGET_ESP32S2
105+
default BSP_SELECT_ESP_BOX_3 if IDF_TARGET_ESP32S3
106+
default BSP_SELECT_ESP32_P4_FUNCTION_EV_BOARD if IDF_TARGET_ESP32P4
107+
default BSP_SELECT_ESP32_C3_LCDKIT if IDF_TARGET_ESP32C3
108+
help
109+
Select which BSP will be used in project.
110+
111+
config BSP_SELECT_NONE
112+
bool "ESP_BSP_NONE"
113+
114+
config BSP_SELECT_ESP_BSP_DEVKIT
115+
bool "ESP_BSP_DEVKIT"
116+
117+
config BSP_SELECT_ESP_BSP_GENERIC
118+
bool "ESP_BSP_GENERIC"
119+
120+
config BSP_SELECT_ESP_WROVER_KIT
121+
depends on IDF_TARGET_ESP32
122+
bool "ESP_WROVER_KIT"
123+
124+
config BSP_SELECT_ESP32_C3_LCDKIT
125+
depends on IDF_TARGET_ESP32C3
126+
bool "ESP32_C3_LCDKIT"
127+
128+
config BSP_SELECT_ESP32_LYRAT
129+
depends on IDF_TARGET_ESP32
130+
bool "ESP32_LYRAT"
131+
132+
config BSP_SELECT_ESP32_P4_EYE
133+
depends on IDF_TARGET_ESP32P4
134+
bool "ESP32_P4_EYE"
135+
136+
config BSP_SELECT_ESP32_P4_FUNCTION_EV_BOARD
137+
depends on IDF_TARGET_ESP32P4
138+
bool "ESP32_P4_FUNCTION_EV_BOARD"
139+
140+
config BSP_SELECT_ESP32_S3_EYE
141+
depends on IDF_TARGET_ESP32S3
142+
bool "ESP32_S3_EYE"
143+
144+
config BSP_SELECT_ESP32_S3_KORVO_1
145+
depends on IDF_TARGET_ESP32S3
146+
bool "ESP32_S3_KORVO_1"
147+
148+
config BSP_SELECT_ESP32_S3_KORVO_2
149+
depends on IDF_TARGET_ESP32S3
150+
bool "ESP32_S3_KORVO_2"
151+
152+
config BSP_SELECT_ESP32_S3_LCD_EV_BOARD
153+
depends on IDF_TARGET_ESP32S3
154+
bool "ESP32_S3_LCD_EV_BOARD"
155+
156+
config BSP_SELECT_ESP32_S3_USB_OTG
157+
depends on IDF_TARGET_ESP32S3
158+
bool "ESP32_S3_USB_OTG"
159+
160+
config BSP_SELECT_ESP_BOX_3
161+
depends on IDF_TARGET_ESP32S3
162+
bool "ESP_BOX_3"
163+
164+
config BSP_SELECT_M5_ATOM_S3
165+
depends on IDF_TARGET_ESP32S3
166+
bool "M5_ATOM_S3"
167+
168+
config BSP_SELECT_M5DIAL
169+
depends on IDF_TARGET_ESP32S3
170+
bool "M5DIAL"
171+
172+
config BSP_SELECT_M5STACK_CORE
173+
depends on IDF_TARGET_ESP32
174+
bool "M5STACK_CORE"
175+
176+
config BSP_SELECT_M5STACK_CORE_2
177+
depends on IDF_TARGET_ESP32
178+
bool "M5STACK_CORE_2"
179+
180+
config BSP_SELECT_M5STACK_CORE_S3
181+
depends on IDF_TARGET_ESP32S3
182+
bool "M5STACK_CORE_S3"
183+
184+
config BSP_SELECT_M5STACK_TAB5
185+
depends on IDF_TARGET_ESP32P4
186+
bool "M5STACK_TAB5"
187+
188+
endchoice
189+
190+
endmenu

components/bsp_selector/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# BSP Selector
2+
3+
This component allows to select BSP in project from `menuconfig`. It shows only BSPs available for 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+
```
15+
16+
Select target:
17+
```
18+
idf.py set-target esp32s3
19+
```
20+
21+
Select BSP in menuconfig:
22+
```
23+
idf.py menuconfig
24+
```
25+
26+
`Component config` -> `BSP Selector` -> `Select BSP`
27+
28+
> [!NOTE]
29+
> Only BSPs compatible with the selected target are available for selection.
30+
31+
Build, flash and start monitor:
32+
```
33+
idf.py flash monitor
34+
```

0 commit comments

Comments
 (0)