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.

Direct file access to USB memory stick from C6748 LCDK

Hi there,

I am using C6748 LCDK and CCS v6.01. I want the DSP to read/write files directly from/to a USB memory stick plugged to one of the USB ports on the LCDK. Could you provide or point me to a simple example code? 

Many thanks,

Bill

  • Try C6748_StarterWare_1_20_04_01. Within StarterWare, project is here
    build\c674x\cgt_ccs\c6748\lcdkC6748\usb_host_msc
    top level source is here:
    examples\lcdkC6748\usb_host_msc
    driver is here:
    usblib\host
    and binaries are here:
    binary\c674x\cgt_ccs\c6748\lcdkC6748\usb_host_msc
    All StarterWare examples use the USB0 OTG controller. No examples for the USB1 OHCI controller. For that you'll have to port it from some other platform. It's been asked on this forum a few times. Nobody yet has posted a port of OHCI code to the C6748. If anybody has succeeded, they kept it to themselves.
  • Hi Norman,

    Many thanks for your reply. I tried the example code today. The code compiles and can be run on the LCDK, but the USB drive cannot be mounted. I connected the USB disk through a USB cable via the USB OTG connector on the LCDK. I am not sure what's the problem. By the way, I am using C6748_StarterWare_1_20_03_03 shipped with the LCDK, but I am using CCS v6.01 insteaf CCS v5.5. Any suggestions?

    To be more specific, everything else (e.g., the UART communication with the PC) of the example code works well. But when I send command "ls" from the PC terminal, it says "Command returned error code FR_NOT_READY " 

    Best Regards,

    Bill 

  • I don't have my LCDK board in front of me. From what I tell from the schematic, you need to connect to the mini-B or (micro-B?) labeled J2. I assume you are using a male B to female A cable. The cable might ground the ID signal for you to change the board into host mode. If it doesn't, you'll need to short jumper JP1 which will ground USB0_ID.
  • Hi Bill,

    Bill says said:
    I am using C6748 LCDK and CCS v6.01. I want the DSP to read/write files directly from/to a USB memory stick plugged to one of the USB ports on the LCDK. Could you provide or point me to a simple example code?

    1. If you want the C6748 LCDK board to act as a USB host, you have to connect a jumper at J2.

    2. Using CCS, please import the example, USB_host_msc which is part of C6748 Starterware package. ( path : C:\ti\C6748_StarterWare_1_20_04_01\build\c674x\cgt_ccs\c6748\lcdkC6748\usb_host_msc

    3. Refer the screenshot below to know the comands available in that example. Using "cat" command, you can read a file and display it on the debug window.

    4. There are no commands available for transferring files to and from the pen drive into the DSP. You can view the files, list the files and display the files.

    5. please note that the "ls"command works fine in the screenshot below.

    Please revert if have any questions in running the USB host Msc example.

    Regards,

    Shankari

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

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

  • Hi Shankari,
    Many thanks for your reply. It works now.
    Best regards,
    Bill
  • Hi Norman,
    Thanks so much for your reply. It really helps. It works now.
    Best Regards,
    Bill
  • Hi Shankari,

    The C6748_StarterWare came with my LCDK is an older version 1_20_03_03. Could you advise where to download the latest version?

    Thanks very much,

    Bill

  • Hi Bill,
    That version (1_20_04_01) is the latest one and no further release yet.

    http://processors.wiki.ti.com/index.php/StarterWare

  • Start here:
    www.ti.com/.../starterware-c6dsp
    The pages states current version is v01.20.04, 04 Jun 2011. Click on the red "Get Software" button.
    software-dl.ti.com/.../index_FDS.html
    Sometimes the first page is older and out of sync with the second page.
  • Hi Norman,

    Many thanks for your reply. I have found v01_20_04_01 now.

    Best regards,

    Bill 

  • One strange problem:
    I am using CCS v6.01. If I import the example project "usb_host_msc" from the StarterWare, accessing a USB stick via the USB OTG port works fine. However, if I create a new project and then copy everything required in the "usb_host_msc" project to this new project, the new project complies and links OK, but when I run the project, it does not work (the usb disk connection cannot be setup).
  • I hope its due to binary format ie COFF or ELF.
    Please try to use the same format of binary.
  • Hi Titusrathinaraj,
    I know ELF format has to be used otherwise it won't build. So I think I have used the correct format.
  • It might be the linker command file or the GEL file. StarterWare has default ones:
    build\c674x\cgt_ccs\c6748\lcdkC6748\usb_host_msc\usb_host_msc.cmd
    tools\gel\C6748_LCDK.gel
    I found with CCSv5 that when you create a project, CCS will automatically select GEL and CMD files within the CCS install directory. With CCSv5, I found the CCS files to be the same as the StarterWare versions.

    With CCSv5, I found that CCS would ignore the local GEL script file in favour of it's version. I remember changing the local GEL script and the CCSv5 GEL script would run. The local CMD file should automatically be picked up.

    Another possibility is that you picked up the wrong platform source files or forgot to define c6748, lcdkC6748 and DMA_MODE (see original .cproject file).
  • Hi Bill,

    Another way is to do a careful screen comparison of each settings in the CCS properties of both the projects and find the difference.

    It seems to be the CCS settings issue.

    Regards,

    Shankari

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

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

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

  • Hi Norman,

    Many thanks for your reply. Yes, I forgot to define lcdk6748 and DMA_MODE. It works now.

  • Hi Shankari,
    Yes, the problem was that I forgot to defined lcdk6748 and DMA_MODE symbols .
    Many thanks.