adafruit / Adafruit_SPIFlash

Arduino library for external (Q)SPI flash device
MIT License
160 stars 84 forks source link

Arduino-Pico Core's SdFAT Conflict #121

Closed Deemocean closed 2 years ago

Deemocean commented 2 years ago

Operating System

MacOS

IDE version

PlatformIO(Core.6.1.4)

Board

Pi Pico W

BSP version

Arduino-pico 2.3.3

SPIFlash Library version

latest

Sketch as attached file if not stock example

include "WiFi.h"

include

Adafruit_FlashTransport_RP2040 flashTransport; Adafruit_SPIFlash flash(&flashTransport);

What happened ?

Using the Arduino-Pico WiFi and SPIFlash.h together will result in #38. As mentioned in the msc_external_flash example from the adafruit_TinyUSB lib: " * Note: Adafruit fork of SdFat enabled ENABLE_EXTENDED_TRANSFER_CLASS and FAT12_SUPPORT

Calling the Adafruit_SPIFlash class will no longer have BaseBlockDriver available.

How to reproduce ?

Using ESP8266SdFAT instead of the Adafruit Fork SdFAT add

#define FAT12_SUPPORT 1
#define ENABLE_EXTENDED_TRANSFER_CLASS 1

to SdFatConfig.h

compile

#include <Adafruit_SPIFlash.h>
Adafruit_FlashTransport_RP2040 flashTransport;
Adafruit_SPIFlashBase flash(&flashTransport);

void setup() {
}

void loop() {
}

Debug Log as attached txt file

In file included from .pio/libdeps/picow/Adafruit SPIFlash/src/Adafruit_FlashCache.cpp:25: .pio/libdeps/picow/Adafruit SPIFlash/src/Adafruit_SPIFlash.h:48:49: error: expected class-name before ',' token 48 | class Adafruit_SPIFlash : public BaseBlockDriver, public Adafruit_SPIFlashBase { | ^ In file included from .pio/libdeps/picow/Adafruit SPIFlash/src/Adafruit_SPIFlash.cpp:25: .pio/libdeps/picow/Adafruit SPIFlash/src/Adafruit_SPIFlash.h:48:49: error: expected class-name before ',' token 48 | class Adafruit_SPIFlash : public BaseBlockDriver, public Adafruit_SPIFlashBase { | ^

Screenshots

No response

hathach commented 2 years ago

Using ESP8266SdFAT instead of the Adafruit Fork SdFAT

this is out of the scope of this repo, if you want to make ESP8266SdFAT compatible with FAT12 and/or this repo. Please open an issue in the ESP8266SdFAT/arduino-rp2040 repo. The note are only the notable changes, there are lots more changes required, check out the SdFat (Adafruit Fork) for the detail.