Jump to content
calinp

[Energia Library] Petit FatFS SD Card Library

Recommended Posts

Hi,

 

it seems the file energia-1.6.10E18/hardware/tools/msp430/msp430/include/msp430f5529.h has a problem in the USB definition part. I don't know exactly what for a problem, but I was able to compile the above mentioned sketch after commenting out the USB part in msp430f5529.h (between rows ~3430 and ~4227).

Maybe it helps you.

 

Regards,

Liviu

Share this post


Link to post
Share on other sites

Hi,

 

fount it. :)

It seems, the DIR definition in energia-1.6.10E18/hardware/tools/msp430/msp430/include/msp430f5529.h

/* USBCTL Control Bits */
#define DIR            (0x0001)  /* USB - Data Response Bit */
conflicts with the DIR in the energia-1.6.10E18/libraries/PFatFs/utility/pff.h:

/* Directory object structure */
typedef struct {
	WORD	index;		/* Current read/write index number */
	BYTE*	fn;			/* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
	CLUST	sclust;		/* Table start cluster (0:Static table) */
	CLUST	clust;		/* Current cluster */
	DWORD	sect;		/* Current sector */
} DIR;
No idea where it will be better to change to remove the conflict, but probably in the PFatFs.

 

Regards,

Liviu

Share this post


Link to post
Share on other sites

Ok...So how do I change these files?  

 

Where are they?

How do I change them when they are compiled inside energia.

How do I uninstall a library?

 

Silly questions....but if I cannot find the files on my machine I cannot fix them.

 

 

Feeling....

 

Spineless

Share this post


Link to post
Share on other sites

I've changed the DIR with FSDIR in the PFatFs library; I'm attaching the changed library here. Just replace the one on your PC with the attached one.
On my PC I've put it in ../energia-1.6.10E18/libraries/PFatFs/
You should probably change your sketches too.

 

Regards,

Liviu

 

EDIT: updated the library (fixed the examples too).

PFatFs.zip

Share this post


Link to post
Share on other sites

I am not sure how to remove the old files.   I am working with MAC OS X and I do not have a file structure to look at so I cannot simply replace files.

 

Instead I reloaded PFatFs into Energia using the Include Library --> add .ZIP tool.

 

I do not think this worked as I am getting the same error.

 

I tried to delete Energia and redownload it but that did not work either. i guess the settings are saved someplace else.   I do not know where.

 

Any help would be great.

 

Spineless 

Share this post


Link to post
Share on other sites

Weird thing happened.   I just changed DIR to FSDIR...as you mentioned and it compiled. 

 

I guess the library got replaced when I copied.

 

Thanks for your help.

 

Spineless.

Share this post


Link to post
Share on other sites

Hi,

Glad to hear it's working for you.

Since the changed library seems to work (I've also updated the example and replaced the library in the post above), maybe Calin or a moderator can update the download on the first post of the topic.

 

Liviu

Share this post


Link to post
Share on other sites

i am having some issues with the example file.   I want to seperate the write and read functions, but I am getting a lot of errors when I attempt to seperate them.  I want to write a string of data to the file in the SD card then later read the entire file back. 

 

Can you please update your example with this functionality?   Subroutines are awesome!   If you could simple call a subroutine to write data and then a seperate subrountine to read it that would be great. 

 

Spineless

Share this post


Link to post
Share on other sites

Hello,

 

This is a port of ChaN Petit FatFS SD library targeted to low RAM microcontrollers and offers a minimal FAT implementation, with limited write support. For more details see http://elm-chan.org/fsw/ff/00index_p.html

 

A lot of credits goes to the main contributors to this topic http://forum.43oh.com/topic/1427-petitefs-fatfs-sdcard-usci-code/

 

 

Because this library makes use of the SPI library included in Energia it  works for both MSP430 and Stellaris launchpads.

 

With MSP430 I noticed some interference with Serial.print so before every call to the fat library I had to add a small delay. On Stellaris board these are not necessary. 

 

 

Unzip and copy in Energia\hardware\msp430\libraries or Energia\hardware\lm4f\libraries .

 

[uPDATE] See post #15 http://forum.43oh.com/topic/3209-energia-library-petit-fatfs-sd-card-library/#entry30031

 

[DOWNLOAD LINK] http://forum.43oh.com/index.php?app=core&module=attach&section=attach&attach_id=3019

Hello, 

 

I tried this library on MSP432, but it doesn't work. What changes should I make to make it work.

Thanks!

 

Marvin

Share this post


Link to post
Share on other sites

I am getting error

Quote

Failed with rc=3

When i interchange MISO MOSI pins I get error 

Quote

Failed with rc=6

what could be possibly wrong??

Thax in advance...

Can someone give me your mobile number please I really want to solve  this problem...

 

I will pay 5 $ if anyone can solve my problem... Please help me...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...