• 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 » Digital Signal Processors (DSP) » C5000 Ultra Low Power DSP » C5000 Ultra Low Power DSP Forum » SD Card examples in C55XCSL_LOWPOWER_2.10.00.00
Share
C5000 Ultra Low Power DSP
  • Forum
  • Announcements
Options
  • Subscribe via RSS
Top 6 Wiki Links
  • C5000 Main Wiki
  • C5000 Software
  • C5515 Boot-Image Programmer
  • CSL (including CSL 3.00)
  • C5000 Connected Audio Framework
  • Porting C5000 Teaching ROM to C5535 eZdsp
  • Forums

    SD Card examples in C55XCSL_LOWPOWER_2.10.00.00

    This question is not answered
    Klaus D
    Posted by Klaus D
    on Sep 13 2010 11:26 AM
    Prodigy40 points

    We made an expansion card for the VC5505 USB Stick with a sd Card interface. Using CCS 4.1.2.0027 we tried the SD card examples in the library. The programs csl_mmcsd_intr_example, csl_mmcsd_SDCardExample (polled) and csl_mmcsd_dma_example are build without problems but do not work. The intr and the dma example have an error when executing the function MMC_setBlockLength, status = 0xfff6. The polled example has an error when executing SD_setBusWidth, also with status 0xfff6.Has anyone successful tried the sd card examples for a VC5505 USB Stick?

    The example with the file system was not possible to build because a ATA driver library is missing and there is no project to create the library. Is there elsewhere a project for the library?

    Thanks in advance

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Hyun Kim
      Posted by Hyun Kim
      on Oct 12 2010 11:11 AM
      Genius12695 points

      Hi,

       

      You increase heap size with ***.tcf file. If you double click tcf file in your CCS4 project window, Configuration Tool windows will be open. Then select System-->MEM-->SARAM.

      Find heap size box and increase the size.

      4786.heap_increase.ppt

      Regards,

      Hyun

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

      Please click the Verify Answer button on this post if it answers your question.

      Check out these great resources

      http://processors.wiki.ti.com/index.php/Category:C5000
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Phu Thai Duong
      Posted by Phu Thai Duong
      on Oct 16 2010 22:11 PM
      Prodigy195 points

      Thanks for your help Hyun,

      I use a "for" loop to write successively to file in csl_mmcsd_atafs_example.c, like that:

      for( i=0;i<256;i++)
      {
          /* Write data to the file */
          for(index = 0; index < CSL_MMCSD_ATA_BUF_SIZE; index++)
          {
              gMmcWriteBuf[index] = i+1; // assign value to Write buffer
             
             
          }
          ata_error = ATA_write(pAtaFile, gMmcWriteBuf, CSL_MMCSD_ATA_BUF_SIZE);
          if(ata_error != ATA_ERROR_NONE)
          {
              printf("ATA_write Failed\n i=%d",i);
              return(ata_error);
          }
          else
          {
              printf("\nWriting Data to the file on SD card successful i= %d\n", i);
          }
      }

      It show "Writing Data to the file on SD card successful" in whole 256 loops.

      But, when I read from this file:

      ATA_seek (pAtaFile, 0);

          /* Read the data from the file in little endian mode */
         
          /* Close the file */
          ata_error = ATA_close(pAtaFile);
          if(ata_error != ATA_ERROR_NONE)
          {
              printf("ATA_close Failed\n");
              return(ata_error);
          }

          /* Compare the data read and data written */
          for(i=0;i<256;i++)
          {
              printf("i=%d\n", i);
              /////////////////////////////
              ata_error = ATA_readLittleEndian(pAtaFile,gMmcReadBuf, CSL_MMCSD_ATA_BUF_SIZE);
          if(ata_error != ATA_ERROR_NONE)
          {
              printf("ATA_readLittleEndian Failed\n");
              return(ata_error);
          }
          else
          {
              printf("\nReading Data from the file on SD card successful\n");
          }
              //////////////////////
          for(index = 0; index < CSL_MMCSD_ATA_BUF_SIZE; index++)
          {
             
              if(gMmcReadBuf[index] != i+1)
              {
                  printf("ReadBuf [%d]=%d\n",index, gMmcReadBuf[index]);
                  printf("i+1=%d\n",i+1);
                 
                  ata_error = 1;
                  printf("\nMMCSD Read and Write Buffers do not Match\n");
                  //break;
              }
          }

          if(ata_error == 0)
          {
              printf("\nMMCSD Read and Write Buffers Match\n");
          }
          }

          return(ata_error);

      i from 0 to 31, it's ok, MMCSD Read and Write Buffers Match. But from 32 to 256, MMCSD Read and Write Buffers do not Match, and all values readed from file equal to zero, like that in Debug window:

      i=32

      Reading Data from the file on SD card successful
      ReadBuf [0]=0
      i+1=33

      MMCSD Read and Write Buffers do not Match
      ReadBuf [1]=0
      i+1=33

      MMCSD Read and Write Buffers do not Match
      ReadBuf [2]=0
      i+1=33

      MMCSD Read and Write Buffers do not Match
      ReadBuf [3]=0
      i+1=33

      MMCSD Read and Write Buffers do not Match
      ReadBuf [4]=0
      i+1=33

      So, what is problem? :( and how can I correct it?

      I wonder that the problem is the instruction: ata_error = ATA_readLittleEndian(pAtaFile,gMmcReadBuf, CSL_MMCSD_ATA_BUF_SIZE);, it limits i<32, right??

      Please help me, if I need write a file with large size (it mean that i>32), what I have to do?

      I am very interested in this kit :D

      Thanks in advance.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hyun Kim
      Posted by Hyun Kim
      on Oct 18 2010 11:59 AM
      Genius12695 points

      Hi,

       

      I see that it happens. I'll follow up this.

      Regards,

      Hyun

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

      Please click the Verify Answer button on this post if it answers your question.

      Check out these great resources

      http://processors.wiki.ti.com/index.php/Category:C5000
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hyun Kim
      Posted by Hyun Kim
      on Oct 18 2010 13:34 PM
      Genius12695 points

      Hi,

       

      Here is a solution:

      You need to include attached files in your project.

      ata_error = ATA_fopen(pAtaFile, fileName, "txt"); // open a file, if there is no file then it creates one.

      for (i=0; i<256; i++) {

      /* Write data to the file */

           ata_error = ATA_write(pAtaFile, gMmcWriteBuf, CSL_MMCSD_ATA_BUF_SIZE);

           if(ata_error != ATA_ERROR_NONE)

           {

      printf("ATA_write Failed\n");

               return(ata_error);

           }

           else

           {

      //printf("\nWriting Data to the file on SD card successful\n");

      }

      } 

      /* Close the file */

          ata_error = ATA_close(pAtaFile);

          //ATA_flush(pAtaFile);

      /* Open the file */

          ata_error = ATA_fopen(pAtaFile, fileName, "txt");

       

      ATA_seek (pAtaFile, 0);

       

      for (i=0; i<256; i++) {

      /* Read the data from the file in little endian mode */

           ata_error = ATA_readLittleEndian(pAtaFile,gMmcReadBuf, CSL_MMCSD_ATA_BUF_SIZE);

           if(ata_error != ATA_ERROR_NONE)

           {

      printf("ATA_readLittleEndian Failed\n");

               return(ata_error);

           }

           else

           {

      //printf("\nReading Data from the file on SD card successful\n");

      }

      for(index = 0; index < CSL_MMCSD_ATA_BUF_SIZE; index++)

           {      

               if(gMmcReadBuf[index] != index+1)

               {

                   printf("ReadBuf [%d]=%d\n",index, gMmcReadBuf[index]);

                   printf("i+1=%d\n",i+1);

       

                   ata_error = 1;

                   printf("\nMMCSD Read and Write Buffers do not Match\n");

                  //break;

               }

           }

      }

      /* Close the file */

          ata_error = ATA_close(pAtaFile);

       

       

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

      Please click the Verify Answer button on this post if it answers your question.

      Check out these great resources

      http://processors.wiki.ti.com/index.php/Category:C5000
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Phu Thai Duong
      Posted by Phu Thai Duong
      on Oct 20 2010 03:10 AM
      Prodigy195 points

      Hi Hyun,

      Thank for your help.

      I got it and continue write my code, then I encounter with this error when I compile my project:

      errors encountered during linking; "CSL_MMCSD_SdCardFSExample_Out.out" not built

      placement fails for object ".text", size 0x13cbb (page 0).  Available ranges: SARAM        size: 0x3fc00      unused: 0x19b6c      max hole: 0x10000

       

      maybe in my code, many arrays are declared (like range[128][128]) and allocated (use "malloc" function), Does they make this error? And how can I deal with this?

      Thanks in advance.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • TommyG
      Posted by TommyG
      on Oct 20 2010 08:02 AM
      Genius12445 points

      Phu Thai,

      You .text section (code) is too big (0x13cbb bytes) for the memory space that you are trying to allocate this section to (SARAM: max hole = 0x10000 bytes).  It appears that there are some actions like alignment which is causing unusable holes to be generated leaving your largest continuous space to be only 0x10000 bytes which is smaller than the size of your .text section.  The memory description and allocation is done in the linker command file (.cmd).

      You will need to redo your memory allocation scheme (move sections to different memory blocks or reorder allocation directives), or redo your code to make is smaller.  Are you using optimization in the compilation stage?  Good documents that describe the Code Generation Tools are:
           Assembly Language Tools User's Guide (including Linker): http://www-s.ti.com/sc/techlit/spru280
           Optimizing C/C++ Compiler User's Guide: http://www-s.ti.com/sc/techlit/spru281

      Regards.

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

      ACAT/DCAT Team

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

      Please click the Verify Answer button on this post if it answers your question.
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Phu Thai Duong
      Posted by Phu Thai Duong
      on Jan 12 2011 02:14 AM
      Prodigy195 points

      Hi Hyun,

      I am trying to run some codes C/C++ on a new kit: TMS320C6416 Starter Kit. But I do not know where to find the examples and documents related to it like TMS320C5515 above.

      I have downloaded C6400 chip support library, but after installing, no document to show how to use that lib as well as run example code?

      Please, help me.

      Best regards,

      Thai

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Phu Thai Duong
      Posted by Phu Thai Duong
      on Jan 12 2011 02:56 AM
      Prodigy195 points

      Hi Hyun,

      I just wonder that where is file .out loaded? SARAM, DARAM, NOR Flash or where else?

      Because of small memory, so my program only can run with 64x64 image. Bigger images will make memory overflow.

      So, in the kit TMS320C5515 USB Sticky Kit, is there any bigger on-board memory for me to process a bigger image having 128x128 or 256x256 size? And how can I use it.

      Thank you so much.

      Best,

      Thái

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hyun Kim
      Posted by Hyun Kim
      on Jan 12 2011 10:32 AM
      Genius12695 points

      Hi,

      If you can see map file, you know where your code will be loaded.

      Also you can control using .cmd file to any section of code to place wherever you want.

      Please refer http://focus.ti.com/lit/ug/spru281f/spru281f.pdf Example 4−1. Linker Command File.

      Regards,

      Hyun

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

      Please click the Verify Answer button on this post if it answers your question.

      Check out these great resources

      http://processors.wiki.ti.com/index.php/Category:C5000
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Phu Thai Duong
      Posted by Phu Thai Duong
      on Jan 17 2011 22:08 PM
      Prodigy195 points

      Hi Hyun,

      I saw it, but I cannot understand all of them. how can I change the location that file .out is loaded? My file .out size is about 650k. I want to save this file in another memory space to maximize the memory space for allocate memory ( when using instruction malloc, alloc,...).

      Please help me. My prof. ask me to increase the size of processed image. So I need to expand the memory to allocate.

      Thank you so much, Hyun.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Hyun Kim
      Posted by Hyun Kim
      on Jan 18 2011 09:04 AM
      Genius12695 points

      Hi,

      You are run out of your memory resources. C5515 on chip memory is 320K so your code it too big.

      You have to reduce your code size. You can not simply increase your allocate memory size. However you can utilize SD card as data storage.

      Regards,

      Hyun

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

      Please click the Verify Answer button on this post if it answers your question.

      Check out these great resources

      http://processors.wiki.ti.com/index.php/Category:C5000
      --------------------------------------------------------------------------------------------------------- 

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    12
    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