Adafruit ImageReader with Rasberry PI Pico

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Adafruit ImageReader with Rasberry PI Pico

Post by wfitkin »

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.

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit ImageReader with Rasberry PI Pico

Post by mikeysklar »

Please enable verbose output during compilation (under Preferences) and paste in the full error you are seeing.

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit ImageReader with Rasberry PI Pico

Post by wfitkin »

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.

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit ImageReader with Rasberry PI Pico

Post by wfitkin »

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.

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit ImageReader with Rasberry PI Pico

Post by wfitkin »

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>

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit ImageReader with Rasberry PI Pico

Post by wfitkin »

ImageReaderPicoError.JPG
ImageReaderPicoError.JPG (114.15 KiB) Viewed 601 times

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit ImageReader with Rasberry PI Pico

Post by mikeysklar »

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:

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.

User avatar
wfitkin
 
Posts: 44
Joined: Wed Mar 09, 2022 8:03 pm

Re: Adafruit ImageReader with Rasberry PI Pico

Post by wfitkin »

Mikeysklar,
You are amazing!!!
That did the job 100%
Thank you so much!

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit ImageReader with Rasberry PI Pico

Post by mikeysklar »

Glad to the Earle Philhower core resolved it. Thank you for the confirmation.

User avatar
IAmOrion
 
Posts: 74
Joined: Thu May 14, 2015 8:22 am

Re: Adafruit ImageReader with Rasberry PI Pico

Post by IAmOrion »

I've just come here with the exact same problem:

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();
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_ImageReader.h:107:3: error: 'File' does not name a type; did you mean 'SdFile'?
  107 |   File file;              ///< Current Open file
      |   ^~~~
      |   SdFile

User avatar
mikeysklar
 
Posts: 13824
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit ImageReader with Rasberry PI Pico

Post by mikeysklar »

On the Earle Philhower's core with your code tried does changing the type help?

Code: Select all

File --> File32 

User avatar
IAmOrion
 
Posts: 74
Joined: Thu May 14, 2015 8:22 am

Re: Adafruit ImageReader with Rasberry PI Pico

Post by IAmOrion »

mikeysklar 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 
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' core

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”