2 of 2 people found this helpful
I guess it depends on which PSoC 6 variant you are running. If yours has an SD Host (SD Host Controller), there are other forum threads about that. Mine is PSoC 63, so I had to find an SPI-driven solution.
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 ).
There is no official library support for SD Card file system yet. Our internal teams are working on providing a library support for the same.
Like CaKu_4284131 mentioned it depends on the device that you are using. If the device that you are using does not have a fixed SDHC block (for example - CY8CKIT-062-BLE) then you can refer to the example shared above by CaKu_4284131 and refer to this thread - Porting FatFs to PSoC 6. This uses SPI SCB block to interface with the SD Card.
If the device that you are using has a fixed SDHC block (for example - CY8CPROTO-062-4343W) then I have attached an example project for the same. The project reads all the directories and files present in the SD Card and displays it on the terminal. It then creates/opens a file and writes a line of text which is then read back and displayed on the terminal. The terminal output is as shown -
Please refer to this KBA for steps to import the project into ModusToolbox - Sharing My Eclipse Project
Please let me know if you have any queries.
Thanks and Regards,
Rakshith M B
MTB_FATFs_Example.zip 23.6 MB
Thank you for your posts. I'll try it out!