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.

rtfs file system on USB host and NAND flash

Hi, I am using my own board with C6747 processor and NAND flash chip and host USB connector.

Hi, I want to have RTFS file system on NAND flash and I want plug USB Flash Disk on USB connector and work with USB flash disk file system. The aim of my work copy files from NAND flash file system to USB flash disk file system. Is it possible?

 

The example RTFS on NAND flash work fine! The example USB host Mass Storage Class work fin too. Bat when I tried to combine both these example to the one project, than NAND file system hangs and do not work. It seem to me, that RTFS and block media driver is not to work with two different storage device (nand and usb-disk). Am i right? or maybe I do not understand something?

  • Hi Alexander Kurko,

    Which version of BIOS and RTFS are you using?

    You may be running into a conflict with the event combiner (ECM).  Both of these applications use the event combiner to handle peripheral interrupts.  Can you check the configuration file (*.tcf for BIOS 5.x, or *.cfg for BIOS 6.x) to see which events are being mapped to which hardware interrupts?

    Steve

  • Hi Steven! Thanks for your reply!

     I am using: BIOS 5.41.07.24; RTFS 1.10.02.32; PSP Drivers 1.30.1; CCS 4.2.1

    My event map for NAND RTFS Example:

    /* ECM configuration */

    bios.ECM.ENABLE = 1;
    bios.HWI.instance("HWI_INT7").interruptSelectNumber = 0;
    bios.HWI.instance("HWI_INT8").interruptSelectNumber = 1;
    bios.HWI.instance("HWI_INT9").interruptSelectNumber = 2;
    bios.HWI.instance("HWI_INT10").interruptSelectNumber = 3; 

    Event map for USB Host Example are same as for NAND RTFS example:

     /* ECM configuration */

    bios.ECM.ENABLE = 1;
    bios.HWI.instance("HWI_INT7").interruptSelectNumber = 0;
    bios.HWI.instance("HWI_INT8").interruptSelectNumber = 1;
    bios.HWI.instance("HWI_INT9").interruptSelectNumber = 2;
    bios.HWI.instance("HWI_INT10").interruptSelectNumber = 3;   

    In my combine project (in *.tcf file) I put the same string. 

    I do not understand how distribute event combiner correctly? How can I combine both these application? 

  • Alexander,

    I need to talk to one of my colleagues about this and will get back to you as soon as I have something for you.

    Steve

  • Ok, thanks! I shell by waiting! This question is very important for me!

  • Hi Alexander,

    Could you provide some more information on the problem you're seeing?

    Alexander Kurko said:

    Bat when I tried to combine both these example to the one project, than NAND file system hangs and do not work. It seem to me, that RTFS and block media driver is not to work with two different storage device (nand and usb-disk). Am i right? or maybe I do not understand something?

    Which USB example are you using?

    Where is the program hanging at in your combined example?

    Steve

  • Of course!

    I took the follow project  (RTFS NAND example):

    "rtfs_1_10_02_32\packages\ti\rtfs\examples\nand\bios5\evm6747"  

    as base for my combine project. But I am working with my own board, and I made a few changes into initialization of hardware. But changes is not critical.

    - Change PINMUX settings from GEL file

    - Comment platform hardware initialization from "pspiom\platforms\evm6747\"

    At this stage my RTFS NAND project work correctly.

    Further, I took the code from this project :

    "rtfs_1_10_02_32\packages\ti\rtfs\examples\usbhostmsc\bios5\evm6747"

    and added it  to my combine project. Added to the project linker properties needed librarys from RTFS folder. Added to the *.tcf file nedded "Jungo" task. Insert into the main function configureUSB() and enable internal clock to the USB PLL (AUXCLK).

    I change configuration into "fsadaptmem.h". Folowing changes:

    #define USB_CFG_DRIVEID_DEVICE_0                           1 /* B: */
    #define USB_CFG_NUM_PARTITIONS_DEVICE_0        1

    I also added a new task to the *.tcf file for operation this USB disk (as same as in USB host example).  (I named it "TaskUSB")

    I also suspend the NAND operation task (echoTask.priority = -1). (It name "echoTask")

    I test the project and at this stage all operation this USB disk are working correctly.

    Further, I suspend USB operation task (TaskUSB.priority = -1), and enable NAND operation task (echoTask.priority = 1).

    I test the project and I see the following result:

    Configured NAND
    Block Driver Initialization Succeeded
    Get drive ID DONE. A:
    Clear partition DONE
    Formatting succeeded.
    NAND File Operations Starting
    Geometry: fmt_parms_valid = 0
    Mount starting: drive number 0
    Mount succeeded: drive number 0
    Volume blocks: total = 256768, free = 256768
    Set default drive
    Got current directory 

    I stop the debugger and I see, that project hangs at "VoiceRecorder.s62" file at this place:

    ;; HWI_Obj HWI_INT4 (function, monitor, addr, dataType, operation, client, iUseDispatcher, iArg, IntrMask, iCCBitMask, iLoadTrack)
    .global HWI_INT4
    .asg HWI_unused, _function
    .asg "Nothing", _monitor
    .asg 00H, _addr
    .asg "signed", _dataType
    .asg "STS_add(*addr)", _operation
    .asg "USER", _client
    .asg 00H, _iUseDispatcher
    .asg 00H, _iArg
    .asg 010H, _IntrMask
    .asg 01H, _iCCBitMask
    .asg 00H, _iLoadTrack
     =====>HWI_Obj 1, HWI_INT4, 4, _function, _monitor, _addr, _dataType, _operation, _client, _iUseDispatcher, _iArg, _IntrMask, _iCCBitMask, _iLoadTrack 

    Any time debugger hangs a little earlier or later. But the result is exactly the same.

    I attach a source code file:  3201.VoiceRecorder.rar

  • Alex,

    I noticed that you removed the call to configureNand() from your code (it is commented out).  I'm wondering why you did that?

    Alexander Kurko said:
    But I am working with my own board, and I made a few changes into initialization of hardware. But changes is not critical

    I see in your NAND code you have this:

    void task()
    {
        Int32       result;    
        char        driveId[3] = {'A', ':', 0};      

        ...

        /* Get drive letter associated with NAND */
        result = getdriveid(BFS_DEVICE_TYPE_NAND, 0 , 0, driveId);

    You shouldn't need to initialize the driveId array, as it will be overwritten by the getdriveid() call.

    Also, for the call to getdriveid() in the USB code:

            ret = getdriveid(BFS_DEVICE_TYPE_USB, 0 , 0, driveUSB);

    Can you try setting the unit_number arg to be 1? (bolded above, it's currently set to 0).

    Another question ... have you tried getting the USB and NAND to work together on the original 6747 hardware?

    Steve

  • Hi, Steven. Thanks for replay!

    1. I removed the call configureNand(), because  this call initializes PINMUX registers and I2C driver. I do not have I2C device on my board, and I initializes PINMUX registers, appropriate my hardware configuration into the *.gel file. Thats why I  removed this call.

    2.

    Steven Connell said:
    You shouldn't need to initialize the driveId array, as it will be overwritten by the getdriveid() call.

    Yes, of course. I know about that. driveId initializing  - this is my mistake. But I think, that it is not critical. I tried to test project without this initializing, but the result is the same.

    3. I tried to test my project with the setting unit_number  to be 1.  At this case I see the follow:

    All usb initializing work correctly (true message on the debug console). I plug into USB socket USB-disk and I see on the debug console the string "New disk attached as USB0 ". But getdriveid(BFS_DEVICE_TYPE_USB, 1 , 0, driveUSB) return -1, and further example finish.

    4. I do not know what mean " Original 6747 hardware". Is it EVM starter kit? If yes, than I do not have this kit. Now I am using board with C6747. Also, on this board are placed NAND flash chip K9F8G08U0M. It connect to the EMIFA port. Also, on this board are placed 8 MByte SDRAM. Also on this board are placed USB socket connected to USB1.

    Original example "Nand Blkmedia",  "RTFS NAND" and "RTFS USB host" (with few initializing changes) on my board work correctly.

  • I have one more observation!

    I take RTFS NAND example from RTFS folder. It works correctly!

    I just add to the linker properties six usbbios library:

    "ti.biosusb.host.port.a674"
    "ti.biosusb.host.mass.a674"
    "ti.biosusb.host.jos.a674"
    "ti.biosusb.host.core.a674"
    "ti.biosusb.host.portcom.a674"
    "ti.biosusb.host.hid.a674"

    Also, in program code, I add function call, that belongs above libraries. The main thing, that above library necessarily link to main program.

    I recompile my example, start it at the debuger, and it do not work. It hangs!

    Maybe I аm doing something wrong?

    May I using rtfs for nand-flash and usb-host simultaneously?

     

  • Hi Alexander,

    I have asked the driver team for some help to determine if this is a valid use case or not, and if so, what special requirements may be needed in order to get it working.  We will respond to you as soon as we have some more info for you. 

    Steve

  • Ok, thanks! I shell by waiting!

  • Hello Alexander & Steve,

    Apologies for a late response. I was on leave.

    From BIOSUSB side, we do not see any restriction/limitation for this the use case. But at the same time, i would like to mention that, we have never tested such a use case.

    Regards

    Prasad Joshi

  • Thanks for your replay. I understand you! 

    But at the same time, the problem was not solved.

    I have one stupid idea about this problem: My be when BIOSUSB driver and NAND driver meet into one project, than BIOSUSB consider that it must provide access to NAND storage from USB. I meen that USB port of my C6747 work in slave and wait to connect to the host USB on my computer. Same as example usbdevmsc (ti\biosusb\examples\usbdevmsc). Me be where is possibility avoid this mode of work.

    The aim of my work copy some file from the NAND flash to USB flash drive.

  • I so sorry! I solved this problem!

    This  problem is not related to the PSP NAND driver, and not related to host USB settings. 

    The fact that the settings of my SDRAM chip was wrong. I use 4 bank (64 MBits) Samsung chip, but in GEL file I have wrong setting for EMIFB_SDCFG | = ( 2 << 4 ). This means 1 bank mode. Thats why entire program working with failures.

    When I put to GEL file right setting then program working correctly and I got opportunity to copy file from NAND flash to USB flash disk