• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Microcontrollers » C2000™ Microcontrollers » C2000 32-bit Microcontrollers Forum » FAT library for TMS320F28035
Share
C2000™ Microcontrollers
  • Forums
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
C2000 Resources
  • Product Folder
  • C2000 Training Portal
  • C2000 Technical Training Catalog
  • C2000 Datasheets, App Notes, User Guides
  • C2000 Hardware Design Kits
  • controlSUITE for C2000 Software Library


  • InstaSPIN Resources
  • What is InstaSPIN?
  • Videos and Support


  • InstaSPIN-FOC and InstaSPIN-MOTION Resources
  • What is InstaSPIN-FOC?
  • What is InstaSPIN-MOTION?
  • InstaSPIN Simulation Tool
  • Product Folder: F28069F, F28068F, F28062F, F28068M, F28069M
  • User’s Guide
  • Technical User’s Manual
  • Tools
  • FAT library for TMS320F28035

    FAT library for TMS320F28035

    This question has suggested answer(s)
    Gloria Budiman
    Posted by Gloria Budiman
    on Sep 27 2011 22:44 PM
    Intellectual815 points

    What's the easiest way to implement FAT library out there that will fit in the small 128-KB flash of TMS320F28035? All I need is read and write in FAT16.

    Thanks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Trey German
      Posted by Trey German
      on Sep 28 2011 16:42 PM
      Suggested Answer
      Genius14770 points

      Gloria,

      There are several FAT stacks out there that will fit in the flash of the 2803x devices.  FATFS is the one we use and it has a smaller derivative called Petite FATFS.

      It appears the webpage has been taken down, but it is still available in the Google Cached copy:

      http://webcache.googleusercontent.com/search?q=cache:yi3S8dDxl5gJ:elm-chan.org/fsw/ff/00index_e.html+fatfs&cd=1&hl=en&ct=clnk&gl=us&client=firefox-a

      I also zipped up a copy of the version we use with the 2806x devices.  This should port over without any major modifications to the 2803x devices.

      7282.fatfs.zip

      Hope this helps!

      Trey German

      C2000 Software Applications

      Trey German

      C2000 Applications

      If a post answers your question, please mark it with the "verify answer" button.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Gloria Budiman
      Posted by Gloria Budiman
      on Oct 03 2011 14:33 PM
      Intellectual815 points

      Hi,
      I've been trying to compile the code but I am getting these errors and I am not quite sure what the error is.
      Any guidance will be really appreciated. 
      Thank you
      [tff.c] "C:\CCStudio_v3.3MCU\C2000\cgtools\bin\cl2000" -g -pdsw225 -fr"C:/Documents and Settings/Username/My Documents/477grp5s2011/trunk/FatIO/Debug" -d"_DEBUG" -d"LARGE_MODEL" -ml -v28 -@"../../FatIO/Debug.lkf" "tff.c"
      Warning: The project has no cmd file while the Text Linker is selected
      [Linking...] "C:\CCStudio_v3.3MCU\C2000\cgtools\bin\cl2000" -@"Debug.lkf"
      <Linking>
      warning: creating output section ".ebss" without a SECTIONS specification
      warning: creating output section ".econst" without a SECTIONS specification
      warning: creating output section ".reset" without a SECTIONS specification
      warning: creating ".stack" section with default size of 0x400; use the -stack
         option to change the default size
       undefined        first referenced                                                                                       
        symbol              in file                                                                                            
       ---------        ----------------                                                                                       
       _disk_initialize C:\\Documents and Settings\Username\\My Documents\\477grp5s2011\\trunk\\FatIO\\Debug\\tff.obj
       _disk_ioctl      C:\\Documents and Settings\\Username\\My Documents\\477grp5s2011\\trunk\\FatIO\\Debug\\tff.obj
       _disk_read       C:\\Documents and Settings\\Username\\My Documents\\477grp5s2011\\trunk\\FatIO\\Debug\\tff.obj
       _disk_status     C:\\Documents and Settings\\Username\\My Documents\\477grp5s2011\\trunk\\FatIO\\Debug\\tff.obj
       _disk_write      C:\\Documents and Settings\\Username\\My Documents\\477grp5s2011\\trunk\\FatIO\\Debug\\tff.obj
       _get_fattime     C:\\Documents and Settings\\Username\\My Documents\\477grp5s2011\\trunk\\FatIO\\Debug\\tff.obj
       _main            C:\CCStudio_v3.3MCU\C2000\cgtools\lib\rts2800_ml.lib<args_main.obj>                                    
      error: unresolved symbols remain
      error: errors encountered during linking; "./Debug/FatIO.out" not built
      >> Compilation failure
      Build Complete,
        1 Errors, 5 Warnings, 0 Remarks.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Trey German
      Posted by Trey German
      on Oct 03 2011 14:58 PM
      Suggested Answer
      Genius14770 points

      Gloria,

      I notice a few things that I am concerned about in the linker output.

      1. It appears you do not have a linker command file associated with the project.  Link an appropriate file from here:C:\TI\controlSUITE\device_support\f2803x\version\DSP2803x_common\cmd into your project.
      2. The device specific functions (disk_initialize, disk_read, disk_write, etc.) aren't being compiled and linked into your project.  You need to compile the file mmc-c28x.c into your project.  You may have to modify this file to suit your application.  This should be pretty straight forward and should only involve changing the GPIOs used by the SPI peripheral.
      3. You have no main!!!!!  Did you try to just make a project with the sources in the zip file?  That won't work.  This is a library that provides the tools you need to access a FAT file system.  This is not an example of how to do it.  You will need to write a main.c source that makes calls to the standard file system operators (f_open, f_read, f_write, f_close, etc.).  Checkout tff.h for function prototypes.

      Let me know if this helps or if you have further questions.


      Trey German

      Trey German

      C2000 Applications

      If a post answers your question, please mark it with the "verify answer" button.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Alexander Kidarsa
      Posted by Alexander Kidarsa
      on Oct 04 2011 16:25 PM
      Prodigy20 points

      HI,

      I have installed control Suite and that has cleared up the first problem of the cmd linker file. However, for some reason mmc-c28x.c is not wanting to link to the right library. I'm using CCS3.3, the program that came with the micro controller. Is there a way to make CSS3 link to the library in 

      C:\TI\controlSUITE\device_support\f2803x\version\DSP2803x_common\cmd

      Thank you,
      Alex 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Trey German
      Posted by Trey German
      on Oct 04 2011 16:36 PM
      Genius14770 points

      Alex,

      I'm not sure I fully understand your problem.  If you compile mmc-c28x.c with your project it will automatically be linked in to your project.  Could you further elaborate on the problem you are having?

       

      I should have also mentioned earlier that I made the assumption that you wanted to talk to an SD card with your filesystem.  The mmc-c28x.c file is a driver for the SPI peripheral that allows the FAT filesystem to talk to the SD card.  If you intend to access a filesystem that isn't on an SD card you will need to provide your own driver file.

       

      Trey

      Trey German

      C2000 Applications

      If a post answers your question, please mark it with the "verify answer" button.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Alexander Kidarsa
      Posted by Alexander Kidarsa
      on Oct 04 2011 16:43 PM
      Prodigy20 points

      Actually, what we need is capability to read from and write to SD card formatted in FAT32 filesystem. If we do need our own driver file, is there any pointer on how to implement this?

      Thanks

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Trey German
      Posted by Trey German
      on Oct 05 2011 08:41 AM
      Suggested Answer
      Genius14770 points

      Alex,

       

      This software will do that.  The SD card will connect to the micro through SPI and then you will use ff.c or tff.c (smaller memory footprint) along with mmc-c28x.c.  mmc-c28x.c provides drivers for ff.c to access the SPI peripheral.

      I've attached an example application.  This was originally written for a Cortex M3 device and will not run as is on a C28x device.  It should provide a good example of how to use FatFS, and with a few modifications it should run on your device.


      5482.sd_card.c

      Trey

      Trey German

      C2000 Applications

      If a post answers your question, please mark it with the "verify answer" button.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Gloria Budiman
      Posted by Gloria Budiman
      on Oct 14 2011 23:46 PM
      Intellectual815 points

      I got the following error (after adjusting the GPIOs)

       undefined first referenced                                 

        symbol       in file                                      

       --------- ----------------                                 

       _spi_xmit C:\\TI_F28xxx_SysSW\\FatFSII\\Debug\\mmc-c28x.obj

      Wondering where that spi_xmit() function is. The return type of spi_xmit is BYTE, which makes me curious.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Trey German
      Posted by Trey German
      on Oct 17 2011 09:31 AM
      Suggested Answer
      Genius14770 points

       

      Gloria,

      Its just a simple SPI transmit/receive function.  Data to be transmitted is passed into spi_xmit and any data that is received is returned by the function.  I found the file where that came from and I've attached it at the end of this message.  Keep in mind this code is untested and unpolished.

      6445.F2806x_Spi.c

      1307.F2806x_SPI_defines.h

      Trey

      Trey German

      C2000 Applications

      If a post answers your question, please mark it with the "verify answer" button.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Gloria Budiman
      Posted by Gloria Budiman
      on Oct 22 2011 17:00 PM
      Intellectual815 points

      Hey,

      I am getting this error. What should I do ?

       

       

       

      Error connecting to the target:

      Error 0x00001200/-1041

      Error during: OCS, Target, 

      Device driver: Problem with the Emulation Controller.

      It is recommended to RESET EMULATOR.  This will disconnect each 

      target from the emulator.  The targets should then be power cycled

      or hard reset followed by an emureset and reconnect to each target.

      I/O Port = 0

      Board Name: F28035 XDS100USB

      Cpu Name: TMS320C2800_0

       

      Abort: Close Code Composer Studio.

      Retry: Try to connect to the target again.

      Cancel: Remain disconnected from the target

      Diagnostic: Run diagnostic utility.

       

       

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Trey German
      Posted by Trey German
      on Oct 28 2011 14:08 PM
      Genius14770 points

      Gloria,

      Have you connected to the board you are using previously?  If so what has changed between now and then?  Have you messed with any of the switches on the controlCARD?  Is the controlCARD powered correctly? Is this even a controlCARD or is this a custom board?  Without more information I can't make a hypothesis as to what is wrong.

      Trey

      Trey German

      C2000 Applications

      If a post answers your question, please mark it with the "verify answer" button.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Gloria Budiman
      Posted by Gloria Budiman
      on Oct 28 2011 15:23 PM
      Intellectual815 points

      Looks like one of my teammate was posting using my account. Please ignore that post above.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Gloria Budiman
      Posted by Gloria Budiman
      on Oct 31 2011 12:58 PM
      Intellectual815 points

      Anyway, I do have a question.

      I could successfully do f_open using the FatFS. However, after that, any f_open results in FR_WRITE_PROTECTED error. I make sure that the lock is not in place. Any idea what went wrong as I get this error? Why would the card become write protected all of a sudden?

      Thanks

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Trey German
      Posted by Trey German
      on Oct 31 2011 13:04 PM
      Genius14770 points

      Gloria,

      I'm not an expert on FATFs so I can't give you an exact answer, but if you look around in the source code a little bit I bet you can find your answer.

      Given that FR_WRITE_PROTECTED isn't anywhere in the f_open function I would bet that the issue is in the auto_mount function.  I bet you could step though this code and figure out where the problem is...

       

      Trey

      Trey German

      C2000 Applications

      If a post answers your question, please mark it with the "verify answer" button.
      Visit these helpful C2000 Links!
      C2000 TI Wiki Pages
      TI Forum Sitemap
      ControlSUITE
      C2000 Getting Started
      CLA FAQs
      Workshop Material!
      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Gloria Budiman
      Posted by Gloria Budiman
      on Oct 31 2011 15:49 PM
      Intellectual815 points

      I'm just curious, I was using the mmc-c28x.c  that you gave, but I used the ff.c from ELM-ChaN's website. I'm wondering if this would lead to problem? The ff.c in your zip file doesn't have f_printf() function that I need in my project, that's why I'm replacing it with the original files.

      Also, have you been able to at least read and write to the SD card with this file that you provided?

      Thanks

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    1234
    TI E2E™ Community
    • Support Forums
    • Blogs
    • Videos
    • Groups
    • Site Support & Feedback
    • Settings
    TI E2E™ Community Groups
    • TI University Program
    • Make the Switch
    • Microcontroller Projects
    • Motor Drive & Control
    Other Communities
    • Deyisupport
    • Designsomething.org
    • beagleboard.org
    • TI on Element 14
    • TI on TechXchangeSM
    Other Technical & Support Resources
    • WEBENCH® Design Center
    • Product Information Centers
    • Technical Documents
    • TI Design Network
    • TI Technical Articles
    • TI Training

    All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

    Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

    Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
    TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

    TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
    embedded processors, along with software, tools and the industry’s largest sales/support staff.

    © Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
    Trademarks | Privacy Policy | Terms of Use