Skip to content

Conversation

@lucasssvaz
Copy link
Member

Description of Change

This pull request introduces significant improvements to peripheral resource management and validation testing in the ESP32 codebase. The main focus is on ensuring that both automatic and manual deinitialization (deinit) of peripherals is robustly tested and that resource cleanup, especially for DMA buffers and ADC drivers, is handled correctly. The changes also enhance test coverage for manual deinit paths and update test infrastructure to reflect these improvements.

Peripheral Resource Management Improvements:

  • Added cache line alignment for DMA buffers and conversion frame sizes on ESP32-P4 targets to ensure compatibility with DMA and cache requirements, using heap_caps_aligned_alloc for buffer allocation. [1] [2]
  • Improved cleanup logic in ADC continuous mode: added guards against double cleanup, ensured calibration handles are properly released, and clarified responsibilities between the ADC driver and the peripheral manager. [1] [2]
  • Ensured all dynamically allocated DMA buffers are freed after use or on error, preventing memory leaks in ADC continuous read routines. [1] [2]
  • Updated analogContinuousDeinit to always clear used pins through the peripheral manager and to free the result buffer, improving robustness of deinitialization.

Validation Test Enhancements:

  • Extended validation tests (periman.ino) to include explicit manual deinit tests for SigmaDelta, LEDC, RMT, I2S, I2C, SPI, and ADC Continuous peripherals. Each test now verifies that Serial1 can be restored after manual deinit, ensuring that the peripheral manager and driver cleanup are reliable. [1] [2] [3] [4] [5] [6] [7]
  • Refactored test setup and teardown to better distinguish between auto-detach (via pinMode) and manual deinit test paths. [1] [2]

Test Infrastructure Updates:

  • Updated the Python validation script (test_periman.py) to dynamically track which peripherals have manual deinit tests, parse and match test output accordingly, and provide clearer logging and error messages. This ensures all expected tests are executed and validated. [1] [2]
  • Minor cleanup in test configuration files (ci.yml) for platform and target definitions. [1] [2]

Miscellaneous:

  • Added a Wokwi diagram for the ESP32-H2 SD card test setup.

These changes collectively improve the reliability and maintainability of peripheral resource management, and provide stronger guarantees through comprehensive automated testing.


References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21]

Test Scenarios

Tested locally

@lucasssvaz lucasssvaz self-assigned this Dec 11, 2025
@lucasssvaz lucasssvaz requested review from a team and P-R-O-C-H-Y as code owners December 11, 2025 15:46
@lucasssvaz lucasssvaz requested a review from me-no-dev December 11, 2025 15:46
@github-actions
Copy link
Contributor

Messages
📖 🎉 Good Job! All checks are passing!

👋 Hello lucasssvaz, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 31a2ae6

@lucasssvaz lucasssvaz added Type: CI & Testing Related to continuous integration, automated testing, or test infrastructure. CI Failure Expected For PRs where CI failure is expected labels Dec 11, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

Test Results

 90 files   90 suites   27m 57s ⏱️
 66 tests  56 ✅ 0 💤 10 ❌
675 runs  655 ✅ 0 💤 20 ❌

For more details on these failures, see this check.

