greiman / sdfat-particle Goto Github PK
View Code? Open in Web Editor NEWSD library for Particle.io devices
License: GNU General Public License v3.0
SD library for Particle.io devices
License: GNU General Public License v3.0
Particle Version: 1.47.0
Firmware: 1.4.0
When trying to build from particle cli with:
particle compile xenon sd_test.ino SdFat-Particle-master/src/* --saveTo bin/firmware.bin
the compilation is failing with the above error message. Not sure if anyone else is experiencing this issue when trying to build. The library works fine from the Particle.io Web IDE, but when I try to build with the CLI I'm not able to compile.
My .ino file (doesn't seem to make it here)
#include "SdFat.h"
void setup() {
Serial.begin(9600);
}
void loop() {
}
All I've done is clone the repository and attempt to build directly from that using the CLI. Is there anything in the configuration or compilation process that might be missing here?
We are happy to have you on board and appreciate your work very much.
Just to prevent confusion for users, could you add a call to Particle.process()
in places where your code may stay for more than 10sec, which would otherwise cause the cloud to drop?
e.g. errorHalt()
features while(1);
which prevents the Particle devices from being reflashed without Safe Mode.
But with while(1) Particle.process();
things would be fine.
Also in your demos you've got something like
while (!Serial) { }
// or
while (Serial.read() <= 0) { }
Where this would keep the cloud connection alive
while (!Serial) Particle.process();
// or
while (Serial.read() <= 0) Particle.process();
Would be great if you could change that.
Thanks
@greiman, can you please upgrade this (fantastic) library to the new Particle Libraries v2.0 format? Thanks!
Fails to compile when selecting the alternate SPI configuration (on the Electron).
/workspace//src/podule.cpp:31:11: error: no matching function for call to 'SdFat::SdFat(int)' SYSTEM_THREAD(ENABLED); ^ /workspace//src/podule.cpp:31:11: note: candidates are: In file included from /workspace//src/podule.cpp:13:0: /workspace/lib/SdFat/src/SdFat.h:267:7: note: SdFat::SdFat() class SdFat : public SdFatBase { ^ /workspace/lib/SdFat/src/SdFat.h:267:7: note: candidate expects 0 arguments, 1 provided /workspace/lib/SdFat/src/SdFat.h:267:7: note: constexpr SdFat::SdFat(const SdFat&) /workspace/lib/SdFat/src/SdFat.h:267:7: note: no known conversion for argument 1 from 'int' to 'const SdFat&' /workspace/lib/SdFat/src/SdFat.h:267:7: note: constexpr SdFat::SdFat(SdFat&&) /workspace/lib/SdFat/src/SdFat.h:267:7: note: no known conversion for argument 1 from 'int' to 'SdFat&&'
I'm using your code on a particle elctron and i can write to a file using your exmaple code.
But as soon as i use myFile.close() - the code stop executing any further.
` if (!myFile.open("test.txt", O_RDWR | O_CREAT | O_AT_END)) { // removed....
sd.errorHalt("opening test.txt for write failed");
}
// if the file opened okay, write to it:
Serial.print("Writing to test.txt...");
myFile.println("testing 1, 2, 3.");
myFile.printf("fileSize: %d\n", myFile.fileSize());
Particle.publish("SD","Written data",360,PRIVATE);
// close the file:
myFile.close();`
Code does not go past this point.
Any ideas on why the close() would cause the process to stop.
The data is written to the file fine .
Thanks
John
Hi, I am trying to use the library with the redbear duo board and the arduino IDE. Is there a straightforward way to do that ?
At this point, some files are not found during compilation and the examples do not show up in the example menu.
Thanks in advance!
(Arduino IDE 1.6.7)
expected unqualified-id before numeric constant
Unable to open 'sockets.h': Unable to read file '..\third_party\lwip\lwip\src\include\lwip\sockets.h' (Error: Unable to resolve non-existing file '..\third_party\lwip\lwip\src\include\lwip\sockets.h').
Hi,
I'm new to platform IO and Arduino. I am trying to compile code in platform IO it fails but the same project works in Arduino.
I get the below error -
`
^~~~~~~~~~~
In file included from src\ProteusBoard\SdFat\SdFat.h:26:0,
from src\ProteusBoard\SdFat\SdFatBase.cpp:20:
src\ProteusBoard\SdFat\SdSpiCard.h:29:10: fatal error: SdSpi.h: No such file or directory
*************************************************************** `
Help to solve is appreciated
@greiman, it seems that the Particle IDE is having issues with the size of the library and I suspect it is due to the size of the documentation. This prevents the library from actually loading in the IDE. Anything you can do?
I've moved the files from firmware/
into firmware/user/libraries/SdFat
. To test it, I created a new application firmware/user/applications/sdfat-test
and copied one of the examples in application.cpp
there.
I'm getting these errors when compiling via make PLATFORM=electron APP=sdfat-test
:
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `File::write(unsigned char const*, unsigned int)':
PROJECT_DIR/firmware/user/./libraries/SdFat/ArduinoFiles.h:244: undefined reference to `FatFile::write(void const*, unsigned int)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `FatFile::write(unsigned char)':
PROJECT_DIR/firmware/user/./libraries/SdFat/FatFile.h:893: undefined reference to `FatFile::write(void const*, unsigned int)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `File::flush()':
PROJECT_DIR/firmware/user/./libraries/SdFat/ArduinoFiles.h:155: undefined reference to `FatFile::sync()'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `File::peek()':
PROJECT_DIR/firmware/user/./libraries/SdFat/ArduinoFiles.h:176: undefined reference to `FatFile::peek()'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `SdFatBase::readBlock(unsigned long, unsigned char*)':
PROJECT_DIR/firmware/user/./libraries/SdFat/SdFat.h:254: undefined reference to `SdSpiCard::readBlock(unsigned long, unsigned char*)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `SdFatBase::writeBlock(unsigned long, unsigned char const*)':
PROJECT_DIR/firmware/user/./libraries/SdFat/SdFat.h:257: undefined reference to `SdSpiCard::writeBlock(unsigned long, unsigned char const*)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `SdFatBase::readBlocks(unsigned long, unsigned char*, unsigned int)':
PROJECT_DIR/firmware/user/./libraries/SdFat/SdFat.h:260: undefined reference to `SdSpiCard::readBlocks(unsigned long, unsigned char*, unsigned int)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `SdFatBase::writeBlocks(unsigned long, unsigned char const*, unsigned int)':
PROJECT_DIR/firmware/user/./libraries/SdFat/SdFat.h:263: undefined reference to `SdSpiCard::writeBlocks(unsigned long, unsigned char const*, unsigned int)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `FatFile::read()':
PROJECT_DIR/firmware/user/./libraries/SdFat/FatFile.h:671: undefined reference to `FatFile::read(void*, unsigned int)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `SdFatBase::begin(SdSpiBase*, unsigned char, unsigned char)':
PROJECT_DIR/firmware/user/./libraries/SdFat/SdFat.h:86: undefined reference to `SdSpiCard::begin(SdSpiBase*, unsigned char, unsigned char)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `FatFileSystem::begin(unsigned char)':
PROJECT_DIR/firmware/user/./libraries/SdFat/FatFileSystem.h:43: undefined reference to `FatFile::close()'
PROJECT_DIR/firmware/user/./libraries/SdFat/FatFileSystem.h:44: undefined reference to `FatVolume::init(unsigned char)'
PROJECT_DIR/firmware/user/./libraries/SdFat/FatFileSystem.h:45: undefined reference to `FatFile::openRoot(FatVolume*)'
PROJECT_DIR/firmware/user/./libraries/SdFat/FatFileSystem.h:44: undefined reference to `FatVolume::init(unsigned char)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `FatFile::open(char const*, unsigned char)':
PROJECT_DIR/firmware/user/./libraries/SdFat/FatFile.h:551: undefined reference to `FatFile::open(FatFile*, char const*, unsigned char)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `SdFatBase::errorHalt(char const*)':
PROJECT_DIR/firmware/user/./libraries/SdFat/SdFat.h:115: undefined reference to `SdFatBase::errorHalt(Print*, char const*)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `setup':
PROJECT_DIR/firmware/user/applications/sdfat-test/application.cpp:62: undefined reference to `FatFile::close()'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `FatFile::open(char const*, unsigned char)':
PROJECT_DIR/firmware/user/./libraries/SdFat/FatFile.h:551: undefined reference to `FatFile::open(FatFile*, char const*, unsigned char)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `SdFatBase::errorHalt(char const*)':
PROJECT_DIR/firmware/user/./libraries/SdFat/SdFat.h:115: undefined reference to `SdFatBase::errorHalt(Print*, char const*)'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `SdFatBase::initErrorHalt()':
PROJECT_DIR/firmware/user/./libraries/SdFat/SdFat.h:155: undefined reference to `SdFatBase::initErrorHalt(Print*)'
PROJECT_DIR/firmware/user/./libraries/SdFat/SdFat.h:155: undefined reference to `FatFile::m_cwd'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `setup':
PROJECT_DIR/firmware/user/applications/sdfat-test/application.cpp:77: undefined reference to `FatFile::close()'
../../../build/target/user/platform-10-m/applications/sdfat-test//libuser.a(application.o): In function `__static_initialization_and_destruction_0':
PROJECT_DIR/firmware/user/applications/sdfat-test/application.cpp:31: undefined reference to `vtable for SdSpi'
collect2: error: ld returned 1 exit status
open(fileName, O_CREAT | O_WRITE | O_AT_END) fails if does not exist.
lib/SdFat/SdCard/SdInfo.h:112:34: 'F_CPU' was not declared in this scope
Veryfing code using this library in Particle Build fails with this error:
SdFat/SdSpi.h:244:21: fatal error: SoftSPI.h: No such file or directory
#include "SoftSPI.h"
^
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.