bkb 2 Posted December 29, 2013 Share Posted December 29, 2013 Hi Calin, I want to test FatFs lib on TIVA, it works with ENERGIA 0101E0009 but it returns error compiling with Energia 0101E0011: UBUNTU 13.10 - energia 0101E0011- FatFsSpeedTest ---------------------------the error output ----------------------- /energia/energia-0101E0011/hardware/lm4f/libraries/FatFs/fatfs.cpp: In member function 'FRESULT FFS::begin(unsigned char, uint8_t, uint8_t)':/energia/energia-0101E0011/hardware/lm4f/libraries/FatFs/fatfs.cpp:151:13: error: no matching function for call to 'SPIClass::begin(int)'/energia/energia-0101E0011/hardware/lm4f/libraries/FatFs/fatfs.cpp:151:13: note: candidate is:In file included from /energia/energia-0101E0011/hardware/lm4f/libraries/FatFs/fatfs.h:14:0, from /energia/energia-0101E0011/hardware/lm4f/libraries/FatFs/fatfs.cpp:13:/energia/energia-0101E0011/hardware/lm4f/libraries/FatFs/../SPI/SPI.h:42:8: note: void SPIClass::begin()/energia/energia-0101E0011/hardware/lm4f/libraries/FatFs/../SPI/SPI.h:42:8: note: candidate expects 0 arguments, 1 provided If anybody knows the solution for this issue, please help.Best wishes:bkb Quote Link to post Share on other sites
calinp 24 Posted December 30, 2013 Author Share Posted December 30, 2013 Hi bkb, I think this error is caused by these changes in the SPI library :https://github.com/energia/Energia/commit/4b5ebc4370afd426a41dfe3cc6bbaafbeb764f04 Try to edit fatfs.cpp at line 151 to replace SPI.begin(9); with SPI.begin(); I still use ENERGIA 0101E0009 but next year I will try this lib on ENERGIA 0101E00011 Calin Quote Link to post Share on other sites
bkb 2 Posted December 30, 2013 Share Posted December 30, 2013 Hi Calin! Thank You for your reply, I can confirm, that my setup SPI(0) works with SPI library of Energia 0101E00011 modified line 151 1. SPI.begin(9); -> replaced to SPI.begin(); 2. I've tested with SPI library from here -> SPI_all_ports_LM4F.zip and it works well too. The setup is based on http://www.ti.com/lit/an/slaa281b/slaa281b.pdf This is the shematic of the SD card connection. bkb Quote Link to post Share on other sites
Rei Vilo 695 Posted April 5, 2014 Share Posted April 5, 2014 Please find the FATFS library with some improvements: all the types have a _t suffix FATFS_t FFS_t::fatfs_obj; /* Working copy of FATFS_t */ wider range of MCUs supported #if defined(__LM4F120H5QR__) || defined(__TM4C1230C3PM__) || defined(__TM4C129XNCZAD__) Enjoy! FatFs.zip bluehash 1 Quote Link to post Share on other sites
jcR 6 Posted April 9, 2014 Share Posted April 9, 2014 Hi all @rei it lacks the definition for TIVA 1249NCPDT line 152 of file fatfss.cpp for the last attached zip file. JC Quote Link to post Share on other sites
Rei Vilo 695 Posted April 9, 2014 Share Posted April 9, 2014 Thanks for the feed-back! Unfortunately, it's more complicated than that. Line 152 should be #if defined(__LM4F120H5QR__) || defined(__TM4C1230C3PM__) || defined(__TM4C123GH6PM__) || defined(__TM4C129XNCZAD__) || defined(__TM4C1294NCPDT__) because multiple names were used for the Stellaris / Tiva C Series TM4C123 LaunchPad and the Tiva C Series TM4C129 Connected LaunchPad. Quote Link to post Share on other sites
madias 0 Posted April 17, 2014 Share Posted April 17, 2014 Hello, I tried out fatfs from rei Vilos post #34 on my tiva TM4C123 launchpad. The speedtest example runs without problems, but with "FileWritetoSerial" i get following error: FileWriteToSerial.ino: In function 'void dir_list()': FileWriteToSerial.ino: 82:3: error: 'FILINFO' was not declared in this scope Any hints? Thank you! regards Matthias Quote Link to post Share on other sites
Rei Vilo 695 Posted April 17, 2014 Share Posted April 17, 2014 FileWriteToSerial.ino: In function 'void dir_list()': FileWriteToSerial.ino: 82:3: error: 'FILINFO' was not declared in this scope I've added the _t suffix to all types, so you need to edit line 82 and add the _t suffix to FILINFO to get FILINFO_t. void dir_list (void) { FILINFO_t file_info; // information on file size and type Now, I'm no longer using the FatFs library but the SD library from Adafruit. It provides a higher level interface. Thorvard 1 Quote Link to post Share on other sites
madias 0 Posted April 17, 2014 Share Posted April 17, 2014 (edited) Thank you for your fast answer! Now, it´s working, maybe I give the adafruit library a try, but I only need some basic file I/O for saving and restoring midi data/presets. Edited April 17, 2014 by madias Quote Link to post Share on other sites
Thorvard 14 Posted May 19, 2014 Share Posted May 19, 2014 Now, I'm no longer using the FatFs library but the SD library from Adafruit. It provides a higher level interface. Can you share your port of the Adafruit library with us? thanks, Nick Quote Link to post Share on other sites
Rei Vilo 695 Posted May 19, 2014 Share Posted May 19, 2014 The Adafruit library works right out of the box. It is very clean. Quote Link to post Share on other sites
Thorvard 14 Posted May 19, 2014 Share Posted May 19, 2014 You seem to have a different box than mine Can't get it to run for me. Got it from: https://github.com/adafruit/SD Quote Link to post Share on other sites
madias 0 Posted May 20, 2014 Share Posted May 20, 2014 At first glance, i see that you need to change all "#if Arduino >=100" in all *.h and *.cpp files. Dont forget the "utility" subfolder. Maybe you also have to include/modify the "fastdigitalwrite"things. You can also try: https://github.com/energia/Energia/tree/master/libraries/SD but maybe it´s an older version and only for the msp430. Quote Link to post Share on other sites
madias 0 Posted May 30, 2014 Share Posted May 30, 2014 @@Rei Vilo: Maybe you can really post your SD library (is it really for stellaris/tiva?), I see a lot of things to do with the original one, so you can save much work for Thorvard and me Thank you Regards Matthias Thorvard 1 Quote Link to post Share on other sites
Rei Vilo 695 Posted May 31, 2014 Share Posted May 31, 2014 https://github.com/energia/Energia/tree/master/libraries/SD but maybe it´s an older version and only for the msp430. Maybe you can really post your SD library (is it really for stellaris/tiva?), The MSP430G2 MCUs don't have enough RAM to handle the SD-card. SD-card in SPI more requires 512 bytes of RAM as buffer for cluster. So the library only works on a LM4F / TM4C. Here's the ZIP file. Changes from the original library are minimal. However, the library seems to suffer from memory leakage. I don't have the tools to check and fix this. Please note that, contrary to the other libraries I've released, I'm not providing any support for this FatFS library. You use it at your own risk. Enjoy FatFs.zip Thorvard 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.