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.

C5515 ezdsp SD Card Detection

Other Parts Discussed in Thread: TMS320C5515, ADS1298

Hi, I am studying the SD card functionality. I read the document sprufo6a and now I am trying observe the examples supply by CSL. When I load the examples CSL_MMCSD_SdCardExample or CSL_MMCSD_dmaExample no errors occur during the compilation/load but when the program runs the console shows:

CSL_MMCSD_SdCardExample:

CSL MMCSD - SD CARD POLL MODE TEST!

API: MMC_open Successful

No Card Detected!

Please Insert SD card!!

CSL MMCSD - SD CARD POLL MODE TEST FAILED!!

 

CSL_MMCSD_dmaExample:

CSL MMCSD DMA MODE TESTS!

DMA MODE TEST WITHOUT CALLBACK

NO Card Detected!

Insert MMC/SD Card!

DMA MODE TEST WITHOUT CALLBACK FAILED!

DMA MODE TEST WITH CALLBACK

NO Card Detected!

Insert MMC/SD Card!

DMA MODE TEST WITH CALLBACK FAILED!

CSL MMCSD DMA MODE TESTS FAILED!!

 

I am using SDHC Kingston 4GB and I formatted the SD card with SDFormatter V2.0 (www.sdcard.org) and read/write data without problem. My CCS4 has version 4.1.2.00027. My CSL is the latest TMS320VC55XCSL-LOWPWR-2.01.00.00. Please, could anybody help me understand what is happing?

Regards,

