Library dependency not being found

Then could you re-download the repo again and try to just “Open Project” in the PIO Home screen

Then in the Project tasks Rebuild Intellisense Index

1 Like

Download your repo from github? Okay

Before I go any further, I want you to know that I really appreciate your help. This project is vitally important to my company and to me. Your expertise is invaluable.

I downloaded your project from github, added it to my workspace and attempted to compile it using the Debug task. I got the same results as with my own version. Here is the complete output:

Processing adafruit_feather_m4 (framework: arduino; platform: atmelsam; board: adafruit_feather_m4)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/adafruit_feather_m4.html
PLATFORM: Atmel SAM 3.7.0 > Adafruit Feather M4 Express
HARDWARE: SAMD51J19A 120MHz, 192KB RAM, 512KB Flash
DEBUG: Current (jlink) External (atmel-ice, jlink)
PACKAGES: toolchain-gccarmnoneeabi 1.70201.0 (7.2.1), framework-arduinosam 4.2.190701
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain+, Compatibility ~ soft
Found 15 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SdFat> 1.1.0
|   |-- <SPI> 1.0
|-- <Adafruit SPIFlash> 2.0.2
|   |-- <SPI> 1.0
|-- <SPI> 1.0
Compiling .pio\build\adafruit_feather_m4\src\main.cpp.o
Compiling .pio\build\adafruit_feather_m4\lib978\SPI\SPI.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\FatLib\FatFile.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\FatLib\FatFileLFN.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\FatLib\FatFilePrint.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\FatLib\FatFileSFN.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\FatLib\FatVolume.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\FatLib\FmtNumber.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\FatLib\StdioStream.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\FatLib\fstream.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\FatLib\istream.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\FatLib\ostream.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\MinimumSerial.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\SdCard\SdSpiCard.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\SdCard\SdSpiCardEX.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\SdCard\SdioCardEX.cpp.o
Compiling .pio\build\adafruit_feather_m4\libcdc\SdFat-master\SdCard\SdioTeensy.cpp.o
src\main.cpp:7:3: error: 'Adafruit_FlashTransport_QSPI' does not name a type
   Adafruit_FlashTransport_QSPI flashTransport(PIN_QSPI_SCK, PIN_QSPI_CS, PIN_QSPI_IO0, PIN_QSPI_IO1, PIN_QSPI_IO2, PIN_QSPI_IO3);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src\main.cpp:16:26: error: 'flashTransport' was not declared in this scope
 Adafruit_SPIFlash flash(&flashTransport);
                          ^~~~~~~~~~~~~~
