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.

TI-RTOS SDSPI FATFS MSP430F5338

Other Parts Discussed in Thread: MSP430F5338, MSP430F5529

Hi,

1. We are using MSP430F5338, TI-RTOS 1.20.00.28, CCS 5.5.0.00077

2. SD card : SnaDisk 8GB, SDHC, class-4 formatted FAT32 on Windows 7 system.

Issues :

1. Card recognizes as SDSC instead of SDHC.

2. I made few changes in fatsf dir but I can not build bios. The log file attached.

command : C:\ti\tirtos_1_20_00_28>..\xdctools_3_25_04_88\gmake.exe -f tirtos.mak bios

Errors : Starting build of library sources ...
Build of libraries failed.
error: xdc.cfg.SourceDir: "C:/ti/xdctools_3_25_04_88/packages/xdc/cfg/SourceDir.
xs", line 184: xdc.cfg.SourceDir : Build of generated source libraries failed: e
xit status = 2:
cmd.exe: not found

Clarification :

1. Do TI-RTOS and fatfs provided by TI support 8/16/32 GB SDHC cards ?

2. Is there any restrictions on make, size and class of SD card ?

Thanks

2860.biosBuildLog.txt

  • Hi Channabasappa,

    Can you post your tirtos.mak and tirtos.bld files?

    Channabasappa Kolar said:
    1. Do TI-RTOS and fatfs provided by TI support 8/16/32 GB SDHC cards ?

    I've tested a 4GB SCHC card before but my assumption it should work on a other SDHC cards.

    If you use the SDSPI driver's instrumented libraries, you can view the "Log_print" statements. It will print out what card it thinks it has.

    Channabasappa Kolar said:
    2. Is there any restrictions on make, size and class of SD card ?

    Not that I know of. See this app note: http://elm-chan.org/fsw/ff/en/appnote.html#limits.

  • Hi Tom,

    Thanks a lot for your quick response.

    1. I have attached tirtos.mak as tirtos_mak.txt and tirtos.bld as tirtos_bld.txt.

    2. I tried SanDisk and Trascent 8GB SDHC, class-4. Both got recognized as SDSC. I also tried Samsung 8GB class-4 but never get recognized. Always get NOCARD in cardType in SDSPI driver. All are microSD cards.

    3. Here are the error log in console :

    Drive 0 is mounted
    Creating a new file "fat:0:input.txt"...Error: "fat:0:input.txt" could not be created
    Aborting...

    4. Here is the instrumented log :

    6378173,MSP430,SDSPI:(@5e0) opened,Main Logger,,
    7781982,MSP430,SDSPI:(@5e0) initialized SD card to SPI mode,Main Logger,,
    10559082,MSP430,ClockFreqs_getFrequency SMCLK: 8192000,Main Logger,,
    10620117,MSP430,SDSPI:(@5e0) CPU freq: 8192000; Reconfiguring SDSPI freq to 2500000,Main Logger,,
    18737792,MSP430,SDSPI:(@5e0) initialized SD card to SPI mode,Main Logger,,
    20141601,MSP430,ClockFreqs_getFrequency SMCLK: 8192000,Main Logger,,
    20202636,MSP430,SDSPI:(@5e0) CPU freq: 8192000; Reconfiguring SDSPI freq to 2500000,Main Logger,,

    5. I also tried the sdfs examples (sdfs_MSP430F5529 and sdfsrawMSP430F5529 provided by TI on MSP430F5529LP card. In both cases, the control do not even goes to example code.

    6. I copied same application code to our MS430F5338 project on our board, the control goes to fatfs application but getting above problems.

    I appreciate your help.

    Thanks.

    7418.tirtos_bld.txt

    6675.tirto_mak.txt

  • Hi Tom,


    Any update ? I appreciate if you could help me in :

    1. bios fatfs build which is part of bios build in TI-RTOS. As I wrote, I get errors. I have attached bld, mak and log files in my earlier posts.

    2. Why I am getting SDSC for SDHC 8GB microSD, class-4 card which is formatted as FAT32. I am using in SD adopter to insert microSD in SD slot.

    I looked into SDSPIUSCIB.c, for CMD58,  and I always get CCS=0 in OCR register.

    I am looking forward to hear from you.

    Thanks.

  • Sorry about that, I forgot to follow up on this.

    I tried using your tirtos.mak and tirtos.bld files and bios built fine, so I'm not sure exactly where the problem is in rebuilding bios. Can you enable verbose output on sys/bios by uncommenting:

    XDCOPTIONS=v

    in C:\ti\tirtos_1_20_00_28\products\bios_6_37_00_20\bios.mak and then run:

    c:\ti\tirtos_1_20_00_28>..\xdctools_3_25_04_88\gmake.exe -f tirtos.mak clean-bios bios > Make.log

    This should be a big file. Can you repost Make.log when this is done?

    I'm also not sure why the 8GB SDHC card is as a SDSC card. The print statements indicate that you were able to get the device out of reset state and were able to communicate with it... I'll try to reproduce this problem today.

    When you tried the FatSD examples in TI-RTOS, did you use the same SDHC card? Can you try a smaller card (any SDSC or a 4GB SDHC card) to determine if the example works then? Also note that you need to use the MSP430F5529LP rev 1.4 for the FatSD examples to work with the SDCard boosterpack (http://store.43oh.com/index.php?route=product/product&path=64&product_id=70).

  • Hi Tom,

    Thanks a lot.

    1. I build with verbose on and attached the log file. As I did clean build, now I can not work until you help me to fix this problem.

    2. Please note, as soon as the error occurs, the log redirection to file stops and it displays on command window. I copied last lines from command window and pasted in the log file. I made a clear note at the end of the file.

    3. With example code provided by TI (fatsd_MSP4305529 and fatsdraw_MSP430F5529), the control do not even reach taskFxn() task. Once control goes to bios from main (), it never comes to task. I am not sure why. I copied the same code in my build (for MSP430F5338), the control comes to task and it fails later as I mentioned in this chain.

    4. I using MSP430F5529LP Ver#1.5.

    5. For me, always it recognizes as SDSC, always CCS bit in OCR is set to 0 (as response to CMD58). I single stepped good amount of code and but the CCS bit never get set.

    6. Unfortunately, we do not have 4GB and getting it also difficult as people are moving to 16/32 GB storage. I will try, but not sure.

    7. I saw few bugs in the code. I am fixing on the way. Once every thing works, I will send you the source code, you can review and update the base line code.

    Thanks.

    2783.mak.log.

  • Channabasappa Kolar said:
    1. I build with verbose on and attached the log file. As I did clean build, now I can not work until you help me to fix this problem.

    I checked with some colleagues on the build error. I was able to reproduce this when I didn't have "C:\Windows\system32" in the path variable. Can you type "set" in your command prompt and see if it exists in your "Path" variable?

    Can you add it before you call gmake?

    c:\ti\tirtos_1_20_00_28>path=C:\Windows\system32;%path%

    c:\ti\tirtos_1_20_00_28>..\xdctools_3_25_04_88\gmake.exe -f tirtos.mak bios

    Please, let me know if it builds for you now.

    Channabasappa Kolar said:
    3. With example code provided by TI (fatsd_MSP4305529 and fatsdraw_MSP430F5529), the control do not even reach taskFxn() task. Once control goes to bios from main (), it never comes to task. I am not sure why. I copied the same code in my build (for MSP430F5338), the control comes to task and it fails later as I mentioned in this chain.

    I'm seeing the same behavior and am investigating.

    Channabasappa Kolar said:
    4. I using MSP430F5529LP Ver#1.5.

    That's a new board. I know we validated our examples on rev 1.4 so I need to check on what the difference is between the two.

    Channabasappa Kolar said:

    5. For me, always it recognizes as SDSC, always CCS bit in OCR is set to 0 (as response to CMD58). I single stepped good amount of code and but the CCS bit never get set.

    6. Unfortunately, we do not have 4GB and getting it also difficult as people are moving to 16/32 GB storage. I will try, but not sure.

    I just got a 8GB card to test this...when I get past #3.

    Channabasappa Kolar said:
    7. I saw few bugs in the code. I am fixing on the way. Once every thing works, I will send you the source code, you can review and update the base line code.

    Great! I am looking forward seeing these changes.

  • Hi Tom,

    Thanks a lot for your help.

    1. The build works great after I set the path you suggested.

    2. I am testing rest of it and I will let you know the further progress on SD and FS interface.

    3. Please update me on MSP430F5529LP ver#1.5 with TI examples and 8GB SDHC card recognition.

    Thank you.

  • Hi Channabasappa,

    I was only able to run the MSP430F5529 example for the launchpad and it shows that it correctly reads the 8GB SDHC. I've attached a modified fatsd_raw example that prints out the total drive size and free disk space of the SDCard. If you start with an empty SD card, you should see the disk usage printed before and after the files are created. The amount that it differs depends on how be the cluster size is. For example, this card was formatted with 4096 bytes, so 2 files would amount up to 8kB.

    Starting the FatSD Raw example
    System provider is set to SysMin. Halt the target to view any SysMin contents in ROV.
    Drive 0 is mounted
    Total Disk size: 7741440 KiB
    Free Disk space: 7741436 KiB
    Creating a new file "0:input.txt"...done
    Starting file copy
    File "0:input.txt" (576 B) copied to "0:output.txt" (Wrote 576 B)
    ***********************************************************************
    0 1 2 3 4 5 6 7
    01234567890123456789012345678901234567890123456789012345678901234567890
    This is some text to be inserted into the inputfile if there isn't
    already an existing file located on the SDCard.
    If an inputfile already exists, or if the file was already once
    generated, then the inputfile will NOT be modified.
    ***********************************************************************
    Total Disk size: 7741440 KiB
    Free Disk space: 7741428 KiB
    Drive 0 unmounted

    Can you try the attached CCS project on your MSP430F5529 launchpad with the SDCard boosterpack?

    3010.diskSize.zip

  • Hi Tom,

    Thanks a lot. SDFS is working on my target board based on MSP430F5338 with 8GB SDHC card. I still needs to test thoroughly. I will let you know soon. I appreciate your help while fixing this problem.

    Thanks.