Skip to content

Commit a0f2682

Browse files
committed
Merge branch 'feature/add_adc_channel_label' into 'main'
feat(esp_board_manager): Add adc channel label for audio codec See merge request adf/multimedia/esp-gmf!148
2 parents 33a3142 + b14b06c commit a0f2682

File tree

34 files changed

+338
-287
lines changed

34 files changed

+338
-287
lines changed

packages/esp_board_manager/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
- Add custom device type with test support
88
- Add gpio expander device type with test support
99
- Add camera device type with test support, support dvp bus type now
10+
- Instead of modifying idf_component.yml, the board manager uses a Kconfig option to handle dynamic dependencies
11+
- Add `adc_channel_labels` field to audio codec for better channel identification
12+
- Add board selection priority documentation and sdkconfig troubleshooting guide
13+
- Instead of copying board source files to gen_bmgr_codes, now reference them directly via SRC_DIRS and INCLUDE_DIRS to avoid duplication.
1014

1115
### Supported Boards
1216
- **ESP32-S3 Korvo2 V3**: Full LCD, LCD Touch, DVP Camera support

packages/esp_board_manager/README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,27 @@ The ESP Board Manager supports board configuration through three different path
286286
2. **User Project Components**: Custom boards defined in project components, path like `{PROJECT_ROOT}/components/{component_name}/boards`
287287
3. **Custom Customer Path**: External board definitions in custom locations. User-specified path via `-c` argument in `gen_bmgr_config_codes.py` to set the custom path.
288288

289+
### Board Selection Priority
290+
291+
When multiple boards with the same name exist across different paths, the ESP Board Manager follows a specific priority order to determine which board configuration to use:
292+
293+
**Priority Order (Highest to Lowest):**
294+
295+
1. **Custom Customer Path** (Highest Priority)
296+
- Boards specified via `-c` argument
297+
- Example: `idf.py gen-bmgr-config -b my_board -c /path/to/custom/boards`
298+
299+
2. **User Project Components** (Medium Priority)
300+
- Boards in project components: `{PROJECT_ROOT}/components/{component_name}/boards`
301+
- These override main boards with the same name
302+
303+
3. **Main Boards Directory** (Lowest Priority)
304+
- Built-in boards: `esp_board_manager/boards`
305+
- Used as fallback when no other version exists
306+
307+
**Important Notes:**
308+
- **No duplicate warnings**: The system silently uses the higher priority board without warning about duplicates
309+
289310
### Verify and Use New Board
290311

291312
1. **Verify Board Configuration**
@@ -544,7 +565,13 @@ If `idf.py gen-bmgr-config` is not recognized:
544565
2. Ensure your project has a `components/gen_bmgr_codes` folder with generated files. These files are generated by running `idf.py gen-bmgr-config -b YOUR_BOARD`.
545566

546567
### **Switching Boards**
547-
Using `idf.py gen-bmgr-config -b` is strongly recommended. Using `idf.py menuconfig` to select boards may result in dependency errors.
568+
Using `idf.py gen-bmgr-config -b` is required. Using `idf.py menuconfig` to select boards may result in dependency errors.
569+
570+
### "sdkconfig file not found"
571+
572+
If you see the error `sdkconfig file not found at [path]`, this means that the ESP Board Manager will create the default device and peripheral dependencies based on your selected board YAML files.
573+
574+
**Note:** The `sdkconfig` file is automatically generated by ESP-IDF when you run `idf.py menuconfig`, `idf.py set-target xxx`, or `idf.py build` for the first time in a project.
548575

549576
## License
550577

packages/esp_board_manager/README_CN.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ esp_board_manager/
2525
├── include/
2626
│ ├── esp_board_manager.h # 主板级管理器 API
2727
│ ├── esp_board_periph.h # 外设管理
28-
│ ├── esp_board_device.h # 设备管理
28+
│ ├── esp_board_device.h # 设备管理
2929
│ ├── esp_board_manager_err.h # 统一错误管理系统
3030
│ └── esp_board_manager_defs.h # 关键字列表
3131
├── peripherals/ # 外设实现
@@ -286,6 +286,27 @@ ESP Board Manager 支持通过三个不同的路径位置进行板级配置,
286286
2. **用户项目组件**: 在项目组件中定义的自定义板级,路径如 `{PROJECT_ROOT}/components/{component_name}/boards`
287287
3. **自定义客户路径**: 自定义位置的外部板级定义。用户通过 `gen_bmgr_config_codes.py` 中的 `-c` 参数指定路径来设置自定义路径。
288288

