Hi there,
I am trying to use micro sd cards working on a particle photon. For that, I’d like to use the SdFat library.
There is a version of SdFat on the library cloud, but for a reason I need this specific version (GitHub - greiman/SdFat-Particle: SD library for Particle.io devices ) working on my photon.
Now, I am new to particle products (and Arduino), I am not quite sure how I can get it work.
So far I’ve tried
downloading the entire library and copy/paste everything into the folder that contains the main info file (the project folder) - and it works. However, it is probably not a good solution from the file management perspective.
copying and pasting everything into the ‘lib’ folder - does not work. When I try to include the SdFat.h file at the beginning of the .ino file, it cannot import the header.
So what would be the correct way to get the library working? Thank you.
Which version would you need?
If the Greiman-Repo is further on than the Particle repository it would be good to get the latest version uploaded which @whg usually does quite swiftly.
If you needed a previous version you can select them by clicking the (i) icon next to/below the library name
This will let you select one of the previously uploaded versions
However, in order to access a downloaded library it needs to sit in its own folder inside the ./lib
folder
e.g.
localLibTest
├───lib
│ └───SdFat
│ ├───examples
│ │ ├───#attic
│ │ │ ├───AnalogLogger
│ │ │ ├───append
│ │ │ ├───average
│ │ │ ├───BaseExtCaseTest
│ │ │ ├───benchSD
│ │ │ ├───bufstream
│ │ │ ├───cin_cout
│ │ │ ├───eventlog
│ │ │ ├───fgetsRewrite
│ │ │ ├───HelloWorld
│ │ │ ├───MiniSerial
│ │ │ ├───PrintBenchmarkSD
│ │ │ ├───readlog
│ │ │ ├───SdFatSize
│ │ │ ├───SD_Size
│ │ │ └───StreamParseInt
│ │ ├───AnalogBinLogger
│ │ ├───bench
│ │ ├───dataLogger
│ │ ├───DirectoryFunctions
│ │ ├───fgets
│ │ ├───formatting
│ │ ├───getline
│ │ ├───LongFileName
│ │ │ └───testFiles
│ │ ├───LowLatencyLogger
│ │ ├───LowLatencyLoggerADXL345
│ │ ├───LowLatencyLoggerMPU6050
│ │ ├───OpenNext
│ │ ├───PrintBenchmark
│ │ ├───QuickStart
│ │ ├───RawWrite
│ │ ├───ReadCsv
│ │ ├───ReadCsvArray
│ │ ├───ReadCsvStream
│ │ ├───ReadWrite
│ │ ├───rename
│ │ ├───SdFormatter
│ │ ├───SdInfo
│ │ ├───SoftwareSpi
│ │ ├───StdioBench
│ │ ├───STM32Test
│ │ ├───TeensySdioDemo
│ │ ├───Timestamp
│ │ ├───TwoCards
│ │ ├───VolumeFreeSpace
│ │ └───wipe
│ ├───extras
│ │ ├───AnalogBinLoggerExtras
│ │ │ ├───ADCdocs
│ │ │ └───bintocsv
│ │ ├───html
│ │ │ └───search
│ │ ├───MainPage
│ │ └───SdFatTestSuite
│ │ └───examples
│ │ ├───ATS_SD_File
│ │ ├───ATS_SD_Files
│ │ ├───ATS_SD_Seek
│ │ ├───fstreamTest
│ │ ├───istreamTest
│ │ ├───lfnSize
│ │ ├───lfnTest
│ │ ├───lfnTestCout
│ │ ├───ostreamTest
│ │ ├───StressTest
│ │ ├───TestMkdir
│ │ └───TestRmdir
│ └───src
│ ├───FatLib
│ ├───SdCard
│ └───SpiDriver
│ └───boards
└───src
If you still have problems you may want to remove the examples
folder(s) to prevent confusions with multiple .ino
files in the project.
jwonlee
January 25, 2021, 10:26am
3
@ScruffR Thank you for your fast reply.
After copying and pasting the library into the lib folder, here is the directory tree I have now.
├── README.md
├── lib
│ ├── LICENSE
│ ├── README.md
│ ├── library.properties
│ └── src
│ ├── ArduinoFiles.h
│ ├── ArduinoStream.h
│ ├── FatApiConstants.h
│ ├── FatFile.cpp
│ ├── FatFile.h
│ ├── FatFileLFN.cpp
│ ├── FatFilePrint.cpp
│ ├── FatFileSFN.cpp
│ ├── FatFileSystem.h
│ ├── FatLib.h
│ ├── FatLibConfig.h
│ ├── FatStructs.h
│ ├── FatVolume.cpp
│ ├── FatVolume.h
│ ├── FmtNumber.cpp
│ ├── FmtNumber.h
│ ├── FreeStack.h
│ ├── SdFat
│ │ ├── ArduinoFiles.h
│ │ ├── ArduinoStream.h
│ │ ├── FatApiConstants.h
│ │ ├── FatFile.h
│ │ ├── FatFileSystem.h
│ │ ├── FatLib.h
│ │ ├── FatLibConfig.h
│ │ ├── FatStructs.h
│ │ ├── FatVolume.h
│ │ ├── FmtNumber.h
│ │ ├── FreeStack.h
│ │ ├── SdFat.h
│ │ ├── SdFatConfig.h
│ │ ├── SdInfo.h
│ │ ├── SdSpi.h
│ │ ├── SdSpiCard.h
│ │ ├── SoftSPIParticle.h
│ │ ├── StdioStream.h
│ │ ├── SysCall.h
│ │ ├── SystemInclude.h
│ │ ├── bufstream.h
│ │ ├── fstream.h
│ │ ├── ios.h
│ │ ├── iostream.h
│ │ ├── istream.h
│ │ └── ostream.h
│ ├── SdFat.cpp
│ ├── SdFat.h
│ ├── SdFatConfig.h
│ ├── SdInfo.h
│ ├── SdSpi.h
│ ├── SdSpiCard.cpp
│ ├── SdSpiCard.h
│ ├── SdSpiParticle.cpp
│ ├── SoftSPIParticle.h
│ ├── StdioStream.cpp
│ ├── StdioStream.h
│ ├── SysCall.h
│ ├── SystemInclude.h
│ ├── bufstream.h
│ ├── fstream.cpp
│ ├── fstream.h
│ ├── ios.h
│ ├── iostream.h
│ ├── istream.cpp
│ ├── istream.h
│ ├── ostream.cpp
│ └── ostream.h
├── photon_firmware_1608729066706.bin
├── project.properties
├── src
│ ├── badaf_photon.cpp
│ ├── badaf_photon.ino
│ └── badaf_photon_backup.txt
├── target
│ └── 2.0.1
│ └── photon
│ ├── badaf_photon.bin
│ ├── badaf_photon.bin.crc_block
│ ├── badaf_photon.bin.no_crc
│ ├── badaf_photon.dfu
│ ├── badaf_photon.elf
│ ├── badaf_photon.hex
│ ├── badaf_photon.lst
│ ├── badaf_photon.map
│ └── obj
│ └── src
│ ├── module_info.o
│ ├── module_info.o.d
│ ├── newlib_stubs.o
│ ├── newlib_stubs.o.d
│ ├── user_export.o
│ ├── user_export.o.d
│ ├── user_module.o
│ └── user_module.o.d
└── workspace.code-workspace
I’ve removed the examples folder as you suggested.
Yet, when I try to flash an example file, it gives the following error
Any help would be immensely appreciated. Thank you!
ScruffR
January 25, 2021, 11:16am
4
You are still missing one hierarchical level.
vs.
jwonlee
January 25, 2021, 11:59am
5
@ScruffR Man, now it works! I can flash those example files successfully. Thank you!
I have one more question though, if you don’t mind…
While it seems to work now, the error message still persists,
Do you have any clue why I am still getting this message?
ScruffR
January 25, 2021, 12:09pm
6
IntelliSense is often getting a bit skittish about libraries and sometimes sees issues where there aren’t any.
Unfortunately that is a long standing issue @m_m has already ticked on the VS Code forum.
1 Like
m_m
January 25, 2021, 4:26pm
8
@jwonlee fwiw, we have intellisense troubleshooting steps over here:
hello particle workbench user
as you’ve no doubt learned, intellisense can be a bit finicky - it’ll flag non-issues in the “Problems” tab, report missing headers, etc. rest assured, if your code compiles you can ignore intellisense’s errors.
still, that’s not a UX we’re happy with so help us track down any lingering issues by reporting them here
before posting, here are some trouble-shooting steps you can try to get things back in shape as well as instructions on what info to incl…
usually closing and re-opening the project fixes things though i recognize that's far from idea.
system
Closed
July 27, 2021, 4:27am
9
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.