diff --git a/cores/esp32/esp32-hal-psram.c b/cores/esp32/esp32-hal-psram.c
index 44612562977..de5b7c0071f 100644
--- a/cores/esp32/esp32-hal-psram.c
+++ b/cores/esp32/esp32-hal-psram.c
@@ -67,8 +67,10 @@ bool psramInit(){
         spiramFailed = true;
         log_w("PSRAM init failed!");
 #if CONFIG_IDF_TARGET_ESP32
-        pinMatrixOutDetach(16, false, false);
-        pinMatrixOutDetach(17, false, false);
+        if (pkg_ver != EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4) {
+            pinMatrixOutDetach(16, false, false);
+            pinMatrixOutDetach(17, false, false);
+        }
 #endif
         return false;
     }