Results for commit 31a2ae6.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32C5💚 -3140💚 -0.100.00000.000.00
ESP32P4💚 -3520💚 -0.110.00000.000.00
ESP32S3000.000.00000.000.00
ESP32S2💚 -2800💚 -0.100.00000.000.00
ESP32C3💚 -3600💚 -0.120.00000.000.00
ESP32C6💚 -3320💚 -0.120.00000.000.00
ESP32H2💚 -3140💚 -0.110.00000.000.00
ESP32💚 -280⚠️ +4💚 -0.090.00000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32C5ESP32P4ESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/ArduinoOTA/examples/BasicOTA0000--000000--00
libraries/AsyncUDP/examples/AsyncUDPClient0000--000000--00
libraries/AsyncUDP/examples/AsyncUDPMulticastServer0000--000000--00
libraries/AsyncUDP/examples/AsyncUDPServer0000--000000--00
libraries/BLE/examples/Beacon_Scanner0000----00000000
libraries/BLE/examples/Client0000----00000000
libraries/BLE/examples/Client_multiconnect0000----00000000
libraries/BLE/examples/Client_secure_static_passkey0000----00000000
libraries/BLE/examples/EddystoneTLM_Beacon0000----00000000
libraries/BLE/examples/EddystoneURL_Beacon0000----00000000
libraries/BLE/examples/Notify0000----00000000
libraries/BLE/examples/Scan0000----00000000
libraries/BLE/examples/Server0000----00000000
libraries/BLE/examples/Server_multiconnect0000----00000000
libraries/BLE/examples/Server_secure_authorization00------000000--
libraries/BLE/examples/Server_secure_static_passkey0000----00000000
libraries/BLE/examples/UART0000----00000000
libraries/BLE/examples/Write0000----00000000
libraries/BLE/examples/iBeacon0000----00000000
libraries/DNSServer/examples/CaptivePortal0000--000000--00
libraries/EEPROM/examples/eeprom_class0000--0000000000
libraries/EEPROM/examples/eeprom_extra0000--0000000000
libraries/EEPROM/examples/eeprom_write0000--0000000000
libraries/ESP32/examples/AnalogOut/LEDCFade0000--0000000000
libraries/ESP32/examples/AnalogOut/LEDCGammaFade0000------0000--
libraries/ESP32/examples/AnalogOut/LEDCSingleChannel0000--0000000000
libraries/ESP32/examples/AnalogOut/LEDCSoftwareFade0000--0000000000
libraries/ESP32/examples/AnalogOut/SigmaDelta0000--0000000000
libraries/ESP32/examples/AnalogOut/ledcFrequency0000--0000000000
libraries/ESP32/examples/AnalogOut/ledcWrite_RGB0000--0000000000
libraries/ESP32/examples/AnalogRead0000--00000000⚠️ +40
libraries/ESP32/examples/AnalogReadContinuous💚 -3140💚 -3520--💚 -2800💚 -3600💚 -3320💚 -3140💚 -2800
libraries/ESP32/examples/ArduinoStackSize0000--0000000000
libraries/ESP32/examples/ArduinoWaitTimeBeforeStartingSketch0000--0000000000
libraries/ESP32/examples/CI/CIBoardsTest0000--0000000000
libraries/ESP32/examples/ChipID/GetChipID0000--0000000000
libraries/ESP32/examples/DeepSleep/TimerWakeUp0000--000000--00
libraries/ESP32/examples/FreeRTOS/BasicMultiThreading0000--0000000000
libraries/ESP32/examples/FreeRTOS/Mutex0000--0000000000
libraries/ESP32/examples/FreeRTOS/Queue0000--0000000000
libraries/ESP32/examples/FreeRTOS/Semaphore0000--0000000000
libraries/ESP32/examples/GPIO/BlinkRGB0000--0000000000
libraries/ESP32/examples/GPIO/FunctionalInterrupt0000--0000000000
libraries/ESP32/examples/GPIO/FunctionalInterruptLambda0000--0000000000
libraries/ESP32/examples/GPIO/FunctionalInterruptStruct0000--0000000000
libraries/ESP32/examples/GPIO/GPIOInterrupt0000--0000000000
libraries/ESP32/examples/HWCDC_Events0000----000000--
libraries/ESP32/examples/MacAddress/GetMacAddress0000--0000000000
libraries/ESP32/examples/RMT/Legacy_RMT_Driver_Compatible0000--0000000000
libraries/ESP32/examples/RMT/RMTCallback0000--0000000000
libraries/ESP32/examples/RMT/RMTLoopback0000--0000000000
libraries/ESP32/examples/RMT/RMTReadXJT0000--0000000000
libraries/ESP32/examples/RMT/RMTWrite_RGB_LED0000--0000000000
libraries/ESP32/examples/RMT/RMT_CPUFreq_Test0000--0000000000
libraries/ESP32/examples/RMT/RMT_EndOfTransmissionState0000--0000000000
libraries/ESP32/examples/RMT/RMT_LED_Blink0000--0000000000
libraries/ESP32/examples/ResetReason/ResetReason0000--0000000000
libraries/ESP32/examples/ResetReason/ResetReason20000--0000000000
libraries/ESP32/examples/Serial/BaudRateDetect_Demo0000--0000000000
libraries/ESP32/examples/Serial/OnReceiveError_BREAK_Demo0000--0000000000
libraries/ESP32/examples/Serial/OnReceive_Demo0000--0000000000
libraries/ESP32/examples/Serial/RS485_Echo_Demo0000--0000000000
libraries/ESP32/examples/Serial/RxFIFOFull_Demo0000--0000000000
libraries/ESP32/examples/Serial/RxTimeout_Demo0000--0000000000
libraries/ESP32/examples/Serial/Serial_All_CPU_Freqs0000--0000000000
libraries/ESP32/examples/Serial/Serial_STD_Func_OnReceive0000--0000000000
libraries/ESP32/examples/Serial/onReceiveExample0000--0000000000
libraries/ESP32/examples/Template/ExampleTemplate0000--0000000000
libraries/ESP32/examples/Time/SimpleTime0000--000000--00
libraries/ESP32/examples/Timer/RepeatTimer0000--0000000000
libraries/ESP32/examples/Timer/WatchdogTimer0000--0000000000
libraries/ESP_I2S/examples/ES8388_loopback0000--0000000000
libraries/ESP_I2S/examples/Simple_tone0000--0000000000
libraries/ESP_NOW/examples/ESP_NOW_Broadcast_Master00----000000--00
libraries/ESP_NOW/examples/ESP_NOW_Broadcast_Slave00----000000--00
libraries/ESP_NOW/examples/ESP_NOW_Network00----000000--00
libraries/ESP_NOW/examples/ESP_NOW_Serial00----000000--00
libraries/ESPmDNS/examples/mDNS-SD_Extended0000--000000--00
libraries/ESPmDNS/examples/mDNS_Web_Server0000--000000--00
libraries/Ethernet/examples/ETH_W5500_Arduino_SPI0000--0000000000
libraries/Ethernet/examples/ETH_W5500_IDF_SPI0000--0000000000
libraries/Ethernet/examples/ETH_WIFI_BRIDGE0000--000000--00
libraries/FFat/examples/FFat_Test0000--0000000000
libraries/FFat/examples/FFat_time0000--000000--00
libraries/HTTPClient/examples/Authorization0000--000000--00
libraries/HTTPClient/examples/BasicHttpClient0000--000000--00
libraries/HTTPClient/examples/BasicHttpsClient0000--000000--00
libraries/HTTPClient/examples/CustomHeaders0000--000000--00
libraries/HTTPClient/examples/HTTPClientEnterprise00----000000--00
libraries/HTTPClient/examples/ReuseConnection0000--000000--00
libraries/HTTPClient/examples/StreamHttpClient0000--000000--00
libraries/HTTPUpdate/examples/httpUpdate0000--000000--00
libraries/HTTPUpdate/examples/httpUpdateSPIFFS0000--000000--00
libraries/HTTPUpdate/examples/httpUpdateSecure0000--000000--00
libraries/HTTPUpdateServer/examples/WebUpdater0000--000000--00
libraries/Hash/examples/HEX0000--0000000000
libraries/Hash/examples/MD50000--0000000000
libraries/Hash/examples/PBKDF2_HMAC0000--0000000000
libraries/Hash/examples/SHA10000--0000000000
libraries/Hash/examples/SHA20000--0000000000
libraries/Hash/examples/SHA30000--0000000000
libraries/Hash/examples/SHA3Stream0000--0000000000
libraries/Insights/examples/DiagnosticsSmokeTest00----000000--00
libraries/Insights/examples/MinimalDiagnostics00----000000--00
libraries/LittleFS/examples/LITTLEFS_test0000--0000000000
libraries/LittleFS/examples/LITTLEFS_time0000--000000--00
libraries/Matter/examples/MatterColorLight00----0000000000
libraries/Matter/examples/MatterCommissionTest00----0000000000
libraries/Matter/examples/MatterComposedLights00----0000000000
libraries/Matter/examples/MatterContactSensor00----0000000000
libraries/Matter/examples/MatterDimmableLight00----0000000000
libraries/Matter/examples/MatterDimmablePlugin00----0000000000
libraries/Matter/examples/MatterEnhancedColorLight00----0000000000
libraries/Matter/examples/MatterEvents00----0000000000
libraries/Matter/examples/MatterFan00----0000000000
libraries/Matter/examples/MatterHumiditySensor00----0000000000
libraries/Matter/examples/MatterLambdaSingleCallbackManyEPs00----0000000000
libraries/Matter/examples/MatterMinimum00----0000000000
libraries/Matter/examples/MatterOccupancySensor00----0000000000
libraries/Matter/examples/MatterOnIdentify00----0000000000
libraries/Matter/examples/MatterOnOffLight00----0000000000
libraries/Matter/examples/MatterOnOffPlugin00----0000000000
libraries/Matter/examples/MatterPressureSensor00----0000000000
libraries/Matter/examples/MatterRainSensor00----0000000000
libraries/Matter/examples/MatterSimpleWidowsBlind00----0000000000
libraries/Matter/examples/MatterSmartButton00----0000000000
libraries/Matter/examples/MatterTemperatureControlledCabinet00----0000000000
libraries/Matter/examples/MatterTemperatureControlledCabinetLevels00----0000000000
libraries/Matter/examples/MatterTemperatureLight00----0000000000
libraries/Matter/examples/MatterTemperatureSensor00----0000000000
libraries/Matter/examples/MatterThermostat00----0000000000
libraries/Matter/examples/MatterWaterFreezeDetector00----0000000000
libraries/Matter/examples/MatterWaterLeakDetector00----0000000000
libraries/Matter/examples/MatterWindowCovering00----0000000000
libraries/NetBIOS/examples/ESP_NBNST0000--000000--00
libraries/NetworkClientSecure/examples/WiFiClientInsecure0000--000000--00
libraries/NetworkClientSecure/examples/WiFiClientPSK0000--000000--00
libraries/NetworkClientSecure/examples/WiFiClientSecure0000--000000--00
libraries/NetworkClientSecure/examples/WiFiClientSecureEnterprise00----000000--00
libraries/NetworkClientSecure/examples/WiFiClientSecureProtocolUpgrade0000--000000--00
libraries/NetworkClientSecure/examples/WiFiClientShowPeerCredentials0000--000000--00
libraries/NetworkClientSecure/examples/WiFiClientTrustOnFirstUse0000--000000--00
libraries/OpenThread/examples/CLI/COAP/coap_lamp00--------0000--
libraries/OpenThread/examples/CLI/COAP/coap_switch00--------0000--
libraries/OpenThread/examples/CLI/SimpleCLI00--------0000--
libraries/OpenThread/examples/CLI/SimpleNode00--------0000--
libraries/OpenThread/examples/CLI/SimpleThreadNetwork/ExtendedRouterNode00--------0000--
libraries/OpenThread/examples/CLI/SimpleThreadNetwork/LeaderNode00--------0000--
libraries/OpenThread/examples/CLI/SimpleThreadNetwork/RouterNode00--------0000--
libraries/OpenThread/examples/CLI/ThreadScan00--------0000--
libraries/OpenThread/examples/CLI/onReceive00--------0000--
libraries/OpenThread/examples/Native/SimpleThreadNetwork/LeaderNode00--------0000--
libraries/OpenThread/examples/Native/SimpleThreadNetwork/RouterNode00--------0000--
libraries/PPP/examples/PPP_Basic0000--0000000000
libraries/PPP/examples/PPP_WIFI_BRIDGE0000--000000--00
libraries/Preferences/examples/Prefs2Struct0000--0000000000
libraries/Preferences/examples/StartCounter0000--0000000000
libraries/RainMaker/examples/RMakerCustom00----000000----
libraries/RainMaker/examples/RMakerCustomAirCooler00----000000----
libraries/RainMaker/examples/RMakerSonoffDualR300----000000----
libraries/RainMaker/examples/RMakerSwitch00----000000----
libraries/SD/examples/SD_Test0000--0000000000
libraries/SD/examples/SD_time0000--000000--00
libraries/SPI/examples/SPI_Multiple_Buses0000--0000000000
libraries/SPIFFS/examples/SPIFFS_Test0000--0000000000
libraries/SPIFFS/examples/SPIFFS_time0000--000000--00
libraries/TFLiteMicro/examples/hello_world0000--0000000000
libraries/Ticker/examples/Blinker0000--0000000000
libraries/Ticker/examples/TickerBasic0000--0000000000
libraries/Ticker/examples/TickerParameter0000--0000000000
libraries/Update/examples/AWS_S3_OTA_Update0000--000000--00
libraries/Update/examples/HTTPS_OTA_Update0000--000000--00
libraries/Update/examples/HTTP_Client_AES_OTA_Update0000--000000--00
libraries/Update/examples/HTTP_Server_AES_OTA_Update0000--000000--00
libraries/Update/examples/OTAWebUpdater0000--000000--00
libraries/Update/examples/SD_Update0000--0000000000
libraries/WebServer/examples/AdvancedWebServer0000--000000--00
libraries/WebServer/examples/ChunkWriting0000--000000--00
libraries/WebServer/examples/FSBrowser0000--000000--00
libraries/WebServer/examples/Filters0000--000000--00
libraries/WebServer/examples/HelloServer0000--000000--00
libraries/WebServer/examples/HttpAdvancedAuth0000--000000--00
libraries/WebServer/examples/HttpAuthCallback0000--000000--00
libraries/WebServer/examples/HttpAuthCallbackInline0000--000000--00
libraries/WebServer/examples/HttpBasicAuth0000--000000--00
libraries/WebServer/examples/HttpBasicAuthSHA10000--000000--00
libraries/WebServer/examples/HttpBasicAuthSHA1orBearerToken0000--000000--00
libraries/WebServer/examples/Middleware00----000000--00
libraries/WebServer/examples/MultiHomedServers0000--000000--00
libraries/WebServer/examples/PathArgServer0000--000000--00
libraries/WebServer/examples/SDWebServer0000--000000--00
libraries/WebServer/examples/SimpleAuthentification0000--000000--00
libraries/WebServer/examples/UploadHugeFile0000--000000--00
libraries/WebServer/examples/WebServer0000--000000--00
libraries/WebServer/examples/WebUpdate0000--000000--00
libraries/WiFi/examples/FTM/FTM_Initiator0000--000000--00
libraries/WiFi/examples/FTM/FTM_Responder0000--000000--00
libraries/WiFi/examples/SimpleWiFiServer0000--000000--00
libraries/WiFi/examples/WPS00----000000--00
libraries/WiFi/examples/WiFiAccessPoint0000--000000--00
libraries/WiFi/examples/WiFiBlueToothSwitch00------0000--00
libraries/WiFi/examples/WiFiClient0000--000000--00
libraries/WiFi/examples/WiFiClientBasic0000--000000--00
libraries/WiFi/examples/WiFiClientConnect0000--000000--00
libraries/WiFi/examples/WiFiClientEnterprise00----000000--00
libraries/WiFi/examples/WiFiClientEvents0000--000000--00
libraries/WiFi/examples/WiFiClientStaticIP0000--000000--00
libraries/WiFi/examples/WiFiExtender0000--000000--00
libraries/WiFi/examples/WiFiIPv60000--000000--00
libraries/WiFi/examples/WiFiMulti0000--000000--00
libraries/WiFi/examples/WiFiMultiAdvanced0000--000000--💚 -160
libraries/WiFi/examples/WiFiScan0000--000000--00
libraries/WiFi/examples/WiFiScanAsync0000--000000--00
libraries/WiFi/examples/WiFiScanDualAntenna0000--000000--00
libraries/WiFi/examples/WiFiScanTime0000--000000--00
libraries/WiFi/examples/WiFiSmartConfig00----000000--00
libraries/WiFi/examples/WiFiTelnetToSerial0000--000000--00
libraries/WiFi/examples/WiFiUDPClient0000--000000--00
libraries/WiFiProv/examples/WiFiProv00----000000--00
libraries/Wire/examples/WireMaster0000--0000000000
libraries/Wire/examples/WireScan0000--0000000000
libraries/Wire/examples/WireSlave0000--0000000000
libraries/Wire/examples/WireSlaveFunctionalCallback0000--0000000000
libraries/Zigbee/examples/Zigbee_Analog_Input_Output00----0000000000
libraries/Zigbee/examples/Zigbee_Binary_Input_Output00--------0000--
libraries/Zigbee/examples/Zigbee_CarbonDioxide_Sensor00--------0000--
libraries/Zigbee/examples/Zigbee_Color_Dimmable_Light00--------0000--
libraries/Zigbee/examples/Zigbee_Color_Dimmer_Switch00----0000000000
libraries/Zigbee/examples/Zigbee_Contact_Switch00--------0000--
libraries/Zigbee/examples/Zigbee_Dimmable_Light00--------0000--
libraries/Zigbee/examples/Zigbee_Electrical_AC_Sensor00----00000000⚠️ +40
libraries/Zigbee/examples/Zigbee_Electrical_AC_Sensor_MultiPhase00----00000000⚠️ +40
libraries/Zigbee/examples/Zigbee_Electrical_DC_Sensor00--------0000--
libraries/Zigbee/examples/Zigbee_Fan_Control00----0000000000
libraries/Zigbee/examples/Zigbee_Gateway00----0000----00
libraries/Zigbee/examples/Zigbee_Illuminance_Sensor00--------0000--
libraries/Zigbee/examples/Zigbee_Multistate_Input_Output00----0000000000
libraries/Zigbee/examples/Zigbee_OTA_Client00--------0000--
libraries/Zigbee/examples/Zigbee_Occupancy_Sensor00--------0000--
libraries/Zigbee/examples/Zigbee_On_Off_Light00--------0000--
libraries/Zigbee/examples/Zigbee_On_Off_MultiSwitch00----0000000000
libraries/Zigbee/examples/Zigbee_On_Off_Switch00----0000000000
libraries/Zigbee/examples/Zigbee_PM25_Sensor00--------0000--
libraries/Zigbee/examples/Zigbee_Power_Outlet00----0000000000
libraries/Zigbee/examples/Zigbee_Pressure_Flow_Sensor00--------0000--
libraries/Zigbee/examples/Zigbee_Range_Extender00----0000000000
libraries/Zigbee/examples/Zigbee_Scan_Networks00--------0000--
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy00--------0000--
libraries/Zigbee/examples/Zigbee_Temperature_Sensor00--------0000--
libraries/Zigbee/examples/Zigbee_Thermostat00----0000000000
libraries/Zigbee/examples/Zigbee_Vibration_Sensor00--------0000--
libraries/Zigbee/examples/Zigbee_Wind_Speed_Sensor00--------0000--
libraries/Zigbee/examples/Zigbee_Window_Covering00--------0000--
tests/validation/periman----------------
libraries/ESP32/examples/DeepSleep/TouchWakeUp--00--00------00
libraries/ESP32/examples/TWAI/TWAIreceive--00--0000000000
libraries/ESP32/examples/TWAI/TWAItransmit--00--0000000000
libraries/ESP32/examples/Touch/TouchButton--00--00------00
libraries/ESP32/examples/Touch/TouchInterrupt--00--00------00
libraries/ESP32/examples/Touch/TouchRead--00--00------00
libraries/ESP_HostedOTA/examples/ESP_HostedOTA--00------------
libraries/ESP_I2S/examples/Record_to_WAV--00----------00
libraries/ESP_SR/examples/Basic--00------------
libraries/Ethernet/examples/ETH_TLK110--00----------00
libraries/SD_MMC/examples/SD2USBMSC--00------------
libraries/SD_MMC/examples/SDMMC_Test--00----------00
libraries/SD_MMC/examples/SDMMC_time--00----------00
libraries/USB/examples/CompositeDevice--00--00--------
libraries/USB/examples/ConsumerControl--00--00--------
libraries/USB/examples/CustomHIDDevice--00--00--------
libraries/USB/examples/FirmwareMSC--00--00--------
libraries/USB/examples/Gamepad--00--00--------
libraries/USB/examples/HIDVendor--00--00--------
libraries/USB/examples/Keyboard/KeyboardLogout--00--00--------
libraries/USB/examples/Keyboard/KeyboardMessage--00--00--------
libraries/USB/examples/Keyboard/KeyboardReprogram--00--00--------
libraries/USB/examples/Keyboard/KeyboardSerial--00--00--------
libraries/USB/examples/KeyboardAndMouseControl--00--00--------
libraries/USB/examples/MIDI/MidiController--00--00--------
libraries/USB/examples/MIDI/MidiInterface--00--00--------
libraries/USB/examples/MIDI/MidiMusicBox--00--00--------
libraries/USB/examples/MIDI/ReceiveMidi--00--00--------
libraries/USB/examples/Mouse/ButtonMouseControl--00--00--------
libraries/USB/examples/SystemControl--00--00--------
libraries/USB/examples/USBMSC--00--00--------
libraries/USB/examples/USBSerial--00--00--------
libraries/USB/examples/USBVendor--00--00--------
libraries/ESP32/examples/Camera/CameraWebServer------00------00
ESP32/examples/Camera/CameraWebServer (2)------00------00
libraries/ESP32/examples/DeepSleep/ExternalWakeUp------00------00
libraries/BluetoothSerial/examples/DiscoverConnect--------------00
libraries/BluetoothSerial/examples/GetLocalMAC--------------00
libraries/BluetoothSerial/examples/SerialToSerialBT--------------00
libraries/BluetoothSerial/examples/SerialToSerialBTM--------------00
libraries/BluetoothSerial/examples/SerialToSerialBT_Legacy--------------00
libraries/BluetoothSerial/examples/SerialToSerialBT_SSP--------------00
libraries/BluetoothSerial/examples/bt_classic_device_discovery--------------00
libraries/BluetoothSerial/examples/bt_remove_paired_devices--------------00
libraries/ESP32/examples/DeepSleep/SmoothBlink_ULP_Code--------------00
libraries/Ethernet/examples/ETH_LAN8720--------------00
libraries/SimpleBLE/examples/SimpleBleDevice--------------00

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances peripheral resource management testing and fixes issues in ADC continuous mode for ESP32 targets. The changes add comprehensive manual deinitialization tests for various peripherals and improve DMA buffer handling for cache-aligned targets like ESP32-P4.

  • Added manual deinit test paths for SigmaDelta, LEDC, RMT, I2S, I2C, SPI, and ADC_Continuous peripherals
  • Improved ADC continuous mode with cache-aligned DMA buffer allocation and proper memory cleanup
  • Added Wokwi simulation diagrams for ESP32-P4 and ESP32-H2 SD card test setups

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/validation/sdcard/diagram.esp32p4.json New Wokwi diagram for ESP32-P4 SD card test configuration with two SD cards
tests/validation/sdcard/diagram.esp32h2.json New Wokwi diagram for ESP32-H2 SD card test configuration
tests/validation/sdcard/ci.yml CI configuration for SD card tests (disabled for hardware and QEMU)
tests/validation/periman/test_periman.py Enhanced Python test script to track and validate both auto-detach and manual deinit tests
tests/validation/periman/periman.ino Added manual deinit test cases for 7 peripherals to verify proper resource cleanup
tests/validation/periman/ci.yml Removed ESP32-P4 target exclusion from periman tests
cores/esp32/esp32-hal-adc.c Improved ADC continuous mode with cache-aligned DMA buffers, guard against double-cleanup, and proper memory management

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Now test manual deinit path
setup_test("ADC_Continuous_deinit", ADC1_DEFAULT, ADC2_DEFAULT);
test_executed = false; // Skip the pinMode test in teardown
adc_coversion_done = false; // Reset flag
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error: 'coversion' should be 'conversion'. The variable name should be adc_conversion_done instead of adc_coversion_done.

Copilot uses AI. Check for mistakes.
}

// Don't call perimanClearPinBus() here - the peripheral manager already handles it
// This callback is only responsible for cleaning up the ADC driver itself
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says "This callback is only responsible for cleaning up the ADC driver itself" but the callback doesn't handle freeing the adc_result buffer. Consider updating the comment to clarify that the caller (analogContinuousDeinit) is responsible for freeing adc_result, or alternatively document why this separation of responsibilities exists.

Suggested change
// This callback is only responsible for cleaning up the ADC driver itself
// This callback is only responsible for cleaning up the ADC driver and calibration handles.
// It does NOT free the adc_result buffer; the caller (e.g., analogContinuousDeinit) is responsible for freeing adc_result.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Failure Expected For PRs where CI failure is expected Type: CI & Testing Related to continuous integration, automated testing, or test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant