Go Down

Topic: Error in TMRpcm whith SDFAT (Read 412 times) previous topic - next topic

gaboxdddd


I want to try TMRpcm with SDFAT but the example of this library has given me error when compiling.

I have not changed anything and I installed the libraries : TMRpcm , SdFat , SdFatTestSuit .

This is the error





Code: [Select]



C:\Users\Gabo\Documents\Arduino\libraries\TMRpcm\TMRpcm.cpp: In member function 'void TMRpcm::createWavTemplate(char*, unsigned int)':
C:\Users\Gabo\Documents\Arduino\libraries\TMRpcm\TMRpcm.cpp:1608:5: error: 'SdVolume' was not declared in this scope
     SdVolume vol;
     ^
C:\Users\Gabo\Documents\Arduino\libraries\TMRpcm\TMRpcm.cpp:1608:14: error: expected ';' before 'vol'
     SdVolume vol;
              ^
C:\Users\Gabo\Documents\Arduino\libraries\TMRpcm\TMRpcm.cpp:1619:6: error: 'vol' was not declared in this scope
  if(!vol.init(&card1)){}//Serial.println("card failed"); }
      ^
C:\Users\Gabo\Documents\Arduino\libraries\TMRpcm\TMRpcm.cpp:1620:21: error: 'vol' was not declared in this scope
  if (!rut.openRoot(&vol)) {}//Serial.println("openRoot failed"); }
                     ^
Error de compilaciĆ³n



Riva

You need to supply more information on what Arduino your using, what hardware & what version of TMRpcm.
And your sketch.

I just downloaded the library from here, installed it and it compiles the first 3 examples without error using 1.0.6 IDE
Don't PM me for help as I will ignore it.

Andreas Herz

Hi

I have the same problem

set this defines in pcmConfig.h

Code: [Select]

#define ENABLE_RECORDING
#define SDFAT


The reason is, that SDValume.h is deprecated and not used anymore.


Greetings

Andreas

Wisdom

Hi, gaboxdddd,

I have encountered exactly the same problem with you. And I have uncomment #define ENABLE_RECORDING &
#define SDFAT in the pcmConfig.h file. But it doesn't work.....

So have you solved this problem?

I have used Ardunio Uno R3 and 1.0.6 IDE.

Thanks!

Best,

Wisdom

mummie

#4
Nov 01, 2017, 03:35 pm Last Edit: Nov 02, 2017, 01:44 pm by mummie
Has this been solved?

I'm experiencing errors trying to get the sdfat example running, using UNO R3, IDE 1.8.5.
I did define ENABLE_RECORDING and SDFAT too.



This is the error message:

Code: [Select]
Arduino: 1.8.5 (Linux), Board: "Arduino/Genuino Uno"

.../Arduino/libraries/TMRpcm/TMRpcm.cpp: In member function 'byte TMRpcm::metaInfo(boolean, char*, char*, byte)':
/home/jappie/Arduino/libraries/TMRpcm/TMRpcm.cpp:1381:18: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
  char* datStr = "LIST";
                 ^
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1382:28: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
  if(infoType == 1){datStr = "ID3 "; datStr[3] = 3;}
                           ^
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1410:42: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 char* tagNames[] = {"INAM","IART","IPRD"};
                                         ^
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1410:42: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1410:42: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1430:16: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
   tagNames[0] = "TPE1"; tagNames[1] ="TIT2"; tagNames[2] ="TALB";
               ^
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1430:38: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
   tagNames[0] = "TPE1"; tagNames[1] ="TIT2"; tagNames[2] ="TALB";
                                     ^
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1430:59: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
   tagNames[0] = "TPE1"; tagNames[1] ="TIT2"; tagNames[2] ="TALB";
                                                          ^
.../Arduino/libraries/TMRpcm/TMRpcm.cpp: In member function 'void TMRpcm::finalizeWavTemplate(char*)':
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1568:65: warning: narrowing conversion of '(fSize >> 16)' from 'long unsigned int' to 'byte {aka unsigned char}' inside { } [-Wnarrowing]
 seek(4); byte data[4] = {lowByte(fSize),highByte(fSize), fSize >> 16,fSize >> 24};
                                                                ^
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1568:77: warning: narrowing conversion of '(fSize >> 24)' from 'long unsigned int' to 'byte {aka unsigned char}' inside { } [-Wnarrowing]
 seek(4); byte data[4] = {lowByte(fSize),highByte(fSize), fSize >> 16,fSize >> 24};
                                                                            ^
.../Arduino/libraries/TMRpcm/TMRpcm.cpp: In member function 'void TMRpcm::createWavTemplate(char*, unsigned int)':
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1608:5: error: 'SdVolume' was not declared in this scope
    SdVolume vol;
    ^
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1615:13: error: 'class Sd2Card' has no member named 'init'
 if (!card1.init(SPI_FULL_SPEED,CSPin)) {
            ^
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1619:6: error: 'vol' was not declared in this scope
 if(!vol.init(&card1)){}//Serial.println("card failed"); }
     ^
.../Arduino/libraries/TMRpcm/TMRpcm.cpp:1620:21: error: 'vol' was not declared in this scope
 if (!rut.openRoot(&vol)) {}//Serial.println("openRoot failed"); }
                    ^
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.



In some google search source I read somebody advising to add the SD.h library. So I tried adding this too:

#define SD_CHIP_SELECT_PIN 10
#include <SD.h>

I got some different error messages:

Code: [Select]

In file included from .../Arduino/Arduino sketches/sdfatExample/sdfatExample.ino:15:0:
.../Desktop/arduino-1.8.5/libraries/SD/src/SD.h:24:0: warning: "FILE_WRITE" redefined
 #define FILE_WRITE (O_READ | O_WRITE | O_CREAT)
 ^
In file included from .../Arduino/libraries/SdFatmaster/src/FatLib/FatLib.h:27:0,
                 from .../Arduino/libraries/SdFatmaster/src/SdFat.h:33,
                 from.../Arduino/Arduino sketches/sdfatExample/sdfatExample.ino:12:
.../Arduino/libraries/SdFatmaster/src/FatLib/ArduinoFiles.h:39:0: note: this is the location of the previous definition
 #define FILE_WRITE (O_RDWR | O_CREAT | O_AT_END)
 ^
In file included from.../Arduino/Arduino sketches/sdfatExample/sdfatExample.ino:15:0:
.../Desktop/arduino-1.8.5/libraries/SD/src/SD.h:62:3: error: 'SdVolume' does not name a type
   SdVolume volume;
   ^
.../Arduino/Arduino sketches/sdfatExample/sdfatExample.ino: In function 'void setup()':
.../Arduino/Arduino sketches/sdfatExample/sdfatExample.ino:32:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
   audio.play("song.wav");
                        ^
.../Arduino/Arduino sketches/sdfatExample/sdfatExample.ino: In function 'void loop()':
.../Arduino/Arduino sketches/sdfatExample/sdfatExample.ino:40:38: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
       case 'p': audio.play("song.wav"); break;
                                      ^
exit status 1
Error compiling for board Arduino/Genuino Uno.


A day later I found out that the code compiles without problems when using the Arduino web IDE...

Go Up