Hi David,
I’m trying to add sdcard support for the polular rpi pico , but no succes so far.
This is for now what I tried : (see the 5 … lines). It’s a guess to undefine the littlefs …
#elif defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_ADAFRUIT_QTPY_RP2040) || defined(ARDUINO_ADAFRUIT_FEATHER_RP2040) || defined(ARDUINO_SEEED_XIAO_RP2040)
#define WORKSPACESIZE (22912-SDSIZE) /* Objects (8bytes) /
//#define LITTLEFS
** //#include <LittleFS.h>*
** //#define FILE_WRITE_BEGIN “w”**
** //#define FILE_READ “r”**
#define SDCARD_SS_PIN 16
#define CODESIZE 256 / Bytes */
#define STACKDIFF 320
#define CPU_RP2040
#if defined(gfxsupport)
const int COLOR_WHITE = 0xffff, COLOR_BLACK = 0;
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
Adafruit_ST7789 tft = Adafruit_ST7789(5, 1, 3, 2, 0); // TTGO RP2040 TFT
#define TFT_BACKLIGHT 4
#define TFT_I2C_POWER 22
#endif
This however seems to yield to errors , as shown here :
In file included from /home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/libraries/SD/src/SD.h:23,
from /home/ronny/Arduino/ulisp_arm_4.5/ulisp_arm_4.5.ino:32:
/home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/cores/rp2040/FS.h: In instantiation of ‘size_t fs::File::write(T&) [with T = char; size_t = unsigned int]’:
/home/ronny/Arduino/ulisp_arm_4.5/ulisp_arm_4.5.ino:2278:47: required from here
/home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/cores/rp2040/FS.h:96:28: error: request for member ‘available’ in ‘src’, which is of non-class type ‘char’
96 | while ((size_t)src.available() > sizeof(obuf)) {
| ~~~~^
/home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/cores/rp2040/FS.h:97:17: error: request for member ‘read’ in ‘src’, which is of non-class type ‘char’
97 | src.read(obuf, sizeof(obuf));
| ~~^~
/home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/cores/rp2040/FS.h:105:30: error: request for member ‘available’ in ‘src’, which is of non-class type ‘char’
105 | size_t leftLen = src.available();
| ^
/home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/cores/rp2040/FS.h:106:13: error: request for member ‘read’ in ‘src’, which is of non-class type ‘char’
106 | src.read(obuf, leftLen);
| ~~^~
Multiple libraries were found for “SD.h”
Used: /home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/libraries/SD
Not used: /home/ronny/.arduino15/libraries/SD
Not used: /home/ronny/Arduino/libraries/SD
Using library SPI at version 1.0 in folder: /home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/libraries/SPI
Using library Wire at version 1.0 in folder: /home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/libraries/Wire
Using library SD at version 2.0.0 in folder: /home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/libraries/SD
Using library SDFS at version 0.1.0 in folder: /home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/libraries/SDFS
Using library ESP8266SdFat at version 2.1.1 in folder: /home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/libraries/ESP8266SdFat
Using library LittleFS at version 0.1.0 in folder: /home/ronny/.arduino15/packages/rp2040/hardware/rp2040/3.3.0/libraries/LittleFS
exit status 1
Compilation error: exit status 1
Can you please advice me ?
I’m convinced that SDcard operations can work on RPI2040.
Kind regards,
Ronny