After some debugging, it seems that the first wait_ready function called during initialization (sdcard.c) exits due to timeout (also increasing the limit). I am pretty sure there is something wrong with the porting of some commands, but I am not sure what.
I am working on something similar. In my case I'm on a CY8C6347BZI-BLD53, so I need to use an SPI interface. I decided to use SDFilesystem (SDFileSystem - A re-written SDFileSystem library with improved... | Mbed) as a starting point. (Also, see SDBlockDevice - APIs | Mbed OS 5 Documentation.) I am currently porting it from C++/mbed to C/FreeRTOS+FAT (FreeRTOS+FAT DOS Compatible Embedded FAT File System ).
If you can use Mbed OS (Cypress products with Mbed OS - | Mbed ) (Cypress Mbed OS Documentation: Getting Started with PSoC 6 MCU and CYW43xxx in Mbed OS ), support for a FAT Filesystem on SD Card driven by SPI is built in.
I am running a FAT filesystem on SD card in an AdaLogger Shield ( https://www.adafruit.com/product/1141 ) (https://learn.adafruit.com/adafruit-data-logger-shield/overview ) on a PSoC® 6 BLE Pioneer Kit (CY8CKIT-062-BLE) (https://www.cypress.com/documentation/development-kitsboards/psoc-6-ble-pioneer-kit-cy8ckit-062-ble ) in ModusToolbox 2.0 (https://www.cypress.com/products/modustoolbox-software-environment ).
I am getting the same as Davide - "sdcard not ready" error.
I have also used the code linked above from the thread https://community.cypress.com/servlet/JiveServlet/download/228512-53153/SPI_SDcard_FatFS.cydsn.zip and I am getting the same result.
My setup is a PSoC 6 pioneer board and I broke off the microSD Card from the PSoC 6 Wi-Fi BT Prototyping Kit (CY8CPROTO-062-4343W). I have tried multiple SD Cards and cannot get any response from the MISO/DAT0 line. The signal seems to remain high regardless of the CMD I send. Also, the SPI slave select was changed from pin 9.3 to 9.4 for the pioneer board.
We have a new code example that uses FatFS on MicroSD card. Here is the link: