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.

LAUNCHXL-F28379D: How to Write a FatFs SPI Disk IO Module

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

Hello all,

I am trying to use the FatFs library (found here: C:\ti\c2000\C2000Ware_4_01_00_00\libraries\fatfs) to manage files on an SD card. The SD card is attached to SPIB on the F28379D LaunchPad. I noticed that there are files named SDFatFS.c and sdspi.c located in C:\ti\c2000\C2000Ware_4_01_00_00\libraries\fatfs\sdspi.

My question is how do I implement the FatFs library with an SPI bus SD card. Where do I tell it to use the SPI bus/mode? Where do I assign the CS GPIO? I am initializing the SPI module and GPIO configurations in main.

Thanks,

- Matthew

  • The SDSPI examples we have in C2000Ware are mostly written with controlCARD in mind, but should be pretty portable to the LP. You have a couple options--

    There's an example for F2837x in device_support\f2837xd\examples\cpu1\sd_card\ that uses an older version of FatFS (utilities\third_party\f2837xd\fatfs) where the SPI and GPIO driver changes will need to be made to the mmc_F2837x.c file.

    There's also an example for F2838x in driverlib\f2838x\examples\c28x\sdspi that uses SysConfig to configure the SPI and GPIOs. You'll need to do a little porting from F2838x to F2837x, but I suspect just updating the driverlib paths and the SysConfig settings to F2837x will take care of most of it. It also uses a newer version of FatFS.

    I think I would recommend the latter option, but you can check out both.

    Whitney

  • I like the second option. Are there any examples for porting a project from one device to another?

    - Matthew

  • I'm getting the following error after porting the example project from the F2838x to F28379D.

  • Did you use the syscfg "Switch" button to move to F2837x? There are also some SysConfig settings in the project properties that can sometimes override what is specified in the .syscfg file that you'll need to change.

    We do have a video that explains this process:

    https://training.ti.com/c2000-sysconfig-migrate-c2000-devices-under-10-minutes

    The bit that I think that will address your error message is about 5 minutes in.

    Whitney