289+
### 板级选择优先级
290+
291+
当不同路径中存在同名板级时,ESP Board Manager 遵循特定的优先级顺序来确定使用哪个板级配置:
292+
293+
**优先级顺序(从高到低):**
294+
295+
1. **自定义客户路径**(最高优先级)
296+
- 通过 `-c` 参数指定的板级
297+
- 示例:`idf.py gen-bmgr-config -b my_board -c /path/to/custom/boards`
298+
299+
2. **用户项目组件**(中等优先级)
300+
- 项目组件中的板级:`{PROJECT_ROOT}/components/{component_name}/boards`
301+
- 这些会覆盖同名的主板级
302+
303+
3. **主板级目录**(最低优先级)
304+
- 内置板级:`esp_board_manager/boards`
305+
- 当没有其他版本时作为后备使用
306+
307+
**重要说明:**
308+
- **无重复警告**:系统会静默使用高优先级板级,不会警告重复项
309+
289310
### 验证和使用新板级
290311

291312
1. **验证板级配置**
@@ -544,7 +565,13 @@ ESP Board Manager 的未来开发计划:
544565
2. 确保您的项目有 `components/gen_bmgr_codes` 文件夹,其中包含生成的文件。这些文件是通过运行 `idf.py gen-bmgr-config -b YOUR_BOARD` 生成的。
545566

546567
### **切换开发板**
547-
强烈建议使用 `idf.py gen-bmgr-config -b`。使用 `idf.py menuconfig` 选择板级可能会导致依赖错误。
568+
必须使用 `idf.py gen-bmgr-config -b`。使用 `idf.py menuconfig` 选择板级可能会导致依赖错误。
569+
570+
### "sdkconfig 文件未找到"
571+
572+
如果您看到错误 `sdkconfig file not found at [path]`,这意味着 ESP Board Manager 将根据您选择的板级 YAML 文件创建默认的设备和外设依赖关系。
573+
574+
**注意:** 当您在项目中首次运行 `idf.py menuconfig`、`idf.py set-target xxx` 或 `idf.py build` 时,ESP-IDF 会自动生成 `sdkconfig` 文件。
548575

549576
## 许可证
550577

packages/esp_board_manager/boards/echoear_core_board_v1_0/board_devices.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ devices:
5050
config:
5151
adc_enabled: true
5252
adc_max_channel: 4
53-
# The channel mask, 1-enable, 0-disable, from right to left layout: mic0,mic1,mic2,mic3
53+
# The channel mask, 1-enable, 0-disable
5454
# e.g."0111", bit0: Mic0 enable, bit1: Mic1 enable, bit2: Mic2 enable, bit3: Mic3 enable, bit4: Mic4 disable
5555
adc_channel_mask: "0111" # Mic0, Mic1, Mic2 enable
56+
adc_channel_labels: ['NA', 'RE', 'FR', 'FL'] # MSB ~ LSB
5657
adc_init_gain: 0 # dB
5758

5859
# I2S interface configuration
@@ -127,6 +128,6 @@ devices:
127128
type: ledc_ctrl
128129
version: default
129130
config:
130-
default_percent: 100 # 0-100, default 0 percent
131+
default_percent: 100 # 0-100, default 0 percent
131132
peripherals:
132-
- name: ledc_backlight # LEDC peripheral for GPIO 44
133+
- name: ledc_backlight # LEDC peripheral for GPIO 44

packages/esp_board_manager/boards/echoear_core_board_v1_2/board_devices.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ devices:
6464
config:
6565
adc_enabled: true
6666
adc_max_channel: 4
67-
# The channel mask, 1-enable, 0-disable, from right to left layout: mic0,mic1,mic2,mic3
67+
# The channel mask, 1-enable, 0-disable
6868
# e.g."0111", bit0: Mic0 enable, bit1: Mic1 enable, bit2: Mic2 enable, bit3: Mic3 enable, bit4: Mic4 disable
6969
adc_channel_mask: "0111" # Mic0, Mic1, Mic2 enable
70-
adc_init_gain: 0 # dB
70+
adc_channel_labels: ['NA', 'RE', 'FR', 'FL'] # MSB ~ LSB
71+
adc_init_gain: 0 # dB
7172

7273
# I2S interface configuration
7374
peripherals:

packages/esp_board_manager/boards/esp32_c5_spot/board_devices.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ devices:
1717
# The channel mask, 1-enable, 0-disable, from right to left layout: mic0,mic1,mic2,mic3
1818
# e.g. "0111", bit0: Mic0 enable, bit1: Mic1 enable, bit2: Mic2 enable, bit3: Mic3 enable, bit4: Mic4 disable
1919
adc_channel_mask: "1" # Mic0 enable
20+
adc_channel_labels: ['FC']
2021
dac_enabled: true
2122
dac_max_channel: 1
2223
# DAC channel mask, 1-enable, 0-disable, layout: left,right

