Jump to content
calinp

[Energia Library] Stellaris Launchpad FatFs Energia library

Recommended Posts

Dear Rei Vilo,

I think there is a misunderstanding: 

Is the FatFs Library exactly the same as the adafruit sd library?

Because you wrote on page 2 on this thread:

 

 

Now, I'm no longer using the FatFs library but the SD library from Adafruit. It provides a higher level interface.

 

Thorvard and I tried out the adafruit link, but this library need much of hands on.

I'm a little bit confused right now :)

Share this post


Link to post
Share on other sites

Ok, so I guess there are 3 "main libraries/wrappers" to use with tiva/stellaris:

FatFs

Petit FatFs (lightweight of FatFs)

and  Sd2Card (original distributed with the Arduino IDE)

 

I did a quick&dirty port of the Sd2Card Library, taken out of Arduino IDE 1.5.6 r2 for the Tiva/Stellaris, only changed some ARM settings, especially in the Sd2PinMap.h file: (at the top of the "arm" section): 

uint8_t const SS_PIN = 32;
uint8_t const MOSI_PIN = 8;
uint8_t const MISO_PIN = 13;
uint8_t const SCK_PIN = 11;

because I need SPI Module(0)

While in use don't forget to set in "Setup": 

SPI.setModule(0);

and get rid of the 

while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
lines in the examples and set up the CS Pin.
Now many of Arduino written sketches will work right out of the box!
 
Todo: more convenient selecting the SPI module and CS Pin, like 
SD.begin(CS_Pin,Module)

Attach Files:

SD.zip = Port of the Arduino SDCard Library

SD2Card_Tiva_examples.zip: some examples

SD.zip

SD2Card_Tiva_examples.zip

Share this post


Link to post
Share on other sites

Best solution is to use modern collaborative tools and share a repository.

 

I've created the SD_TM4C repository for SD Library for LaunchPad LM4F / TM4C and pushed my code.

 

Feel free to contribute and add support for other LaunchPad boards  :)

 

EDIT Correct link

Edited by Rei Vilo

Share this post


Link to post
Share on other sites

Thank you again, Rei Vilo!

I'm struggling a little bit with the "set module" in your library, for example when having a tft library on (2) and SD on (0), setting up the modules by hand within the code solved the problem. With a little time, I will do an automatic selector for that within the library.

 

Share this post


Link to post
Share on other sites

Best solution is to use modern collaborative tools and share a repository.

 

I've created the SD_TM4C repository for SD Library for LaunchPad LM4F / TM4C and pushed my code.

 

Feel free to contribute and add support for other LaunchPad boards  :)

There's an extra character in the link which breaks it, I was able to find it by googling it: SD_TM4C repository.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×