fix(ci): re-enable some LEDC/UART tests for H4, S31

This commit is contained in:
Song Ruo Jing
2026-08-04 21:23:44 +08:00
parent 43b98a4fcc
commit 28acedf295
8 changed files with 61 additions and 30 deletions
@@ -65,8 +65,6 @@ def test_ledc_psram(dut: IdfDut) -> None:
@pytest.mark.temp_skip_ci(targets=['esp32s3'], reason='s3 multi device runner has no psram') @pytest.mark.temp_skip_ci(targets=['esp32s3'], reason='s3 multi device runner has no psram')
@pytest.mark.temp_skip_ci(targets=['esp32h4'], reason='cannot pass') # TODO: IDF-15610
@pytest.mark.temp_skip_ci(targets=['esp32s31'], reason='cannot pass') # TODO: IDF-15610
@pytest.mark.generic_multi_device @pytest.mark.generic_multi_device
@pytest.mark.parametrize( @pytest.mark.parametrize(
'count, config', 'count, config',
@@ -125,7 +125,6 @@ def test_uart_single_dev_psram(case_tester) -> None: # type: ignore
# ESP32 only supports uart wakeup if signal routes through IOMUX # ESP32 only supports uart wakeup if signal routes through IOMUX
# ESP32S3 multi device runner has no psram IDF-12837, # ESP32S3 multi device runner has no psram IDF-12837,
@pytest.mark.temp_skip_ci(targets=['esp32', 'esp32s3'], reason='no multi-dev runner') @pytest.mark.temp_skip_ci(targets=['esp32', 'esp32s3'], reason='no multi-dev runner')
@pytest.mark.temp_skip_ci(targets=['esp32s31'], reason='cannot pass') # TODO: IDF-15619
@pytest.mark.generic_multi_device @pytest.mark.generic_multi_device
@idf_parametrize('target', ['supported_targets'], indirect=['target']) @idf_parametrize('target', ['supported_targets'], indirect=['target'])
@pytest.mark.parametrize( @pytest.mark.parametrize(
@@ -388,10 +388,6 @@ examples/peripherals/lcd/tjpgd:
examples/peripherals/ledc: examples/peripherals/ledc:
disable: disable:
- if: SOC_LEDC_SUPPORTED != 1 - if: SOC_LEDC_SUPPORTED != 1
disable_test:
- if: IDF_TARGET in ["esp32h4"]
temporary: true
reason: cannot pass # TODO: IDF-15610
depends_components: depends_components:
- esp_driver_ledc - esp_driver_ledc
- esp_hal_ledc - esp_hal_ledc
@@ -77,4 +77,5 @@ void app_main(void)
ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, LEDC_DUTY)); ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, LEDC_DUTY));
// Update duty to apply the new value // Update duty to apply the new value
ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL)); ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
printf("Generated a %d Hz signal on GPIO %d\n", LEDC_FREQUENCY, LEDC_OUTPUT_IO);
} }
@@ -14,19 +14,24 @@ This example shows how to control intensity of LEDs using selected SoC's on-boar
* A development board with any Espressif SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.) * A development board with any Espressif SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
* A USB cable for power supply and programming * A USB cable for power supply and programming
Connect four LEDs to the following LEDC channels / individual GPIOs: Connect four LEDs to the following LEDC channels / individual GPIOs (defaults):
| | Channel 0 | Channel 1 | Channel 2 | Channel 3 | | | Channel 0 | Channel 1 | Channel 2 | Channel 3 |
| --------------- | --------- | --------- | --------- | --------- | | --------------- | --------- | --------- | --------- | --------- |
| ESP32 | GPIO18 | GPIO19 | GPIO4 | GPIO5 | | ESP32 | GPIO18 | GPIO19 | GPIO4 | GPIO5 |
| ESP32-H4 | GPIO18 | GPIO19 | GPIO2 | GPIO3 |
| All other chips | GPIO8 | GPIO9 | GPIO2 | GPIO3 | | All other chips | GPIO8 | GPIO9 | GPIO2 | GPIO3 |
The GPIO numbers can be changed in menuconfig under `Example Configuration`.
### Configure the project ### Configure the project
``` ```
idf.py menuconfig idf.py menuconfig
``` ```
- `Example Configuration` → select GPIO numbers for LEDC channel 0–3
### Build and Flash ### Build and Flash
Build the project and flash it to the board, then run the monitor tool to view the serial output: Build the project and flash it to the board, then run the monitor tool to view the serial output:
@@ -0,0 +1,37 @@
menu "Example Configuration"
orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps"
config LEDC_CH0_GPIO
int "LEDC channel 0 GPIO number"
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
default 18 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32H4
default 8
help
GPIO pin number to be used as LEDC channel 0 output.
config LEDC_CH1_GPIO
int "LEDC channel 1 GPIO number"
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
default 19 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32H4
default 9
help
GPIO pin number to be used as LEDC channel 1 output.
config LEDC_CH2_GPIO
int "LEDC channel 2 GPIO number"
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
default 4 if IDF_TARGET_ESP32
default 2
help
GPIO pin number to be used as LEDC channel 2 output.
config LEDC_CH3_GPIO
int "LEDC channel 3 GPIO number"
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
default 5 if IDF_TARGET_ESP32
default 3
help
GPIO pin number to be used as LEDC channel 3 output.
endmenu
@@ -27,39 +27,35 @@
* *
* 3. You can also set a target duty directly without fading. * 3. You can also set a target duty directly without fading.
* *
* 4. On ESP32, GPIO18/19/4/5 are used as the LEDC outputs: * 4. LEDC channel GPIO numbers can be selected in menuconfig
* GPIO18/19 are from the high speed channel group * (Example Configuration). See README for default pin mapping.
* GPIO4/5 are from the low speed channel group * On ESP32, CH0/1 use the high speed channel group and CH2/3 use
* * the low speed channel group. On other targets, all channels use
* On other targets, GPIO8/9/4/5 are used as the LEDC outputs, * the low speed channel group.
* and they are all from the low speed channel group.
* *
* 5. All the LEDC outputs change the duty repeatedly. * 5. All the LEDC outputs change the duty repeatedly.
* *
*/ */
#define LEDC_CH0_GPIO CONFIG_LEDC_CH0_GPIO
#define LEDC_CH1_GPIO CONFIG_LEDC_CH1_GPIO
#define LEDC_CH2_GPIO CONFIG_LEDC_CH2_GPIO
#define LEDC_CH3_GPIO CONFIG_LEDC_CH3_GPIO
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_IDF_TARGET_ESP32
#define LEDC_HS_TIMER LEDC_TIMER_0 #define LEDC_HS_TIMER LEDC_TIMER_0
#define LEDC_HS_MODE LEDC_HIGH_SPEED_MODE #define LEDC_HS_MODE LEDC_HIGH_SPEED_MODE
#define LEDC_HS_CH0_GPIO (18)
#define LEDC_HS_CH0_CHANNEL LEDC_CHANNEL_0 #define LEDC_HS_CH0_CHANNEL LEDC_CHANNEL_0
#define LEDC_HS_CH1_GPIO (19)
#define LEDC_HS_CH1_CHANNEL LEDC_CHANNEL_1 #define LEDC_HS_CH1_CHANNEL LEDC_CHANNEL_1
#define LEDC_LS_TIMER LEDC_TIMER_1 #define LEDC_LS_TIMER LEDC_TIMER_1
#define LEDC_LS_MODE LEDC_LOW_SPEED_MODE #define LEDC_LS_MODE LEDC_LOW_SPEED_MODE
#define LEDC_LS_CH2_GPIO (4)
#define LEDC_LS_CH2_CHANNEL LEDC_CHANNEL_2 #define LEDC_LS_CH2_CHANNEL LEDC_CHANNEL_2
#define LEDC_LS_CH3_GPIO (5)
#define LEDC_LS_CH3_CHANNEL LEDC_CHANNEL_3 #define LEDC_LS_CH3_CHANNEL LEDC_CHANNEL_3
#else #else
#define LEDC_LS_TIMER LEDC_TIMER_1 #define LEDC_LS_TIMER LEDC_TIMER_1
#define LEDC_LS_MODE LEDC_LOW_SPEED_MODE #define LEDC_LS_MODE LEDC_LOW_SPEED_MODE
#define LEDC_LS_CH0_GPIO (8)
#define LEDC_LS_CH0_CHANNEL LEDC_CHANNEL_0 #define LEDC_LS_CH0_CHANNEL LEDC_CHANNEL_0
#define LEDC_LS_CH1_GPIO (9)
#define LEDC_LS_CH1_CHANNEL LEDC_CHANNEL_1 #define LEDC_LS_CH1_CHANNEL LEDC_CHANNEL_1
#define LEDC_LS_CH2_GPIO (2)
#define LEDC_LS_CH2_CHANNEL LEDC_CHANNEL_2 #define LEDC_LS_CH2_CHANNEL LEDC_CHANNEL_2
#define LEDC_LS_CH3_GPIO (3)
#define LEDC_LS_CH3_CHANNEL LEDC_CHANNEL_3 #define LEDC_LS_CH3_CHANNEL LEDC_CHANNEL_3
#endif #endif
@@ -125,7 +121,7 @@ void app_main(void)
{ {
.channel = LEDC_HS_CH0_CHANNEL, .channel = LEDC_HS_CH0_CHANNEL,
.duty = 0, .duty = 0,
.gpio_num = LEDC_HS_CH0_GPIO, .gpio_num = LEDC_CH0_GPIO,
.speed_mode = LEDC_HS_MODE, .speed_mode = LEDC_HS_MODE,
.hpoint = 0, .hpoint = 0,
.timer_sel = LEDC_HS_TIMER, .timer_sel = LEDC_HS_TIMER,
@@ -134,7 +130,7 @@ void app_main(void)
{ {
.channel = LEDC_HS_CH1_CHANNEL, .channel = LEDC_HS_CH1_CHANNEL,
.duty = 0, .duty = 0,
.gpio_num = LEDC_HS_CH1_GPIO, .gpio_num = LEDC_CH1_GPIO,
.speed_mode = LEDC_HS_MODE, .speed_mode = LEDC_HS_MODE,
.hpoint = 0, .hpoint = 0,
.timer_sel = LEDC_HS_TIMER, .timer_sel = LEDC_HS_TIMER,
@@ -144,7 +140,7 @@ void app_main(void)
{ {
.channel = LEDC_LS_CH0_CHANNEL, .channel = LEDC_LS_CH0_CHANNEL,
.duty = 0, .duty = 0,
.gpio_num = LEDC_LS_CH0_GPIO, .gpio_num = LEDC_CH0_GPIO,
.speed_mode = LEDC_LS_MODE, .speed_mode = LEDC_LS_MODE,
.hpoint = 0, .hpoint = 0,
.timer_sel = LEDC_LS_TIMER, .timer_sel = LEDC_LS_TIMER,
@@ -153,7 +149,7 @@ void app_main(void)
{ {
.channel = LEDC_LS_CH1_CHANNEL, .channel = LEDC_LS_CH1_CHANNEL,
.duty = 0, .duty = 0,
.gpio_num = LEDC_LS_CH1_GPIO, .gpio_num = LEDC_CH1_GPIO,
.speed_mode = LEDC_LS_MODE, .speed_mode = LEDC_LS_MODE,
.hpoint = 0, .hpoint = 0,
.timer_sel = LEDC_LS_TIMER, .timer_sel = LEDC_LS_TIMER,
@@ -163,7 +159,7 @@ void app_main(void)
{ {
.channel = LEDC_LS_CH2_CHANNEL, .channel = LEDC_LS_CH2_CHANNEL,
.duty = 0, .duty = 0,
.gpio_num = LEDC_LS_CH2_GPIO, .gpio_num = LEDC_CH2_GPIO,
.speed_mode = LEDC_LS_MODE, .speed_mode = LEDC_LS_MODE,
.hpoint = 0, .hpoint = 0,
.timer_sel = LEDC_LS_TIMER, .timer_sel = LEDC_LS_TIMER,
@@ -172,7 +168,7 @@ void app_main(void)
{ {
.channel = LEDC_LS_CH3_CHANNEL, .channel = LEDC_LS_CH3_CHANNEL,
.duty = 0, .duty = 0,
.gpio_num = LEDC_LS_CH3_GPIO, .gpio_num = LEDC_CH3_GPIO,
.speed_mode = LEDC_LS_MODE, .speed_mode = LEDC_LS_MODE,
.hpoint = 0, .hpoint = 0,
.timer_sel = LEDC_LS_TIMER, .timer_sel = LEDC_LS_TIMER,
@@ -8,7 +8,6 @@ from pytest_embedded_idf.utils import soc_filtered_targets
@pytest.mark.generic @pytest.mark.generic
@idf_parametrize('target', soc_filtered_targets('SOC_LEDC_SUPPORTED == 1'), indirect=['target']) @idf_parametrize('target', soc_filtered_targets('SOC_LEDC_SUPPORTED == 1'), indirect=['target'])
@pytest.mark.temp_skip_ci(targets=['esp32h4'], reason='cannot pass') # TODO: IDF-15610
def test_ledc_fade_example(dut: IdfDut) -> None: def test_ledc_fade_example(dut: IdfDut) -> None:
# repeat to test at least two rounds of fade # repeat to test at least two rounds of fade
dut.expect_exact('1. LEDC fade up to duty = 4000') dut.expect_exact('1. LEDC fade up to duty = 4000')