P2/Photon2 and SdFat library

Question to the community - I have just started to try to use SdFat library with a P2 and Device OS 5.6.0. I am struggling to get the library to work and wondered before I dig in whether anyone else has either got this library working or hit a problem.
I did suddenly realise that I was using SPI1 for the TFT and had connected the SD card SPI to the same bus but had not changed the driver SPI object. Once I had rewired it - (with SD on SPI) [update this did work on SPI but only with the speed set to half speed / 25MHz. Now need to dig into how to specify SPI1 rather than SPI to SdFat.]

Thanks for reaching out. You're not alone in facing issues with the SdFat library – it's a great library but a bit dated and others have had similar challenges. I'll look into it and see if there are any known fixes.

@Colleen Thank you for getting back to me. Another idea is to replace the microSD card we have been using with SPI flash memory. These are now available as large as 32MB at reasonable cost which could be a replacement for the SD memory we have. Could the P2 flash file system be extended to use on external flash IC such as S25FL256LAGNFI010?

It will not be possible to use the built-in LittleFS flash file system with an external flash chip.

@rickkas7 Thank you for quickly closing that idea down. Could you recommend any other solutions to provide >32MB flash storage for the P2 on SPI bus please?

SdFat should work, if it doesn't it's probably a bug, and is probably fixable.

It's possible use LittleFS from user firmware, though it requires some effort to avoid conflicting with the built-in one. My LittleFS-RK library does not work on Gen 3, P2, or Photon 2, but I'm pretty sure someone in the community got it to work with some changes.

I found that Spiffs is a bit unreliable, so I wouldn't recommend that.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.