Esp32 sd card schematic. 2 in "ESP32 Hardware design guidelines".

Esp32 sd card schematic. Here is the code (part) I think that the problem is in SD.