cbm80amiga / ST7735_SDinfo_stm

Portable SD card tester and CID analyzer with STM32 and ST7735 LCD
GNU Lesser General Public License v3.0
25 stars 9 forks source link

sdfat.h not found #1

Open KKuKK opened 1 year ago

KKuKK commented 1 year ago

Hi I tried to compile your code for stm32F103C8T6 and get the error message sdfat.h not found. I tried some libs I found, adafruit etc. It does not help out. May I ask you which lib you are using? Thank you for help. Greetings Klaus

KKuKK commented 1 year ago

Hi sorry I should be more precise.

I am using Arduino 1.8.8

I am using the core from here:
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json

I choose Board : gerneric stm32f103 serie Variant : stm32f103CB ( 20k Ram, 128k Flash ) Upload STlink

I tried 3 sdfat libs.

  1. adafruit
  2. greiman
  3. stevstrong

The error is allways horrible like this:

In file included from D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:46:0:

D:\usr\Arduino\libraries\Arduino_ST7735_STM/Arduino_ST7735_STM.h:113:0: note: this is the location of the previous definition

define MAGENTA 0xF81F

^

ST7735_SDinfo_stm:75:11: error: no matching function for call to 'SdFs::SdFs(int)'

SdFat sd(1);

       ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:75:11: note: candidate is:

In file included from D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:68:0:

D:\usr\Arduino\libraries\SdFat\src/SdFat.h:394:7: note: SdFs::SdFs()

class SdFs : public SdBase {

   ^

D:\usr\Arduino\libraries\SdFat\src/SdFat.h:394:7: note: candidate expects 0 arguments, 1 provided

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino: In function 'uint8_t showPartTab()':

ST7735_SDinfo_stm:442:3: error: 'mbr_t' was not declared in this scope

mbr_t mbr;

^

ST7735_SDinfo_stm:442:9: error: expected ';' before 'mbr'

mbr_t mbr;

