- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am working on a master thesis project where basically I need to create a stand alone datalogger. While connection to the different sensors is not an issue, I cannot find an "easy" way to save the data somewhere and read it on a PC (best would be to generate a csv file).
I am trying now to save the data on a SD card using SPI communication and FatFs. However, it seems there is no code working "out of the box" and my experience is very limited, so I ask for help to the community.
I have found the following GitHub
GitHub - hackingchips/PSoC_FatFs: Port of ELM-CHAN FatFs library to Cypress PSoc microcontrollers.
I've tried to modify the sdcard.c and main file (my files in attachment) to match PSoC 6 macros, but I always get a "sdcard not ready" error.
I have also tried to use the workaround code given in emFile component for PSoC 6 . I can read the files on the card, but the code does not include any writing capability and implement it myself is out of my league.
Can I get help from somebody? Or perhaps, does anybody already have a working code?
BTW, I am using Clicker 2 for PSoC® 6 with a microSD click.
Thanks a lot
Davide
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
See:
FATFileSystem - APIs | Mbed OS 5 Documentation
and
SDBlockDevice - APIs | Mbed OS 5 Documentation
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 ).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 ).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
See:
FATFileSystem - APIs | Mbed OS 5 Documentation
and
SDBlockDevice - APIs | Mbed OS 5 Documentation
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 ).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please refer to this thread - Re: SD Card Library for PSoC 6 using PSoC Creator 4.3
Hope this helps,
Thanks and Regards,
Rakshith M B
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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.
Regards,
Jordan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
We have a new code example that uses FatFS on MicroSD card. Here is the link: