Jump to content
43oh

PetiteFS FATfs SDCard USCI code


Recommended Posts

 

					do {
						ltoa(++n,Line);
						strcat(Line," The quick brown fox jumps over the lazy dog. 1234567890\r\n");
						res = pf_write(Line, strlen(Line), &bw);
						if (res != FR_OK) {
							put_rc(res);
							break;
						}
						if ( n & 0x10 ) {
							printf(".");
						}
					} while(n < 100);

in main.c.

Do I have to use these code with CSS? I've only IAR

 

Which code are you using? Link?

Link to post
Share on other sites
  • 3 weeks later...
  • Replies 144
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Edit: July 6th, 2014 Please also note that Pabigot maintains BSP430 which has an example for the msp430. He also tracks any changes done to the ElmChan library with patches made to the example. Refer

I went ahead and tested the booster pack and added the write support in the attached zip file. You should take a look at the Petit FatFS documentation regarding the write limitations. PetiteFS only

I took a look at the software serial code - I'm not seeing any issues with gutting it and using hardware UART unless I'm missing something obvious.  I'm not seeing anything that sets anything affectin

Posted Images

Hi everyone, i've the same problem with IAR when i try to download the project on the msp:

 

 

Building configuration: PetiteFS_G2553 - Debug
Updating build tree...
Linking
Warning[w6]: Type conflict for external/entry "printf", in module main against external/entry in module ?printf; function types differ in parameter 1; types  
have different type attributes
  /* In module main: */
  /* Function, args 2, attr 0 */
  int (__cc_version2 printf)(char *,
                             ...);
  /* In module ?printf: */
  /* Function, args 2, attr 0 */
  int (__cc_version2 printf)(char const *,
                             ...);
Fatal Error[e89]: Too much object code produced (more than 0x1000 bytes) for this package
Error while running Linker
 
Total number of errors: 1
Total number of warnings: 1
Link to post
Share on other sites
  • 4 weeks later...

does this support file/directory deletion as well?  I couldn't find anything in the code to support it...

Unfortunately no.

PetiteFatFS library, which is implemented here, does not allow it. This is because RAM is limited on the MSP430G2553. If you need file/dir deletion, you can use Elms FatFS library and try it on the Stellaris Launchpad.. or try a bigger MSP430.

Link to post
Share on other sites
  • 4 weeks later...

What does rc=1 mean? That is what I get in return. (MSP430G2553) Thanks, Simon

 

Edit: Sorry noticed that CLK and CS lines were backwards

It means disk error.  It should be rc=0

In diskio.h

 

 

 

/* Results of Disk Functions */
typedef enum {
RES_OK = 0, /* 0: Function succeeded */
RES_ERROR, /* 1: Disk error */
RES_NOTRDY, /* 2: Not ready */
RES_PARERR /* 3: Invalid parameter */
} DRESULT;
 

 

Link to post
Share on other sites
  • 3 weeks later...

Hello Bluehash,

 

I recently tried your code (given in the first page of this thread). I got the same error rc=1. I straight away connected the pins of MSP430G2553 to corresponding pins on SD Card. Now, my question, is there any need of pullup resister or any circuit elements to be connected to CLK, DATA, CS lnes, by any chance ? Please help me in this regard. 

 

I think, now, I was suppossed to use latest version of code in the above thread, Am I right ?

 

Thanks in adavance for the help.

 

--

Reagards,

Vksalian

Link to post
Share on other sites

Hello Bluehash,

 

Thanks for the reply and the link to wiki.

 

1. I got the error, rc=1 is for the "di" command I typed in the terminal window,

Disk Initialize...                                                              
rc=1 

 

I think its saying DISK error. But I believe it could be because of below confusion (point 2, below).

 

2. Also, I have one more confusion w.r.t. CD (CARD_DETECT) or CS pin. As per My understanding both are the same pins. But in the pdf at http://store.43oh.com/download/uploads/SDCardBoosterpack/schematic/43oh_BP_CardReader_SDCard_v1.2.pdf has 2 pin connections named as CS and CD.

 

3. Also, as per the TI site, they have used 47k pull-up resister to CS line. But in the pdf, it is 560 only with a LED in series. But I could not understand the purpose of uasage of resisters actually.

 

Please help me on understand the above points.

 

Note : I am using Linux based development platform with "minicom" as the terminal emulator. CCS5.2 for compilation and mspdebug for dumping the output file to MSP430G2553.

 

 

Thanks in advance.

 

--

Thanks,

Vksalian.

 

 

@@Vksalian

 

Use the wiki for the latest revision.

Also..what command gives you rc=1?

Link to post
Share on other sites

Hello Bluehash,

 

I have attached the connection image below. I still have a doubt on CD and CS pins since the pin connection info from the datasheet (table above) says CD and CS are same pins.

 

Please help me to get out of this connection. Also please let me know if you need any further info on this.

 

Thanks,

 

VKSALIAN

MSP430G2553-SD_Card+Connection.GIF

2. Chip select(CD) and Card Detect(CD) are two different pins. Chip select selects the SDcard. CD is just an indication that a SDcard is inserted. It is just for convenience.

 

3.Resistor to CS or CD? Same as above.

 

Can you post a pic of your setup?

Link to post
Share on other sites

Hello Bluehash,

 

I have attached the connection image below. I still have a doubt on CD and CS pins since the pin connection info from the datasheet (table above) says CD and CS are same pins.

 

Please help me to get out of this connection. Also please let me know if you need any further info on this.

 

Thanks,

 

VKSALIAN

 

edit : Added the link

 

MSP430G2553-SD_Card+Connection.GIF

Link to post
Share on other sites

Why don't you connect it according to the schematic for the SDCard booster? The code is meant for that. It will be easier to debug.

Lets see:

P1.5 ->SCLK-------->Card Pin5

P1.6 ->MISO  ------>Card Pin7 

P1.7 ->MOSI-------->Card Pin2

P2.0 ->Chip select->Card Pin1

..and ground/power.

 

Forget about the CardDetect for now

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...