I can not use the SdFat library with my Boron, even the existing SdFat examples don’t work. Can anyone give it a try? It refuses to compile for me on the web IDE. If I switch the device from the boron to the electron then everything is working.
@superseb, because of the difference in underlying hardware and the new mesh PLATFORM_IDs, many libraries will need to be updated for mesh devices. Some, due to hardware-specific reasons, may not be portable.
ah shoot. I wanted to use the Boron both as an SD datalogger and to send data to the cloud. Do you have any suggestion of a compatible SD card library? Otherwise I guess I can use my adalogger to save data and it will then send data through serial to the boron that will send it onine.
Is the any update on this by chance? I am affected and considering trying to find the error in the library in regards to mesh devices and try to adjust it to work.
@Alterxend, there is no error per se. The author wrote it to use PLATFORM_ID for Particle devices. However, the new Mesh devices are not included in the PLATFORM_ID tests so the compile errors out.
It looks like the RDONLY, RDWR, and WRONLY tags are fighting with something along the lines of the WiFi or similar comms library in the mesh firmware. I ended up doing a search for each instance of those tags in the SdFat folder, and just prepended them with SDFAT_, worked fine after that. Might be less trouble than undef’ing them, I’m not sure if that could cause trouble with the other comms library…
fcntl.h for the ARM compiler uses the standard POSIX/Linux values.
/*
* Flag values for open(2) and fcntl(2)
* The kernel adds 1 to the open modes to turn it into some
* combination of FREAD and FWRITE.
*/
#define O_RDONLY 0 /* +1 == FREAD */
#define O_WRONLY 1 /* +1 == FWRITE */
#define O_RDWR 2 /* +1 == FREAD|FWRITE */
Unfortunately fcntl.h is not included in lwip so the inconsistent value are defined.
I am modifying SdFat to use the values in fcntl.h I will #undef the symbols if they have the lwip values.
Too many apps use the symbols in other versions of SdFat so I don’t want to change their names.
I will also change the values for these open flags (O_APPEND, O_CREAT, O_TRUNC, O_EXCL, O_SYNC) defined in fcntl.h to avoid future problems.
I am also using these values in the new version of SdFat which supports exFAT.