gallegojm / Arduino-FatFs

Functions to wrap FatFs module developed by ChaN on Arduino platform
16 stars 10 forks source link

FatLibDemo.ino does not Compile in Arduino Mega ADK #2

Open shadeyinka opened 7 years ago

shadeyinka commented 7 years ago

I have the following errors while attempting to compile FatlibDemo.ino. None of the code example compiles. Is there something i am doing wrong?

I am pasting the error codes here: sorry it is long. I use Aduino IDE 1.6.8

Thanks

C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp: In member function 'bool FatFsCard::begin(uint8_t, uint8_t)':
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:137:22: error: no matching function for call to 'SPIClass::begin(uint8_t&)'
   SPI.begin( m_CSPin );
                      ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:137:22: note: candidate is:
In file included from C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:23:0:
C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:159:15: note: static void SPIClass::begin()
   static void begin();
               ^
C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:159:15: note:   candidate expects 0 arguments, 1 provided

C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:146:22: error: no matching function for call to 'SPIClass::begin(uint8_t&)'
   SPI.begin( csPin52 );
                      ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:146:22: note: candidate is:
In file included from C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:23:0:

C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:159:15: note: static void SPIClass::begin()
   static void begin();
               ^
C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:159:15: note:   candidate expects 0 arguments, 1 provided
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:147:79: error: no matching function for call to 'SPIClass::beginTransaction(uint8_t&, SPISettings)'

   SPI.beginTransaction( csPin52, SPISettings( m_spifrec, MSBFIRST, SPI_MODE0 ));
                                                                               ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:147:79: note: candidate is:

In file included from C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:23:0:

C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:178:22: note: static void SPIClass::beginTransaction(SPISettings)
   inline static void beginTransaction(SPISettings settings) {
                      ^
C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:178:22: note:   candidate expects 1 argument, 2 provided

C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:149:33: error: invalid conversion from 'uint8_t {aka unsigned char}' to 'void*' [-fpermissive]
     SPI.transfer( csPin52, 0XFF );
                                 ^
In file included from C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:23:0:

C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:244:22: error:   initializing argument 1 of 'static void SPIClass::transfer(void*, size_t)' [-fpermissive]
   inline static void transfer(void *buf, size_t count) {
                      ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:217:79: error: no matching function for call to 'SPIClass::beginTransaction(uint8_t&, SPISettings)'
   SPI.beginTransaction( m_CSPin, SPISettings( m_spifrec, MSBFIRST, SPI_MODE0 ));
                                                                               ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:217:79: note: candidate is:
In file included from C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:23:0:
C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:178:22: note: static void SPIClass::beginTransaction(SPISettings)
   inline static void beginTransaction(SPISettings settings) {
                      ^
C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:178:22: note:   candidate expects 1 argument, 2 provided
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp: In member function 'void FatFsCard::chipSelect()':

C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:283:79: error: no matching function for call to 'SPIClass::beginTransaction(uint8_t&, SPISettings)'
   SPI.beginTransaction( m_CSPin, SPISettings( m_spifrec, MSBFIRST, SPI_MODE0 ));
                                                                               ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:283:79: note: candidate is:
In file included from C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:23:0:

C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:178:22: note: static void SPIClass::beginTransaction(SPISettings)
   inline static void beginTransaction(SPISettings settings) {
                      ^
C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:178:22: note:   candidate expects 1 argument, 2 provided
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp: In member function 'uint8_t FatFsCard::spiReceive()':
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:599:38: error: invalid conversion from 'uint8_t {aka unsigned char}' to 'void*' [-fpermissive]
   return SPI.transfer( m_CSPin, 0XFF );
                                      ^
In file included from C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:23:0:

C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:244:22: error:   initializing argument 1 of 'static void SPIClass::transfer(void*, size_t)' [-fpermissive]
   inline static void transfer(void *buf, size_t count) {
                      ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:599:38: error: void value not ignored as it ought to be
   return SPI.transfer( m_CSPin, 0XFF );
                                      ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp: In member function 'uint8_t FatFsCard::spiReceive(uint8_t*, size_t)':

C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:606:43: error: 'SPI_CONTINUE' was not declared in this scope
     buf[i] = SPI.transfer( m_CSPin, 0XFF, SPI_CONTINUE );
                                           ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:607:40: error: invalid conversion from 'uint8_t {aka unsigned char}' to 'void*' [-fpermissive]
   buf[i] = SPI.transfer( m_CSPin, 0XFF );
                                        ^
In file included from C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:23:0:
C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:244:22: error:   initializing argument 1 of 'static void SPIClass::transfer(void*, size_t)' [-fpermissive]
   inline static void transfer(void *buf, size_t count) {
                      ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:607:10: error: void value not ignored as it ought to be
   buf[i] = SPI.transfer( m_CSPin, 0XFF );
          ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp: In member function 'void FatFsCard::spiSend(uint8_t)':
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:613:31: error: invalid conversion from 'uint8_t {aka unsigned char}' to 'void*' [-fpermissive]
   SPI.transfer( m_CSPin, data );
                               ^
In file included from C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:23:0:

C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:244:22: error:   initializing argument 1 of 'static void SPIClass::transfer(void*, size_t)' [-fpermissive]

   inline static void transfer(void *buf, size_t count) {

                      ^

C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp: In member function 'void FatFsCard::spiSend(const uint8_t*, size_t)':

C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:620:36: error: 'SPI_CONTINUE' was not declared in this scope
     SPI.transfer( m_CSPin, buf[i], SPI_CONTINUE );
                                    ^
C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:621:33: error: invalid conversion from 'uint8_t {aka unsigned char}' to 'void*' [-fpermissive]
   SPI.transfer( m_CSPin, buf[i] );
                                 ^
In file included from C:\Users\HP\Documents\Arduino\libraries\FatFs\FatFsCard.cpp:23:0:

C:\Users\HP\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.11\libraries\SPI\src/SPI.h:244:22: error:   initializing argument 1 of 'static void SPIClass::transfer(void*, size_t)' [-fpermissive]
   inline static void transfer(void *buf, size_t count) {
                      ^
exit status 1
Error compiling for board Arduino Mega ADK.
gallegojm commented 7 years ago

Hi shadeyinka I wrote this code 3 years ago, so I do not remember everything! What I remember is that in that time, arduino team modify the way SPI library works and I stop updating the IDE. Please try to download IDE 1.6.0 and see if those errors disappear. The other thing is that I wrote this code for arduino Due, but I think it must work with Mega despite the lower memory size

shadeyinka commented 7 years ago

Thanks so much for your prompt reply. I will try your suggestion. I will verify if it sorks on a due with the current IDE before downloading the IDE 1.6.0