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
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---------------------------------------------------------------------------------------------------------
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=32Reading Data from the file on SD card successfulReadBuf [0]=0i+1=33MMCSD Read and Write Buffers do not MatchReadBuf [1]=0i+1=33MMCSD Read and Write Buffers do not MatchReadBuf [2]=0i+1=33MMCSD Read and Write Buffers do not MatchReadBuf [3]=0i+1=33MMCSD Read and Write Buffers do not MatchReadBuf [4]=0i+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.
I see that it happens. I'll follow up this.
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);
/* Read the data from the file in little endian mode */
ata_error = ATA_readLittleEndian(pAtaFile,gMmcReadBuf, CSL_MMCSD_ATA_BUF_SIZE);
printf("ATA_readLittleEndian Failed\n");
//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;
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?
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.---------------------------------------------------------------------------------------------------------
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
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
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.
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.
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.