Thanks for the answer
I solved the problem
it was actually a problem with the pins
I changed the assignment of the pins in pins_arduino.h file and it worked
Unfortunately, I have no pinout for this board so i used the ESP-IDF Programming Guide to find the right pins for SPI
The return repeats the if loop until a card is present and can be read