You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
I have searched the issue tracker for a similar issue and not found a similar issue.
General issue report
Issue: ADC Continuous Mode Fails with Mixed Attenuation Values
Description
I am experiencing a failure when configuring the ADC Continuous Mode using the ESP-IDF. The issue occurs when using two or more different attenuation values in the adc_digi_pattern_config_t pattern array to feed the adc_continuous_config_t configuration. Specifically, the call to ESP_ERROR_CHECK(adc_continuous_config(handle, &dig_cfg)); fails with an error.
Steps to Reproduce
Define a pattern array with multiple ADC channels, each having different attenuation values.
Configure the ADC continuous mode using this pattern array.
Observe that ESP_ERROR_CHECK(adc_continuous_config(handle, &dig_cfg)); fails.
Expected Behavior
The adc_continuous_config function should successfully configure the ADC continuous mode even when using different attenuation values in the pattern array.
Actual Behavior
The ESP_ERROR_CHECK(adc_continuous_config(handle, &dig_cfg)); call fails, resulting in an ESP_ERR_INVALID_ARG error.
Environment
ESP-IDF Version: v5.2
Development Kit: [e.g., ESP32-DevKitC]
Module or chip used: [e.g., ESP32-WROOM-32]
Compiler version: [e.g., xtensa-esp32-elf-gcc (crosstool-NG esp-2021r2) 8.4.0]
Operating System: [e.g., Windows/Linux/macOS]
Power Supply: [e.g., USB]
Additional Context
This issue severely limits the use of the ADC continuous mode with channels that require different attenuation settings. It would be helpful to understand if this is a known limitation or if there is a workaround to allow mixed attenuation values in the configuration.
LOG
ESP_ERROR_CHECK failed: esp_err_t 0x102 (ESP_ERR_INVALID_ARG) at 0x400dddbd
0x400dddbd: continuous_adc_init at main/include/timer_adc_read.c:106 (discriminator 1)
file: "./main/include/timer_adc_read.c" line 106
func: continuous_adc_init
expression: adc_continuous_config(handle, &dig_cfg)
abort() was called at PC 0x40092eb3 on core 1
0x40092eb3: _esp_error_check_failed at C:/Espressif/frameworks/esp-idf-v5.2/components/esp_system/esp_err.c:50
Backtrace: 0x40081b2a:0x3ffcc420 0x40092ebd:0x3ffcc440 0x40099f85:0x3ffcc460 0x40092eb3:0x3ffcc4d0 0x400dddbd:0x3ffcc500 0x40101e33:0x3ffcc590 0x40093b16:0x3ffccf10
0x40081b2a: panic_abort at C:/Espressif/frameworks/esp-idf-v5.2/components/esp_system/panic.c:466
0x40092ebd: esp_system_abort at C:/Espressif/frameworks/esp-idf-v5.2/components/esp_system/port/esp_system_chip.c:93
0x40099f85: abort at C:/Espressif/frameworks/esp-idf-v5.2/components/newlib/abort.c:38
0x40092eb3: _esp_error_check_failed at C:/Espressif/frameworks/esp-idf-v5.2/components/esp_system/esp_err.c:50
So, the Attenuation is not working at all for multiples continous reading at different channel settings.
The text was updated successfully, but these errors were encountered:
For the same ADC unit, the channels should use the same attenuation config.
It doesn't make sense. If we need to read each channel individually, continuous reading doesn't work at all unless it's a fixed setup unit. The document should make this clear.
We can set up each channel in one-shot mode with the required attenuation. So, maybe this is a design flaw?
We will rebuild all from scratch to fix this, but its a pain, will close the issue.
The driver is not very well designed. The options to set are awkward and do not align with the intended functionality of the requested fields. It seems either the ADC was broken and not properly fixed, or the idea was abandoned before the task was complete.
If the adc_digi_pattern_config_t has a specific field for attenuation for each item added, this makes no sense at all again!
Answers checklist.
General issue report
Issue: ADC Continuous Mode Fails with Mixed Attenuation Values
Description
I am experiencing a failure when configuring the ADC Continuous Mode using the ESP-IDF. The issue occurs when using two or more different attenuation values in the adc_digi_pattern_config_t pattern array to feed the adc_continuous_config_t configuration. Specifically, the call to ESP_ERROR_CHECK(adc_continuous_config(handle, &dig_cfg)); fails with an error.
Steps to Reproduce
Define a pattern array with multiple ADC channels, each having different attenuation values.
Configure the ADC continuous mode using this pattern array.
Observe that ESP_ERROR_CHECK(adc_continuous_config(handle, &dig_cfg)); fails.
Example Code
`static void continuous_adc_init(adc_continuous_handle_t *out_handle)
{
int EXAMPLE_READ_LEN = 256;
adc_continuous_handle_t handle = NULL;
}
`
Expected Behavior
The adc_continuous_config function should successfully configure the ADC continuous mode even when using different attenuation values in the pattern array.
Actual Behavior
The ESP_ERROR_CHECK(adc_continuous_config(handle, &dig_cfg)); call fails, resulting in an ESP_ERR_INVALID_ARG error.
Environment
ESP-IDF Version: v5.2
Development Kit: [e.g., ESP32-DevKitC]
Module or chip used: [e.g., ESP32-WROOM-32]
Compiler version: [e.g., xtensa-esp32-elf-gcc (crosstool-NG esp-2021r2) 8.4.0]
Operating System: [e.g., Windows/Linux/macOS]
Power Supply: [e.g., USB]
Additional Context
This issue severely limits the use of the ADC continuous mode with channels that require different attenuation settings. It would be helpful to understand if this is a known limitation or if there is a workaround to allow mixed attenuation values in the configuration.
LOG
ESP_ERROR_CHECK failed: esp_err_t 0x102 (ESP_ERR_INVALID_ARG) at 0x400dddbd
0x400dddbd: continuous_adc_init at main/include/timer_adc_read.c:106 (discriminator 1)
file: "./main/include/timer_adc_read.c" line 106
func: continuous_adc_init
expression: adc_continuous_config(handle, &dig_cfg)
abort() was called at PC 0x40092eb3 on core 1
0x40092eb3: _esp_error_check_failed at C:/Espressif/frameworks/esp-idf-v5.2/components/esp_system/esp_err.c:50
Backtrace: 0x40081b2a:0x3ffcc420 0x40092ebd:0x3ffcc440 0x40099f85:0x3ffcc460 0x40092eb3:0x3ffcc4d0 0x400dddbd:0x3ffcc500 0x40101e33:0x3ffcc590 0x40093b16:0x3ffccf10
0x40081b2a: panic_abort at C:/Espressif/frameworks/esp-idf-v5.2/components/esp_system/panic.c:466
0x40092ebd: esp_system_abort at C:/Espressif/frameworks/esp-idf-v5.2/components/esp_system/port/esp_system_chip.c:93
0x40099f85: abort at C:/Espressif/frameworks/esp-idf-v5.2/components/newlib/abort.c:38
0x40092eb3: _esp_error_check_failed at C:/Espressif/frameworks/esp-idf-v5.2/components/esp_system/esp_err.c:50
So, the Attenuation is not working at all for multiples continous reading at different channel settings.
The text was updated successfully, but these errors were encountered: