Open filzek opened 4 months ago
Findings
We were able to significantly improve the erratic ADC readings by making the following configuration changes:
These changes resulted in more stable ADC readings, reducing the spurious values and improving overall accuracy.
Channel [5] Min [1751] Max [1776] offset [25] adjusted [0.06] Channel [7] Min [1771] Max [1789] offset [18] adjusted [0.03] Channel [3] Min [1774] Max [1792] offset [18] adjusted [0.03] Channel [5] Min [1751] Max [1777] offset [26] adjusted [0.06] Channel [7] Min [1771] Max [1792] offset [21] adjusted [0.04] Channel [3] Min [1773] Max [1795] offset [22] adjusted [0.05]
But this without enable anything else if enable the problems start to happen again with such options as:
nimble_port_freertos_init(ble_spp_server_host_task);
void ble_spp_server_host_task(void *param)
{
/* This function will return only when nimble_port_stop() is executed */
nimble_port_run();
nimble_port_freertos_deinit();
}
Channel [5] Min [1719] Max [1805] offset [86] adjusted [0.31] Channel [7] Min [1737] Max [1891] offset [154] adjusted [0.58] Channel [3] Min [1535] Max [1817] offset [282] adjusted [1.10] Channel [5] Min [1718] Max [1803] offset [85] adjusted [0.30] Channel [7] Min [1736] Max [1811] offset [75] adjusted [0.26] Channel [3] Min [1738] Max [1814] offset [76] adjusted [0.27] Channel [5] Min [1717] Max [1804] offset [87] adjusted [0.31] Channel [7] Min [1734] Max [1810] offset [76] adjusted [0.27] Channel [3] Min [1738] Max [1813] offset [75] adjusted [0.26] Channel [5] Min [1715] Max [1807] offset [92] adjusted [0.33] Channel [7] Min [1522] Max [1811] offset [289] adjusted [1.12] Channel [3] Min [1738] Max [1818] offset [80] adjusted [0.28] Channel [5] Min [1717] Max [1873] offset [156] adjusted [0.59] Channel [7] Min [1737] Max [1811] offset [74] adjusted [0.26] Channel [3] Min [1739] Max [1813] offset [74] adjusted [0.26] Channel [5] Min [1716] Max [1854] offset [138] adjusted [0.52] Channel [7] Min [1735] Max [1811] offset [76] adjusted [0.27] Channel [3] Min [1738] Max [1813] offset [75] adjusted [0.26] Channel [5] Min [1719] Max [1805] offset [86] adjusted [0.31] Channel [7] Min [1738] Max [1812] offset [74] adjusted [0.26] Channel [3] Min [1517] Max [1814] offset [297] adjusted [1.16] Channel [5] Min [1718] Max [1805] offset [87] adjusted [0.31] Channel [7] Min [1737] Max [1810] offset [73] adjusted [0.25] Channel [3] Min [1605] Max [1814] offset [209] adjusted [0.80]
so the spourious reading become a real problem and this cannot be filtered at all.
Another problem found, it also corrupts the NIMBLE to allow devices to connect to it, broke the gatt to status 8 and later fasilled to status 133, this seens to runs only when adc continuous are enable.
Answers checklist.
IDF version.
v5.2.2-220-gaabb3699d1
Espressif SoC revision.
esp32 rev 3
Operating System used.
Windows
How did you build your project?
Command line with Make
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32 V3 WROVER
Power Supply used.
External 5V
What is the expected behavior?
ADC readings should remain stable and accurate even after initializing NIMBLE with nimble_port_init().
What is the actual behavior?
After initializing NIMBLE, ADC readings become erratic, showing an offset of more than 24 from the correct central reading.
When reading ADC without enabling NIMBLE using nimble_port_init(), the ADC readings are very stable on the ESP32 v3.0. Everything works perfectly. However, as soon as nimble_port_init() is called, the ADC readings become erratic, with a significant number of spurious values showing an odd offset of more than 24 from the correct central reading.
Detailed Description
Steps to reproduce.
Debug Logs.
More Information.
This issue seems to be directly related to the initialization of NIMBLE. It would be helpful to investigate if there is a conflict between the ADC and NIMBLE subsystems or any shared resources that might be causing this instability.