packages/esp_board_manager/boards/esp32_s3_korvo2_v3/board_devices.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ devices:
1717
dac_enabled: true
1818
dac_max_channel: 1
1919
# DAC channel mask, 1-enable, 0-disable, layout: left,right
20-
dac_channel_mask: "1" # Left enable
20+
dac_channel_mask: "1" # Left enable
2121

2222
# Power amplifier configuration
2323
peripherals:
@@ -41,6 +41,7 @@ devices:
4141
adc_enabled: true
4242
adc_max_channel: 4
4343
adc_channel_mask: "0111"
44+
adc_channel_labels: ['NA', 'RE', 'FR', 'FL'] # MSB ~ LSB
4445
adc_init_gain: 0 # dB
4546

4647
# Power amplifier configuration
@@ -61,7 +62,7 @@ devices:
6162
clk: 15 # GPIO_NUM_15
6263
cmd: 7 # GPIO_NUM_7
6364
d0: 4 # GPIO_NUM_4
64-
65+
6566
- name: gpio_expander
6667
chip: tca9554
6768
type: gpio_expander
@@ -119,10 +120,10 @@ devices:
119120
config:
120121
# esp_lcd_panel_io_i2c_config_t fields for touch communication
121122
io_i2c_config:
122-
dev_addr: 0x24
123+
dev_addr: 0x24
123124
lcd_cmd_bits: 16 # Bit-width of LCD command
124125
peripherals:
125-
- name: i2c_master # I2C peripheral for touch communication
126+
- name: i2c_master # I2C peripheral for touch communication
126127

127128
# esp_lcd_touch_config_t fields for touch configuration
128129
touch_config:
@@ -131,7 +132,7 @@ devices:
131132
flags:
132133
swap_xy: false
133134
mirror_x: true
134-
mirror_y: false
135+
mirror_y: false
135136

136137
- name: camera_sensor
137138
type: camera

packages/esp_board_manager/boards/esp32_s3_korvo2l/board_devices.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ devices:
1414
config: &es8311_config
1515
adc_enabled: true
1616
adc_max_channel: 1
17-
# The channel mask, 1-enable, 0-disable,from right to left layout: mic0,mic1,mic2,mic3
17+
# The channel mask, 1-enable, 0-disable
1818
# e.g.“0111”, bit0: Mic0 enable, bit1: Mic1 enable, bit2: Mic2 enable, bit3: Mic3 enable, bit4: Mic4 disable
19-
adc_channel_mask: "1" # Mic0, Mic1 disable
19+
adc_channel_mask: "1" # Mic0 enable
20+
adc_channel_labels: ['RE','FC'] # Mic0 and reference enable, MSB ~ LSB
2021

2122
dac_enabled: true
2223
dac_max_channel: 1
@@ -68,7 +69,7 @@ devices:
6869
partition_label: NULL # The partition label for the SPIFFS filesystem
6970
format_if_mount_failed: true
7071

71-
- name: my_custom_sensor # The name of the device, must be unique
72+
- name: my_custom_sensor # The name of the device, must be unique
7273
type: custom # The type of the device, must be unique
7374
chip: esp32s3 # Optional: Name of chip
7475
version: default # Optional: Parser version to use

packages/esp_board_manager/boards/esp_box_3/board_devices.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ devices:
4343
config:
4444
adc_enabled: true
4545
adc_max_channel: 4
46-
# The channel mask, 1-enable, 0-disable,from right to left layout: mic0,mic1,mic2,mic3
46+
# The channel mask, 1-enable, 0-disable
4747
# e.g."0111", bit0: Mic0 enable, bit1: Mic1 enable, bit2: Mic2 enable, bit3: Mic3 enable, bit4: Mic4 disable
48-
adc_channel_mask: "0011"
48+
adc_channel_mask: "0111"
49+
adc_channel_labels: ['NA', 'RE', 'FR', 'FL'] # MSB ~ LSB
4950
adc_init_gain: 0 # dB
5051