src\main.cpp: In function 'void setup()':
src\main.cpp:31:20: error: no matching function for call to 'Adafruit_SPIFlash::begin()'
   if (!flash.begin()) {
                    ^
In file included from src\main.cpp:4:0:
C:\Users\jjuni\.platformio\lib\Adafruit SPIFlash_ID1643/Adafruit_SPIFlash.h:98:8: note: candidate: bool Adafruit_SPIFlash::begin(spiflash_type_t)
   bool begin(spiflash_type_t t);
        ^~~~~
C:\Users\jjuni\.platformio\lib\Adafruit SPIFlash_ID1643/Adafruit_SPIFlash.h:98:8: note:   candidate expects 1 argument, 0 provided
src\main.cpp:35:65: error: 'class Adafruit_SPIFlash' has no member named 'getJEDECID'; did you mean 'GetJEDECID'?
   Serial.print("Flash chip JEDEC ID: 0x"); Serial.println(flash.getJEDECID(), HEX);
                                                                 ^~~~~~~~~~
                                                                 GetJEDECID
src\main.cpp:45:27: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   while (!Serial.find("OK"));
                           ^
src\main.cpp:48:21: error: no matching function for call to 'FatFileSystem::begin(Adafruit_SPIFlash*)'
   fatfs.begin(&flash);
                     ^
In file included from lib\SdFat-master\src/FatLib/FatLib.h:28:0,
                 from lib\SdFat-master\src/SdFat.h:33,
                 from src\main.cpp:3:
lib\SdFat-master\src/FatLib/FatFileSystem.h:48:8: note: candidate: bool FatFileSystem::begin(BlockDriver*, uint8_t)
   bool begin(BlockDriver* blockDev, uint8_t part = 0) {
        ^~~~~
lib\SdFat-master\src/FatLib/FatFileSystem.h:48:8: note:   no known conversion for argument 1 from 'Adafruit_SPIFlash*' to 'BlockDriver* {aka BaseBlockDriver*}'
src\main.cpp:58:26: error: no matching function for call to 'FatFileSystem::begin(Adafruit_SPIFlash*)'
   if (!fatfs.begin(&flash)) {
                          ^
In file included from lib\SdFat-master\src/FatLib/FatLib.h:28:0,
                 from lib\SdFat-master\src/SdFat.h:33,
                 from src\main.cpp:3:
lib\SdFat-master\src/FatLib/FatFileSystem.h:48:8: note: candidate: bool FatFileSystem::begin(BlockDriver*, uint8_t)
   bool begin(BlockDriver* blockDev, uint8_t part = 0) {
        ^~~~~
lib\SdFat-master\src/FatLib/FatFileSystem.h:48:8: note:   no known conversion for argument 1 from 'Adafruit_SPIFlash*' to 'BlockDriver* {aka BaseBlockDriver*}'
*** [.pio\build\adafruit_feather_m4\src\main.cpp.o] Error 1
===================================================================== [ERROR] Took 18.98 seconds =====================================================================
The terminal process terminated with exit code: 1

The formatting marks seem to be preventing the Depended graph from showing up. Shere is a screen shot:
image

We have a differing Adafruit SPIFlash library version, 3.0.1 was released yesterday. Could you update that library in the library manager please. However, even with Adafruit SPIFlash @ 2.0.2 in the lib_deps I can still build it. Also, our Platform version (3.7.0) and packages versions are the same.

What operating system are you using?

Could you Press Ctrl+Alt+P, then type “platformio new”, then enter

In the console, execute then

pio --version
pio run -t clean
pio run -v > build.log 2>&1

After the command executes, upload the build.log file in the project directory to https://pastebin.com/ and post the link.

Also tell me what pio --version outputted.

1 Like

Yes. I saw earlier today that the Adafruit_SPIFlash library had just been updated, so I went back to the earlier version. Removing and installing latest vers now.
I am using Windows 10

Ctl+Alt+P has no visible effect. Is that the correct sequence?

PlatformIO, version 4.0.0rc1

Doing the rest now

No sorry, Ctrl + Shift + P for the command pallete.

Also is the library installed in the global library storage? Could you remove it from there, it should be re-downloaded locally.

Here is the link to the log file: build.log - Pastebin.com

The reinstall of the library put it globally. I will move to the project’s lib directory

I am assuming you meant the Adafruit_SPIFlash library to be moved locally. the SdFat-master library was already there

Okay that compile is very weird

  • inside the C:\Users\jjuni\Documents\PlatformIO\Projects\fatfs_format\lib\SdFat-master\srcSdFatConfig.h, ENABLE_EXTENDED_TRANSFER_CLASS is still 0 instead of 1
  • fatfs_format.cpp:24 tries to include Adafruit_SPIFlash_FatFs.h, but it must be Adafruit_SPIFlash

Could you try and fix both these errors and re-upload a build log.

I’m so sorry. I ran the log file on my old version of the project where I was trying the includes that worked when I ran this program on the Arduino IDE on a Mac last week.

Your version of the project has now compiled correctly!!! Yay! THANK YOU!!

I’m not sure exactly what made it work. What do you think?

Will I always need to use local versions of the SdFat and Adafruit_SPIflash libraries. This will keep them from being updated by the library manager and may make managing verious branches of this code prone to breaking?

Likewise, why is changing the ENABLE_EXTENDED_TRANSFER_CLASS define needed? I had to be working with modified versions of libraries if I can help it, because of code maintenance issues.

Please understand that I’m not complaining. I am very grateful to get to this point! I am just looking towards the future.

Well, I found the ultimate cause of the problem and the likely answer to the questions above. It has to do with yesterday’s update to the Adafruit SPIFlash library. The updated version is VERY different from the old version. In fact, it is so different that it breaks their own example programs from the earlier versions! In fact, the changes are so great that they gave their new examples new names! The screenshot below shows the old and the new formatting examples side by side:

It looks like they moved a lot of code from the old Adafruit_SPIFlash_FatFs.h file (which longer exists at all) into the main program file.

So, I think the problem ended up being that I was trying to use today’s library with last week’s example code and it would never work because the library update broke that code. I congratulate you on figuring out ways around it that got the “old” program code to run with the new library! Brilliant! I am VERY unhappy with Adafruit for changing the library in a way that proke all older code.

Thank you, @maxgerhardt, for spending so much time helping me get this working. I am so glad that I decided to move our project to PlatformIO ! Your support has been fantastic.

How can I buy you a beer?

Jack

2 Likes