It seems that the Adafruit_ImageReader library is not compatible with a Raspberry Pi Pico.
If you take a new sketch and add the following includes...
#include <SdFat.h>
#include <Adafruit_SPIFlash.h> // SPI / QSPI flash library
#include <Adafruit_ImageReader.h> // Image-reading functions
It will not compile. Just says "Error compiling for board Raspberry Pi Pico."
Very easy to replicate.
First tried the example Adafruit Image Reader Library/ ShieldILI9341.
Bottom line is that any sketch with #include <Adafruit_SPIFlash.h> and/or <Adafruit_ImageReader.h> will not compile if your board is a Raspberry PI Pico.
Adafruit ImageReader with Rasberry PI Pico
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Adafruit ImageReader with Rasberry PI Pico
Please enable verbose output during compilation (under Preferences) and paste in the full error you are seeing.
- wfitkin
- Posts: 44
- Joined: Wed Mar 09, 2022 8:03 pm
Re: Adafruit ImageReader with Rasberry PI Pico
C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash\src\rp2040\Adafruit_FlashTransport_RP2040.cpp: In function 'void fl_lock()':
C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash\src\rp2040\Adafruit_FlashTransport_RP2040.cpp:47:3: error: 'rp2040' was not declared in this scope
rp2040.idleOtherCore();
^~~~~~
C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash\src\rp2040\Adafruit_FlashTransport_RP2040.cpp:47:3: note: suggested alternative: 'p24'
rp2040.idleOtherCore();
^~~~~~
p24
C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash\src\rp2040\Adafruit_FlashTransport_RP2040.cpp: In function 'void fl_unlock()':
C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash\src\rp2040\Adafruit_FlashTransport_RP2040.cpp:51:3: error: 'rp2040' was not declared in this scope
rp2040.resumeOtherCore();
^~~~~~
C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash\src\rp2040\Adafruit_FlashTransport_RP2040.cpp:51:3: note: suggested alternative: 'p24'
rp2040.resumeOtherCore();
^~~~~~
p24
Using library Adafruit_SPIFlash at version 3.11.0 in folder: C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash
Using library SPI in folder: C:\Users\Wayne\AppData\Local\Arduino15\packages\arduino\hardware\mbed_rp2040\3.2.0\libraries\SPI (legacy)
Using library SdFat_-_Adafruit_Fork at version 1.5.1 in folder: C:\Users\Wayne\Documents\Arduino\libraries\SdFat_-_Adafruit_Fork
Using library Adafruit_ImageReader_Library at version 2.8.1 in folder: C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_ImageReader_Library
Using library Adafruit_GFX_Library at version 1.11.3 in folder: C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_GFX_Library
Using library Adafruit_BusIO at version 1.13.2 in folder: C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_BusIO
Using library Wire in folder: C:\Users\Wayne\AppData\Local\Arduino15\packages\arduino\hardware\mbed_rp2040\3.2.0\libraries\Wire (legacy)
Using library Adafruit_EPD at version 4.5.0 in folder: C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_EPD
exit status 1
Error compiling for board Raspberry Pi Pico.
C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash\src\rp2040\Adafruit_FlashTransport_RP2040.cpp:47:3: error: 'rp2040' was not declared in this scope
rp2040.idleOtherCore();
^~~~~~
C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash\src\rp2040\Adafruit_FlashTransport_RP2040.cpp:47:3: note: suggested alternative: 'p24'
rp2040.idleOtherCore();
^~~~~~
p24
C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash\src\rp2040\Adafruit_FlashTransport_RP2040.cpp: In function 'void fl_unlock()':
C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash\src\rp2040\Adafruit_FlashTransport_RP2040.cpp:51:3: error: 'rp2040' was not declared in this scope
rp2040.resumeOtherCore();
^~~~~~
C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash\src\rp2040\Adafruit_FlashTransport_RP2040.cpp:51:3: note: suggested alternative: 'p24'
rp2040.resumeOtherCore();
^~~~~~
p24
Using library Adafruit_SPIFlash at version 3.11.0 in folder: C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_SPIFlash
Using library SPI in folder: C:\Users\Wayne\AppData\Local\Arduino15\packages\arduino\hardware\mbed_rp2040\3.2.0\libraries\SPI (legacy)
Using library SdFat_-_Adafruit_Fork at version 1.5.1 in folder: C:\Users\Wayne\Documents\Arduino\libraries\SdFat_-_Adafruit_Fork
Using library Adafruit_ImageReader_Library at version 2.8.1 in folder: C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_ImageReader_Library
Using library Adafruit_GFX_Library at version 1.11.3 in folder: C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_GFX_Library
Using library Adafruit_BusIO at version 1.13.2 in folder: C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_BusIO
Using library Wire in folder: C:\Users\Wayne\AppData\Local\Arduino15\packages\arduino\hardware\mbed_rp2040\3.2.0\libraries\Wire (legacy)
Using library Adafruit_EPD at version 4.5.0 in folder: C:\Users\Wayne\Documents\Arduino\libraries\Adafruit_EPD
exit status 1
Error compiling for board Raspberry Pi Pico.
- wfitkin
- Posts: 44
- Joined: Wed Mar 09, 2022 8:03 pm
Re: Adafruit ImageReader with Rasberry PI Pico
Bottom line for me is that any sketch with #include <Adafruit_SPIFlash.h> and/or <Adafruit_ImageReader.h> will not compile if your board is a Raspberry PI Pico.
- wfitkin
- Posts: 44
- Joined: Wed Mar 09, 2022 8:03 pm
Re: Adafruit ImageReader with Rasberry PI Pico
Tried the example "Adafruit Image Reader Library/ ShieldILI9341" one another computer using a Raspberry Pi Pico as the board with the same result.
Easy to duplicate..
Just open a new sketch using a Raspberry Pi Pico and add the following two lines at the top then hit compile.
#include <Adafruit_SPIFlash.h>
#include <Adafruit_ImageReader.h>
Easy to duplicate..
Just open a new sketch using a Raspberry Pi Pico and add the following two lines at the top then hit compile.
#include <Adafruit_SPIFlash.h>
#include <Adafruit_ImageReader.h>
- wfitkin
- Posts: 44
- Joined: Wed Mar 09, 2022 8:03 pm
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Adafruit ImageReader with Rasberry PI Pico
Have you installed the "Earle Philhower core" board manager library which the SPIFlash supports? The instructions are here:
https://learn.adafruit.com/rp2040-ardui ... hower-core
Add this to your Arduino IDE Preferences --> Additional Boards Manager Library URLs:
https://learn.adafruit.com/rp2040-ardui ... hower-core
Add this to your Arduino IDE Preferences --> Additional Boards Manager Library URLs:
Code: Select all
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
Tools -> Board -> Board Manager and type pico into the search bar, and hit enter. Select Raspberry Pi Pico/RP2040 by Earle F. Philhower, III and press Install.
- wfitkin
- Posts: 44
- Joined: Wed Mar 09, 2022 8:03 pm
Re: Adafruit ImageReader with Rasberry PI Pico
Mikeysklar,
You are amazing!!!
That did the job 100%
Thank you so much!
You are amazing!!!
That did the job 100%
Thank you so much!
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Adafruit ImageReader with Rasberry PI Pico
Glad to the Earle Philhower core resolved it. Thank you for the confirmation.
- IAmOrion
- Posts: 74
- Joined: Thu May 14, 2015 8:22 am
Re: Adafruit ImageReader with Rasberry PI Pico
I've just come here with the exact same problem:
I know the previous response mentions Earle Philhower's core -- but oftentimes, switching cores just isn't feasible! As in my particular case. Switching to Earle Philhower's core gives me what feels like a bajillion different errors for other stuff in my code, that his core just doesn't support, but the official rp2040 does. Not to mention not wanting to rewrite 2000+ lines of code to re-work with different libraries under a different core etc.
Sooooooo, does anyone from Adafruit actually have a solution or know why this doesn't work?
Edit: Actually, this doesn't even work on Earle Philhower's core for me! I get the following error:
Code: Select all
Adafruit_FlashTransport_RP2040.cpp: In function 'void fl_lock()':
Adafruit_FlashTransport_RP2040.cpp:51:3: error: 'rp2040' was not declared in this scope
rp2040.idleOtherCore();
Sooooooo, does anyone from Adafruit actually have a solution or know why this doesn't work?
Edit: Actually, this doesn't even work on Earle Philhower's core for me! I get the following error:
Code: Select all
Adafruit_ImageReader.h:107:3: error: 'File' does not name a type; did you mean 'SdFile'?
107 | File file; ///< Current Open file
| ^~~~
| SdFile
- mikeysklar
- Posts: 14165
- Joined: Mon Aug 01, 2016 8:10 pm
Re: Adafruit ImageReader with Rasberry PI Pico
On the Earle Philhower's core with your code tried does changing the type help?
Code: Select all
File --> File32
- IAmOrion
- Posts: 74
- Joined: Thu May 14, 2015 8:22 am
Re: Adafruit ImageReader with Rasberry PI Pico
Yup, that fixes the Examples.... but as mentioned, Earle Philhower's core doesn't work with so much of my current code, re-writing isn't feasible (and some libraries don't work with his core) so need to figure out how to get it to work on the 'official' coremikeysklar wrote: ↑Mon Oct 24, 2022 5:51 pm On the Earle Philhower's core with your code tried does changing the type help?
Code: Select all
File --> File32
Please be positive and constructive with your questions and comments.