     ^

ST7735_SDinfo_stm:443:18: error: 'SdCard' has no member named 'readBlock'

if(!sd.card()->readBlock(0, (uint8_t*)&mbr)) {

              ^

ST7735_SDinfo_stm:443:42: error: 'mbr' was not declared in this scope

if(!sd.card()->readBlock(0, (uint8_t*)&mbr)) {

                                      ^

ST7735_SDinfo_stm:450:5: error: 'part_t' was not declared in this scope

 part_t *pt = &mbr.part[ip - 1];

 ^

ST7735_SDinfo_stm:450:13: error: 'pt' was not declared in this scope

 part_t *pt = &mbr.part[ip - 1];

         ^

ST7735_SDinfo_stm:450:19: error: 'mbr' was not declared in this scope

 part_t *pt = &mbr.part[ip - 1];

               ^

ST7735_SDinfo_stm:467:5: error: 'part_t' was not declared in this scope

 part_t *pt = &mbr.part[ip - 1];

 ^

ST7735_SDinfo_stm:467:13: error: 'pt' was not declared in this scope

 part_t *pt = &mbr.part[ip - 1];

         ^

ST7735_SDinfo_stm:467:19: error: 'mbr' was not declared in this scope

 part_t *pt = &mbr.part[ip - 1];

               ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino: In function 'void showFileSystem()':

ST7735_SDinfo_stm:497:10: error: 'SdFat' has no member named 'fsBegin'

if(!sd.fsBegin()) {

      ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:508:68: warning: 'uint32_t FsVolume::blocksPerCluster()' is deprecated (declared at D:\usr\Arduino\libraries\SdFat\src/FsLib/FsVolume.h:54) [-Wdeprecated-declarations]

sprintf(txt,"Blocks/Clust: %d\n", int(sd.vol()->blocksPerCluster())); printString(txt);

                                                                ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:515:58: warning: 'uint32_t FsVolume::blocksPerCluster()' is deprecated (declared at D:\usr\Arduino\libraries\SdFat\src/FsLib/FsVolume.h:54) [-Wdeprecated-declarations]

float fs = 0.000512volFreesd.vol()->blocksPerCluster();

                                                      ^

ST7735_SDinfo_stm:517:48: error: 'class FsVolume' has no member named 'fatStartBlock'

sprintf(txt,"FATStartBlk: %d\n", sd.vol()->fatStartBlock()); printString(txt);

                                            ^

ST7735_SDinfo_stm:518:52: error: 'class FsVolume' has no member named 'fatCount'

sprintf(txt,"FATCount: %d\n", int(sd.vol()->fatCount())); printString(txt);

                                                ^

ST7735_SDinfo_stm:519:48: error: 'class FsVolume' has no member named 'blocksPerFat'

sprintf(txt,"BlocksPerFAT: %d\n", sd.vol()->blocksPerFat()); printString(txt);

                                            ^

ST7735_SDinfo_stm:520:48: error: 'class FsVolume' has no member named 'rootDirStart'

sprintf(txt,"RootDirStart: %d\n", sd.vol()->rootDirStart()); printString(txt);

                                            ^

ST7735_SDinfo_stm:521:50: error: 'class FsVolume' has no member named 'dataStartBlock'

sprintf(txt,"DataStartBlk: %d\n", sd.vol()->dataStartBlock()); printString(txt);

                                              ^

ST7735_SDinfo_stm:524:16: error: 'class FsVolume' has no member named 'dataStartBlock'

if(sd.vol()->dataStartBlock() % eraseSize) printStringCol("BAD",errCol); else printStringCol("OK",okCol);

            ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino: In function 'const char* toPerf(int)':

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:571:40: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

 default: return val2dec(val," MB/s") ; break;

                                    ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino: In function 'int showStatus()':

ST7735_SDinfo_stm:588:18: error: 'SdCard' has no member named 'readStatus'

if(!sd.card()->readStatus(stat)) {

              ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino: In function 'int checkCIDhack()':

ST7735_SDinfo_stm:620:26: error: 'SdCard' has no member named 'cardCommand'

int retEn = sd.card()->cardCommand(SAMSUNG_VENDOR_OPCODE, ENTER_VENDOR);

                      ^

ST7735_SDinfo_stm:621:26: error: 'SdCard' has no member named 'cardCommand'

int retCW = sd.card()->cardCommand(SAMSUNG_VENDOR_OPCODE, UNLOCK_CID_WRITE);

                      ^

ST7735_SDinfo_stm:622:26: error: 'SdCard' has no member named 'cardCommand'

int retEx = sd.card()->cardCommand(SAMSUNG_VENDOR_OPCODE, EXIT_VENDOR);

                      ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino: In function 'void drawTabs(int)':

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:754:80: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

font.setColor(mode==0 ? tabActTxtCol : tabIdlTxtCol); font.printStr(7,3,"CID");

                                                                            ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:755:81: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

font.setColor(mode==1 ? tabActTxtCol : tabIdlTxtCol); font.printStr(40,3,"CSD");

                                                                             ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:756:82: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

font.setColor(mode==2 ? tabActTxtCol : tabIdlTxtCol); font.printStr(70,3,"Part");

                                                                              ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:757:81: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

font.setColor(mode==3 ? tabActTxtCol : tabIdlTxtCol); font.printStr(107,3,"FS");

                                                                             ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino: In function 'void loop()':

ST7735_SDinfo_stm:789:47: error: no matching function for call to 'SdFs::cardBegin(const uint8_t&, long unsigned int)'

if(!sd.cardBegin(SD_CS, SD_SCK_MHZ(SD_SPEED))) {

                                           ^

D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:789:47: note: candidates are:

In file included from D:\usr\Arduino\libraries\ST7735_SDinfo_stm\ST7735_SDinfo_stm.ino:68:0:

D:\usr\Arduino\libraries\SdFat\src/SdFat.h:103:8: note: bool SdBase::cardBegin(SdSpiConfig) [with Vol = FsVolume]

bool cardBegin(SdSpiConfig spiConfig) {

    ^

D:\usr\Arduino\libraries\SdFat\src/SdFat.h:103:8: note: candidate expects 1 argument, 2 provided

D:\usr\Arduino\libraries\SdFat\src/SdFat.h:113:8: note: bool SdBase::cardBegin(SdioConfig) [with Vol = FsVolume]

bool cardBegin(SdioConfig sdioConfig) {

    ^

D:\usr\Arduino\libraries\SdFat\src/SdFat.h:113:8: note: candidate expects 1 argument, 2 provided

ST7735_SDinfo_stm:800:25: error: 'SdCard' has no member named 'cardSize'

cardSize = sd.card()->cardSize();

Help would be great, but don't worry about it, if you have no time. greetings Klaus

sakman55 commented 1 year ago

I used SdFat 1.0.5-1.0.7 from 2017/2018.

You'll need to modify a couple files to get it to compile. In /SDCard, modify SdSpiCard.h to move cardCommand() from PRIVATE to PUBLIC (move up a few lines). In /SpiDriver, modify SdSpiSTM32.cpp to change FROM return m_spi->dmaTransfer(0, buf, n); TO return m_spi->dmaTransfer(nullptr, buf, n);

I also had to remove the call to checkCIDhack(); in loop() as it breaks the SD initialization. If someone knows how to keep the checkCIDhack() function from breaking the SD init, then please post the details.

KKuKK commented 1 year ago

Thanks for your ideas.I just changedSdFat  sd(1);ToSdFat  sd;And it works😜Von meinem iPhone gesendetAm 10.08.2023 um 09:56 schrieb sakman55 @.***>: I used SdFat 1.0.5-1.0.7 from 2017/2018. You'll need to modify a couple files to get it to compile. In /SDCard, modify SdSpiCard.h to move cardCommand() from PRIVATE to PUBLIC (move up a few lines). In /SpiDriver, modify SdSpiSTM32.cpp to change FROM return m_spi->dmaTransfer(0, buf, n); TO return m_spi->dmaTransfer(nullptr, buf, n); I also had to remove the checkCIDhack(); call in loop() as it breaks the SD initialization. If someone knows how to keep the checkCIDhack() function and not breaking the SD init, then please post the details.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>