Andrea

  • Hi,

     

    This is the known issue on the current CSL and we had a fix. The quick fix is that is using CSL_MMCSD1_INST instead of CSL_MMCSD0_INST.

    The reason is the 5515EVM and ezDSP use the different SD channel.

     

    #ifdef C5515_EZDSP

    mmcsdHandle = MMC_open(&pMmcsdContObj, CSL_MMCSD1_INST, CSL_MMCSD_OPMODE_POLLED, &mmcStatus);

    #else // EVM

    mmcsdHandle = MMC_open(&pMmcsdContObj, CSL_MMCSD0_INST, CSL_MMCSD_OPMODE_POLLED, &mmcStatus);

    #endif

     

    Regards,

    Hyun

  • Hi Hyun, I would like to thank you for help, it is working.

    Regards,

    Andrea

  • Andrea,

    Were you able to verify manually using Windows explorer that the data indeed was written to the SD Card ?

    When I try to access the data in SD Card it keeps asking me whether I want the SD Card to be formatted. Even after formatting using the formatter

    you have mentioned the next time I try to access  the SD Card it asks me the same question "whether the card should be formatted?" . If I say no I

    am not able to browse the data in the SD Card. I have formatted atleast 10 times.

    I look forward to your response,

    thanks,

    AV.

  • Hi AV,

     

    When I insert the SD on the computer the Windows recognize automatically.

     

    A curious thing happing with me because my unformatted SD works perfectly. I debug the code step by step and no error occurred when my SD is unformatted. When errors writing data to SD occurring so when I try read with Windows a message asking for formatting appear.

     

    Do you tried with other SD? Which model of SD are you using? Because I think that SDXC are not supported yet.

     

    What I did:

    1-) Download the new CSL; (http://software-dl.ti.com/dsps/dsps_public_sw/dsps_swops_houston/C55X/CSL-c55x-lowpower-versions.htm)

    2-) Build the atafs_bios_drv_lib.lib;

    3-) Modify CSL_install_directory\c55xx_csl\inc\csl_general.h file.

          line 159 : //#define C5515_EVM    // make a comment out, CSL release default is for C5515EVM.

    4-) Build the project;

    5-) Run.

     

    My application is similar your because I am trying recorder audio signal from codec to SD card but it is not working yet.

     

    I hope that help you.

     

    Regards,

     

    Andrea

  • Hi,

    If you are running the MMCSD CSL examples 1-3 and 5, no need to format the SD card. Windows cannot read the data written by this examples even you put a formatted SD card. More over these examples corrupt the FAT sectors and Windows says your card is not formatted after running this examples. You need to format the SD card to run the MMCSD CSL example 4 and 6. Data written by these examples can be read by the Windows.

     

    Pratap. 

     

  • Hi All, 

    I have been working on SD Card reading and writing.

    My configuration: CCS ver 4.0; C5515 USB ezDSP stick.

    I am able to Build and Run the CSL_MMCSD_dmaExample. It works fine. It means using DMA, I am able to write and read from SD Card.

    Then when I execute the CSL_MMCSD_SdCardExample the Writing takes place fine but the code hangs during the reading phase.

    Could someone point out why this could be so ? I am just running the code as it is. Using the linker command file that came with this example VC5505_MMCSD.cmd.

    Also I have Built and included the atafs_bios_drv_lib.lib into this project.

    The output at the console is:

    CSL MMCSD - SD CARD POLL MODE TEST!

    API: MMC_open Successful
    SD card Detected!
    SD card is Standard Capacity Card
    Memory Access will use Byte Addressing

    API: MMC_write Successful

    The code hangs at the following lines of code which are at approximately line numbers: 3803-3810 of file csl_mmcsd.c

                        do
                        {
                            status = hMmcsd->mmcRegs->MMCST0;
                            if((status & CSL_MMCSD_DATA_TOUT_CRC_ERROR) != 0)
                            {
                                reIssueReadFlag = 1;
                                break;
                            }

                        } while((status & CSL_MMCSD_READ_READY) != CSL_MMCSD_READ_READY);

    Andrea, I am using a Transcend microSD  Card . 1 Gbyte. I build the atafs_bios_drv_lib.lib . But what is the purpose ? 

    Pratap, CSL_MMCSD_SdCardExample is Example 4. But still it does not run fine. I formatted the SD Card as well.

     

    Looking forward to a solution for the code hanging issue,

    Thanks,

    AV.

     

     

  • Hi AV,

     

    I compiled and ran the example CSL_MMCSD_SdCardExample_Out right now and the Console present the follow messages, so it worked. Detail, my SD was unformatted.

     

    CSL MMCSD - SD CARD POLL MODE TEST!

     

    API: MMC_open Successful

    SD card Detected!

    SD card is High Capacity Card

    Memory Access will use Block Addressing

     

    API: MMC_write Successful

    API: MMC_read Successful

    API: MMC_close Successful

     

    SD Card Read & Write Buffer Matched

     

    CSL MMCSD - SD CARD POLL MODE TEST PASSED!!

     

    What I did:

    1-) Import the project CSL_MMCSD_SdCardExample_Out by CSL version 2.10;

    2-) Modify CSL_install_directory\c55xx_csl\inc\csl_general.h file.

          line 159 : //#define C5515_EVM    // make a comment out, CSL release default is for C5515EVM.

    3-) Built and debug the project;

    4-) Ran.

     

    My Code Generation Tool is 4.3.7 because the .pdf of CSL version 2.10 recommended it. To install new versions go to Help menu of CCS4 and chose Software Updates (Search for new features to install).

     

    Sorry, I was wrong before because this example do not use atafs_bios_drv_lib.lib.

     

    I had a similar problem (still in a while loop infinitely because MMCST0 was always zero) when I set wrong target on csl_general.h file. Please, verify it with very very attention.

     

    Good luck,

     

    Andrea

     

  • Hi Andrea,

    WOW !!!! Thanks a lot !!!!

    The issue is resolved. The problem was that I had to update the Code Generation Tool to 4.3.7.

    It seems we are working on similar kind of project ... so it is better if we also are able to email. My email addr: relaxcoolcalm@yahoo.com

    Thanks,

    - AV.

  • Hi Pratap,

    I am using the example CSL_MMCSD_SdCardFSExtExample (CSL 2.10) with some modifications to acquire and record audio signal from codec to SD card. Because audio signal has high sampling rate (for example 22050 Hz) will be necessary that the operation of write to SD is fast. I included GPIO functions as below to observe the time elapsed during an ATA_write operation.

    GPIO_write(hGpio, CSL_GPIO_PIN13, 1); // put pin to high

    ata_error = ATA_write(pAtaFile, gMmcWriteBuf, CSL_MMCSD_ATA_BUF_SIZE);

    GPIO_write(hGpio, CSL_GPIO_PIN13, 0); // put pin to low

     

    I observed the GPIO13 with a digital oscilloscope and the times varies according the figure above. This variability (150ms) impedes my sound acquisition and the recorded file becomes useless. Other interesting observation was when I changed the CSL_SD_CLOCK_MAX_KHZ to 50MHz and the times still the same.

     

    I debug the ATA_write function using Step Into and Step Over and I do not come to a conclusion.

     

    Please, I imagine that you are very busy but could you help me understand what is happing? Will be possible fix it?

    Thank you very much. 

    Regards,

     

    Andrea

     

     

  • Hi Andrea,

    At what CPU clock frequency you are running the SD card example?. What is the SD card you are using?.

    ATA_write() should not take 150ms. Also it should not be so much varying. You should be able to write the data to SD card recorded at 22050 using ATA_write. Try disabling the MMC/SD data caching by commenting 'ENABLE_CACHE' macro in csl_mmcsd_ataIf.c file. In the absence of caching, in ideal case you should see the consistent write timing.

    Pratap.

     

     

  • Dear Pratap, thank you so much for attention. I did what you recommended but the variability still.

    I would like to give you more information about my tests:

    1.   sysClock = 100MHz;

    2.   CSL_MMCSD_ATA_BUF_SIZE  =  256u;

    3.   CSL_SD_CLOCK_MAX_KHZ  =  20000u. I changed to 50000u but still the same times (why?);

    4.   I commented out the POLL MODE part and I am using only the DMA MODE (because the performance is better);

    5.   I included the switches functionality to stop the program;

    6.   Before ATA_write I use a while () to keep write;

    7.   After ATA_write I use the ATA_seek_relative to appended new data to the file on SD;

    8.  My carde is 4GB SDHC Kingston;

    9.   After the message “ File Creation/Open on SD card is Successful” of mmcConfigFs() function I put Run = TRUE and the code below:

     

    while(Run)

    {

    key = Get_Sar_Key(); // Verify SW

    GPIO_write(hGpio, CSL_GPIO_PIN13, 1);

    ata_error = ATA_write(pAtaFile, gMmcWriteBuf, CSL_MMCSD_ATA_BUF_SIZE);

    GPIO_write(hGpio, CSL_GPIO_PIN13, 0);

    ATA_seek_relative(pAtaFile, 0);

    if(key == SW2) // If SW2 pressed

    {

          Run = FALSE;

    ata_error = ATA_close(pAtaFile);

    }

    }

    The file is saved on SD but the time variability is present. Please, could you give me more hints about this time variability?

     

    Thank you very much!!!

     

    Andrea

     

  • Hi All,

    I'm using the Kit TMS320C5515 EZDSP on my graduation project. I need to use a SD card to store and load a sound in wav format in the DSP output. This could be possible?

    I've tried to access the sd card, with the examples in C55xx_CSL_3.00: CSL_MMCSD_SdCardExample, but didn't work. Follow below the errors that appears in the dialog box:

    "../csl_mmcsd_SdCardExample.c", line 681: error: struct "<unnamed>" has no field "CGCR1"
    "../csl_mmcsd_SdCardExample.c", line 681: error: identifier "CSL_SYS_CGCR1_MH_MASK" is undefined
    "../csl_mmcsd_SdCardExample.c", line 681: error: identifier "CSL_SYS_CGCR1_MH_SHIFT" is undefined
    "../csl_mmcsd_SdCardExample.c", line 682: error: struct "<unnamed>" has no field "CGICR"
    "../csl_mmcsd_SdCardExample.c", line 682: error: identifier "CSL_SYS_CGICR_ML_MASK" is undefined
    "../csl_mmcsd_SdCardExample.c", line 682: error: identifier "CSL_SYS_CGICR_ML_SHIFT" is undefined
    "../csl_mmcsd_SdCardExample.c", line 684: error: struct "<unnamed>" has no field "CGICR"
    "../csl_mmcsd_SdCardExample.c", line 684: error: identifier "CSL_SYS_CGICR_RDRATIO_MASK" is undefined
    "../csl_mmcsd_SdCardExample.c", line 684: error: identifier "CSL_SYS_CGICR_RDRATIO_SHIFT" is undefined
    "../csl_mmcsd_SdCardExample.c", line 685: error: struct "<unnamed>" has no field "CGOCR"
    "../csl_mmcsd_SdCardExample.c", line 685: error: identifier "CSL_SYS_CGOCR_ODRATIO_MASK" is undefined
    "../csl_mmcsd_SdCardExample.c", line 685: error: identifier "CSL_SYS_CGOCR_ODRATIO_SHIFT" is undefined
    "../csl_mmcsd_SdCardExample.c", line 687: error: struct "<unnamed>" has no field "CGICR"
    "../csl_mmcsd_SdCardExample.c", line 687: error: identifier "CSL_SYS_CGICR_RDBYPASS_MASK" is undefined
    "../csl_mmcsd_SdCardExample.c", line 687: error: identifier "CSL_SYS_CGICR_RDBYPASS_SHIFT" is undefined
    "../csl_mmcsd_SdCardExample.c", line 688: error: struct "<unnamed>" has no field "CGOCR"
    "../csl_mmcsd_SdCardExample.c", line 688: error: identifier "CSL_SYS_CGOCR_OUTDIVEN_MASK" is undefined
    "../csl_mmcsd_SdCardExample.c", line 688: error: identifier "CSL_SYS_CGOCR_OUTDIVEN_SHIFT" is undefined
    "../csl_mmcsd_SdCardExample.c", line 689: error: struct "<unnamed>" has no field "CGOCR"
    "../csl_mmcsd_SdCardExample.c", line 689: error: identifier "CSL_SYS_CGOCR_OUTDIV2BYPASS_MASK" is undefined
    "../csl_mmcsd_SdCardExample.c", line 689: error: identifier "CSL_SYS_CGOCR_OUTDIV2BYPASS_SHIFT" is undefined
    21 errors detected in the compilation of "../csl_mmcsd_SdCardExample.c".

    >> Compilation failure
    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: *** [csl_mmcsd_SdCardExample.obj] Error 1
    C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: Target `all' not remade because of errors.

    I've followed the steps like in the release Notes of C55xx_Low Power, commented out the  #define C5517 and the #defineC5515 EVM, and nothing happening!

    Could someone help me, or tell me what i did wrong?

    Henrique Leoni

  • Thank you it worked out!!!

  • hello pratap and all,


    I am trying yo interface ADS1298 with C5515EVM . The objective is to acquire signal information and store it.
    i have run the required CSL examples for my project that shall be of importance.
    The path flow and my objectives::::::::::
    1. Use ECG_nonBIOS.pjt application for obtaining the code for ADS1298 interface.
    2. Use RTC example from CSL library....... for CCS v6.X ............... CSL_RTC_Example_OUT to run the rtc and obtain the current time and date..
    3. Use MMCSD example from CSL library ........... for CCS v6.X............. CSL_MMCSD_SdCardExample_Out to write data into SD card.( Suggest an alternative example from the same library folder of examples, as this doesnt make it into a readable by the operating system)
    4. Use LCD example from CSL Library........ for CCS v6.X ........... CSL_LCDC_TextdispalyExmaple_Out to write strings using "draw_string" on the LCD display provided on the board.

    whilst the above CSL examples are running independently, i would like to combine the three to achieve he following::::::::::::
    Use the time and date generated by the RTC every second to display it on LCD, while at the same time store the RTC date and time every second on the SD card.
    i would require to combine the three so as to achieve the desired objective.
    I request you to please guide me in combining the three examples into one and achieve the result at the earliest.

    thank you
    regards

    balasubramanya