Hi, Someone has some information about a SD card file system for TMS320F28335 or there is any example? Regards, Paul.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi, Someone has some information about a SD card file system for TMS320F28335 or there is any example? Regards, Paul.
Hi Paul,
I too am looking for information on implementing a FAT32 file system for an SD card on a TMS320F28335. I can sucessfully read and write to the SD card having implemented SPRA007 application note. This does not however, cover any file system which means the data cannot be read by a PC which asks to format the SD card. I have followed the thtread which discusses mmc-c28x.c but this thread was not concluded with any real sucess.
I can help you with the hardware but wondered if you have had any further sucess with the file system?
Regards
Geoff
Hi Sung,
I am using the TMS320F28335 part and have successfuly implemented code to read/write csv files to the SD through the SPI in FAT32 format. I would be happy to help with code and schematics, as I had a difficult time at first. This was due to a very sneaky code error in the xmit_datablock code, that always returned an error. Please find attached schematics and code that may help. The pinouts are on the schematics as well.
/CS connects to /SPISTEA (Pin 1 on the SD card socket)
SCK connects to SPICLKA (Pin 5 on the SD card socket)
SDO1 connects to SPISIMOA (Pin 2 on the SD card socket)
SDI1 connects to SPISOMIA (Pin 7 on the SD card socket)
Supply must be at 3.3V
/**********************************************************/
/* SD here */
fresult = f_mount(0, &Fatfs);
fresult = f_open(&File,"/Log.CSV", FA_WRITE | FA_OPEN_EXISTING); /* Write the time the unit was switched on. */
die(fresult);
read_I2C_time_date(&I2C_time);
WriteCount = f_printf(&File,"A, v%D,b%D\r\n",version,build);
die(fresult);
WriteCount = f_lseek(&File, f_size(&File));
/* Move to end of the file to append data */
WriteCount = f_printf(&File,"Date,%D-%D-%D\r\n",I2C_time.tm_day,I2C_time.tm_mon,I2C_time.tm_year);
die(fresult);
WriteCount = f_printf(&File,"Time,%D:%D:%D\r\n",I2C_time.tm_hour,I2C_time.tm_min,I2C_time.tm_sec);
die(fresult);
uart_printf("%d bytes written.\r\n", bw);
uart_printf("\nClose the file.\n");
fresult = f_sync(&File);
fresult = f_close(&File);
/* Unregister work area prior to discarding it */
f_mount(0,NULL);
It works for me writing at 4MHz. Any queries just ask.
I also have code for printf statements which I found hard to find.
As you are probably aware, this is a great site. http://elm-chan.org/fsw/ff/00index_e.html
Regards
Geoff
Thanks Geoff, I also used the same code some times back and it worked fine. I tried it on a slower speed. Now I will try it on 4 Mhz.
Hi Piotr,
I have a working project that allows you to read and write to an SD card for a TMS320F28335 TI device but the code for the SD should be generic. For speed I can zip up the entire project. It was compiled under CCS 4.2.4.
You will probably only need ff_9a.c, mmc-28x-ff9a.c and the SD_SPI files, plus the code in main to write something to your SD card.
I am happy to help, as many have helped me.
Regards
Geoff
Hi Piotr,
The entire project can be zipped to you as is, if you can allow me access to your email. This is a commercial project so not freely distributable.
Regards
Geoff