SDFat LowLatencyLogger example fails to compile on Artemis Redboard Nano

Hi,

I’m simply trying to compile the built-in SDFat example “LowLatencyLogger” on the Artemis Redboard Nano.

This example (https://github.com/greiman/SdFat/tree/m … encyLogger) compiles without error on other boards, like the Arduino Uno.

However, when compiling on the Reboard Nano, I get the following ‘FreeStack’ was not declared in this scope error. Seems odd then that it would compile on other boards but not the Redboard Nano? Any advice would be appreciated!

My current versions:

  • Arduino IDE: 1.8.19

  • Sparkfun Apollo3 Boards: 2.2.1

  • SDFat: 2.2.0

  • Programmer: Ambiq Secure Bootloader

C:\Users\Ben\Documents\Arduino\libraries\SdFat-master\examples\examplesV1\LowLatencyLogger\LowLatencyLogger.ino: In function 'void checkOverrun()':
LowLatencyLogger:150:18: error: 'FreeStack' was not declared in this scope
   Serial.println(FreeStack());
                  ^~~~~~~~~
C:\Users\Ben\Documents\Arduino\libraries\SdFat-master\examples\examplesV1\LowLatencyLogger\LowLatencyLogger.ino:150:18: note: suggested alternative: 'FreeStack_h'
   Serial.println(FreeStack());
                  ^~~~~~~~~
                  FreeStack_h
LowLatencyLogger:165:28: error: 'SdBaseFile' {aka 'class FsBaseFile'} has no member named 'firstBlock'
       Serial.print(binFile.firstBlock() + bn);
                            ^~~~~~~~~~
C:\Users\Ben\Documents\Arduino\libraries\SdFat-master\examples\examplesV1\LowLatencyLogger\LowLatencyLogger.ino: In function 'void binaryToCsv()':
LowLatencyLogger:194:18: error: 'FreeStack' was not declared in this scope
   Serial.println(FreeStack());
                  ^~~~~~~~~
C:\Users\Ben\Documents\Arduino\libraries\SdFat-master\examples\examplesV1\LowLatencyLogger\LowLatencyLogger.ino:194:18: note: suggested alternative: 'FreeStack_h'
   Serial.println(FreeStack());
                  ^~~~~~~~~
                  FreeStack_h
C:\Users\Ben\Documents\Arduino\libraries\SdFat-master\examples\examplesV1\LowLatencyLogger\LowLatencyLogger.ino: In function 'void createBinFile()':
LowLatencyLogger:259:16: error: 'SdBaseFile' {aka 'class FsBaseFile'} has no member named 'createContiguous'; did you mean 'isContiguous'?
   if (!binFile.createContiguous(TMP_FILE_NAME, 512 * FILE_BLOCK_COUNT)) {
                ^~~~~~~~~~~~~~~~
                isContiguous
C:\Users\Ben\Documents\Arduino\libraries\SdFat-master\examples\examplesV1\LowLatencyLogger\LowLatencyLogger.ino: In function 'void recordBinFile()':
LowLatencyLogger:367:39: error: 'class FsVolume' has no member named 'cacheClear'
   emptyStack[0] = (block_t*)sd.vol()->cacheClear();
                                       ^~~~~~~~~~
LowLatencyLogger:379:38: error: 'SdBaseFile' {aka 'class FsBaseFile'} has no member named 'firstBlock'
   if (!sd.card()->writeStart(binFile.firstBlock())) {
                                      ^~~~~~~~~~
LowLatencyLogger:383:18: error: 'FreeStack' was not declared in this scope
   Serial.println(FreeStack());
                  ^~~~~~~~~
C:\Users\Ben\Documents\Arduino\libraries\SdFat-master\examples\examplesV1\LowLatencyLogger\LowLatencyLogger.ino:383:18: note: suggested alternative: 'FreeStack_h'
   Serial.println(FreeStack());
                  ^~~~~~~~~
                  FreeStack_h
C:\Users\Ben\Documents\Arduino\libraries\SdFat-master\examples\examplesV1\LowLatencyLogger\LowLatencyLogger.ino: In function 'void setup()':
LowLatencyLogger:572:18: error: 'FreeStack' was not declared in this scope
   Serial.println(FreeStack());
                  ^~~~~~~~~
C:\Users\Ben\Documents\Arduino\libraries\SdFat-master\examples\examplesV1\LowLatencyLogger\LowLatencyLogger.ino:572:18: note: suggested alternative: 'FreeStack_h'
   Serial.println(FreeStack());
                  ^~~~~~~~~
                  FreeStack_h
exit status 1
'FreeStack' was not declared in this scope

I wasn’t able to recreate this error, though it looks like an issue with the FreeStack.h header files being missing? Place all relevant/necessary libraries/packages in the sketch folder and try it again?

Turns out FreeStack doesn’t always play nicely with boards that support exFAT and FAT16/FAT32 (solution here: https://github.com/greiman/SdFat/issues/400).

Thanks to Bill’s advice, I was able to build working sketch from the V2 ExFatLogger example.