-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Operating System
Windows 11
IDE version
PlatiformIO Core:6.1.18, Home: 3.4.4, Arduino
Board
nrf52840_dk
BSP version
platformio/nordicnrf52 10.9.0
SPIFlash Library version
n/a
Sketch
examples/QuickStart.ino
What happened ?
When trying to compile this example, the following compilation error shows up:
In file included from .pio\libdeps\nrf52840_dk\SdFat - Adafruit Fork\src/ExFatLib/ExFatFile.h:882:0,
from .pio\libdeps\nrf52840_dk\SdFat - Adafruit Fork\src/ExFatLib/ExFatVolume.h:27,
from .pio\libdeps\nrf52840_dk\SdFat - Adafruit Fork\src/ExFatLib/ExFatLib.h:28,
from .pio\libdeps\nrf52840_dk\SdFat - Adafruit Fork\src/SdFat.h:30,
from src\main.cpp:5:
.pio\libdeps\nrf52840_dk\SdFat - Adafruit Fork\src/ExFatLib/../common/ArduinoFiles.h: In instantiation of 'class PrintFile<FatFile>':
.pio\libdeps\nrf52840_dk\SdFat - Adafruit Fork\src/SdFat.h:468:23: required from here
.pio\libdeps\nrf52840_dk\SdFat - Adafruit Fork\src/ExFatLib/../common/ArduinoFiles.h:52:8: error: 'void PrintFile<BaseFile>::flush() [with BaseFile = FatFile]' marked 'override', but does not override
void flush() override { BaseFile::sync(); }
^~~~~
It looks like the class PrintFile in src/common/ArduinoFiles.h implements void flush() override { BaseFile::sync(); } where BaseFile is FatFile. But neither of the inherited classes (Arduino Print implemented in the Arduino Nordic NRF5 core) or FatFile implement void flush() as virtual, meaning it cannot be overridden. There are preprocessor flags to select a version of the function declaration that doesn't ask to override, but it isn't selected since this isn't an Arduino Due board.
ArduinoFiles.h lines 48-53:
/** Ensure that any bytes written to the file are saved to the SD card. */
#if defined(ARDUINO_SAM_DUE) && !defined(ARDUINO_API_VERSION)
void flush() { BaseFile::sync(); }
#else
void flush() override { BaseFile::sync(); }
#endif
This does not happen with version 2.2.54, but happens with any version after - 2.3 and up.
How to reproduce ?
- Create new platformio project for the nRF52840 DK
- Add the Adafruit SDFat library to the dependencies so the
platformio.inifile looks like this:
[env:nrf52840_dk]
platform = nordicnrf52
board = nrf52840_dk
framework = arduino
lib_deps = adafruit/SdFat - Adafruit Fork@^2.3
- Copy in the examples/QuickStart.ino to
main.cpp - Build and see compilation output
Debug Log
No response
Screenshots
No response