5152
# Power amplifier configuration
@@ -61,7 +62,7 @@ devices:
6162
type: fatfs_sdcard
6263
version: default
6364
config:
64-
bus_width: 4 # 1, 4, 8, not used on SPI type
65+
bus_width: 4 # 1, 4, 8, not used on SPI type
6566
pins:
6667
clk: 11 # GPIO_NUM_15
6768
cmd: 14 # GPIO_NUM_7
@@ -85,12 +86,12 @@ devices:
8586
io_spi_config:
8687
cs_gpio_num: 5 # GPIO14 - LCD_CS (BSP_LCD_CS)
8788
dc_gpio_num: 4 # GPIO45 - LCD_DC (BSP_LCD_DC)
88-
spi_mode: 0 # Traditional SPI mode (0~3)
89-
pclk_hz: 20000000 # Frequency of pixel clock
89+
spi_mode: 0 # Traditional SPI mode (0~3)
90+
pclk_hz: 20000000 # Frequency of pixel clock
9091
flags:
9192
sio_mode: true # Single line mode
9293
peripherals:
93-
- name: spi_display # SPI peripheral for LCD communication
94+
- name: spi_display # SPI peripheral for LCD communication
9495

9596
lcd_panel_config:
9697
reset_gpio_num: 48
@@ -116,7 +117,7 @@ devices:
116117
dev_addr: [0x5D, 0x14] # GT911 I2C address (ESP_LCD_TOUCH_IO_I2C_GT911_ADDRESS)
117118
lcd_cmd_bits: 16 # Bit-width of LCD command
118119
peripherals:
119-
- name: i2c_master # I2C peripheral for touch communication
120+
- name: i2c_master # I2C peripheral for touch communication
120121

121122
# esp_lcd_touch_config_t fields for touch configuration
122123
touch_config:

packages/esp_board_manager/boards/esp_box_3/board_peripherals.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ peripherals:
2525

2626
# Slot configuration
2727
data_bit_width: 16 # Data bit width (valid data bits per sample)
28-
slot_bit_width: I2S_SLOT_BIT_WIDTH_AUTO # Total bits per slot (AUTO or specific value)
28+
slot_bit_width: I2S_SLOT_BIT_WIDTH_AUTO # Total bits per slot (AUTO or specific value)
2929
slot_mode: I2S_SLOT_MODE_STEREO # MONO or STEREO,I2S_SLOT_MODE_STEREO
30-
slot_mask: I2S_STD_SLOT_BOTH # LEFT, RIGHT, or BOTH slots
30+
slot_mask: I2S_STD_SLOT_BOTH # LEFT, RIGHT, or BOTH slots
3131
ws_width: 16 # WS signal width in BCLK ticks
3232

3333
# GPIO configuration
3434
pins:
3535
mclk: 2 # GPIO number for MCLK
36-
bclk: 17 # GPIO number for BCLK
36+
bclk: 17 # GPIO number for BCLK
3737
ws: 45 # GPIO number for WS
3838
dout: 15 # GPIO number for DATA out
3939
din: 16 # GPIO number for DATA in
@@ -53,25 +53,25 @@ peripherals:
5353
# spi_bus_config_t fields
5454
spi_bus_config:
5555
spi_port: SPI2_HOST # 0: SPI1_HOST, 1: SPI2_HOST, 2: SPI3_HOST
56-
data0_io_num: 6 # MOSI_IO_NUM
57-
sclk_io_num: 7 # SPI Clock signal
58-
max_transfer_sz: 72000 # Maximum transfer size in bytes
56+
data0_io_num: 6 # MOSI_IO_NUM
57+
sclk_io_num: 7 # SPI Clock signal
58+
max_transfer_sz: 72000 # Maximum transfer size in bytes
5959

6060
# PA CONTROL
6161
- name: gpio_pa_control
6262
type: gpio
6363
role: io
6464
config:
6565
pin: 46 # GPIO pin number
66-
mode: GPIO_MODE_OUTPUT # GPIO mode
67-
pull_up: true # Enable pull-up resistor
66+
mode: GPIO_MODE_OUTPUT # GPIO mode
67+
pull_up: true # Enable pull-up resistor
6868

6969
# CHIP BLACKLIGHT POWER CONTROL
7070
- name: gpio_backlight_control
7171
type: gpio
7272
role: io
7373
config:
74-
pin: 47 # GPIO47 - BL_EN (CHIP BLACKLIGHT POWER CONTROL)
74+
pin: 47 # GPIO47 - BL_EN (CHIP BLACKLIGHT POWER CONTROL)
7575
mode: GPIO_MODE_OUTPUT
7676
default_level: 1
7777

@@ -80,7 +80,7 @@ peripherals:
8080
type: gpio
8181
role: io
8282
config:
83-
pin: 43 # GPIO43 - SD power control
83+
pin: 43 # GPIO43 - SD power control
8484
mode: GPIO_MODE_OUTPUT
8585
default_level: 1
8686

0 commit comments

Comments
 (0)