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 nandSample does not work with NDK example client at C6747

Hello!

I use client.pjt (NDK example) as base of my programm.

I add info from nandSample.tcf to my DSPBIOS script.

When I add task from nandSample.pjt named "task" it stay idle at "clearPartition" function.

Network are working well.

When I remove "StackTest" NDK task function from DSPBIOS    all functions in "task"  are fully execute.

I need both NDK and RTFS in my project.

I use CCS3.3, bios_5_41_10_36, ndk_2_20_03_24, pspdrivers_01_30_01, edma3_lld_01_11_02_05

Please help me.

Best regards, Yuri.

bykov-yg@yandex.ru

  • Hi Yuri,

    Which version of RTFS are you using?

    Also, could you please zip up your entire built project and attach it to this thread?

    Lastly, which hardware platform are you using?

    Thanks,

    Steve

  • Hi Steve!

    I using rtfs_1_10_02_32.

    I develop my own platform with direct connection NAND flash to DSP at CE4.

    I modify "llc_nand.c " at  pspdrivers_01_30_01\packages\ti\pspiom\nand\src\  for my platform support and rebuild "nand.pjt" at pspdrivers_01_30_01\packages\ti\pspiom\nand\build\C6747\ccs3\ with release and debug settings.

    Also i modify  "fsadaptmem.h" at rtfs_1_10_02_32\packages\ti\rtfs\config\ (only string №103) and rebuild "rtfsConfig.pjt" at rtfs_1_10_02_32\packages\ti\rtfs\config\build\  with release and debug settings.

    I attach    "fsadaptmem.h",     "llc_nand.c " , "TMS6747_dsp_MY.gel" and "AISgen.ini"  .

    If I comment string 14  in "evmboard.tcf" (delete NDK settings in DSPBIOS) "task" in nandSample.c are fully execute, but I do not have network.

    And if I uncomment    string 14  in "evmboard.tcf" (initilize  NDK settings in DSPBIOS)  I have network, but   "task" in nandSample.c are pending (I do not have file system at my NAND Flash).

    Thanks, Yuri.

    0257.gel llc_nand AISgen fsadaptmem.zip4617.withFFT_Eth_2011_05_24_to_Support.zip

  • Yuri,

    This sounds like an issue we have seen before on C6747 involving the pinmux.  Basically, what happened was the NDK configures the pinmux for the EMAC, and the RTFS configures the same pinmux for accessing  media for the file system.  So what happens is that these both writing to the pinmux register and stepping on each other.

    Can you check the value of the pinmux register values for the following cases to see if this may be happening?

    A. the case in which NDK is running, but there is no file system

    B. the file system is running, but the NDK is not

    C. the program attempts to run both the NDK and the file system together (which is not working for you)

     

    Thanks,

    Steve

  • Hi Steve.

    For all cases PINMUX registers are identically.

    I init PINMUXes at gel file (if I work with jtag).

    And PINMUXes configured by bootloader if I work without JTAG (start program from Flash), PINMUX settings add to BIN file by AISGEN.

     

    Thanks,

    Yuri.

     

  • Hi!

    My problem not solved now.

    I repeat: for all cases  pinmux register values  are identically.

    I add screenshots whith  pinmux register values  for all cases.

    Please help me.

    Thanks,

    Yuri.

    6646.PINMUXes.rar

  • Additional information!

    If program attempts to run both the NDK and the file system together I see in DSPBIOS Kernel/Object viewer task0 (task from NandSample) are Blocked On

    SEM: Nand_Sync_Sema.

     Why it happened?

    Thanks,

    Yuri.

  • Hi Yuri,

    I am able to reproduce this problem locally.  I am working on debugging it and will reply to you with an update as soon as I have some more info.

    Thanks,

    Steve

  • Yuri,

    I've found the cause of the problem.  The EDMA (used by RTFS) and the EMAC driver (used by NDK) both are using HWI7.  this conflict is what is causing your program not to work.

    Individually, the NAND example or NDK example work fine, but when they are put together, the NDK  configures HWI7 for the EMAC transmit ISR, and this wipes out the EDMA setting of HWI7 to call ECM_dispatch().

    I was able to get around this problem by updating the EMAC driver to use a different interrupt.  I found that in my example, HWI 5 was free, so I changed the ethdriver.c file to use HWI 5 instead of HWI7 for its transmit function, and this gets rid of any overlap.  Here's a code snippet (from ndk_2_0_0\packages\ti\ndk\src\hal\evm6747\eth_c6747\ethdriver.c)

    #define RXINT   6
    #define TXINT   5

    static void Interrupt_init(void)
    {
        IntSetup    hwi_intSetup;
        Uint32      retVal;

        /* Setup the Rx Int using NDK's Interrupt Manager */
        hwi_intSetup.intVectId = RXINT;
        hwi_intSetup.sysEvtCount = 1;
        hwi_intSetup.sysEvtId[0] = 31;
        hwi_intSetup.pCallbackFxn = HwRxInt;
        hwi_intSetup.pCallbackArg = 0;
        hwi_intSetup.bEnable = 1;

        retVal = Interrupt_add(&hwi_intSetup);
        if(retVal != 0)
            printf("Error setting up Rx Interrupts \n");

        /* Setup the Tx Int using NDK's Interrupt Manager */
        hwi_intSetup.intVectId = TXINT;  // <-- this was previously 7, which was a conflict
        hwi_intSetup.sysEvtCount = 1;
        hwi_intSetup.sysEvtId[0] = 32;
        hwi_intSetup.pCallbackFxn = HwTxInt;
        hwi_intSetup.pCallbackArg = 0;
        hwi_intSetup.bEnable = 1;

        retVal = Interrupt_add(&hwi_intSetup);
        if(retVal != 0)
            printf("Error setting up Tx Interrupts \n");

    }

    One other change you'll need to make is for the calls to disable/enable interrupts in the ethdriver.c file.  These macros won't be valid with the above change:

    #define     Disable_DSP_Interrupts()    IER &= ~0xC0
    #define     Enable_DSP_Interrupts()     IER |= 0xC0

    In order for this to work, I changed the above macros to be:

    #define disableInterrupts() _disable_interrupts()
    #define restoreInterrupts(key) _restore_interrupts(key)

    and all references to Disable_DSP_Interrupts to be disableInterrupts() and so on.

    I think you should try updating ethdriver.c with these changes and then adding it into your project file.  i think this is going to allow your program to work.  Please also make sure that HWI5 is free in your system, if not you will need to find another free HWI to replace HWI7.

    Steve

     

  • Hi Steve!

    I added this file and modify it

    And I modify  two strings:

     #define Disable_DSP_Interrupts() IER &= ~( (1<<RXINT) | (1<<TXINT) ) 
    #define Enable_DSP_Interrupts() IER |= ( (1<<RXINT) | (1<<TXINT) )

    (I do not add

    #define disableInterrupts() _disable_interrupts()
    #define restoreInterrupts(key) _restore_interrupts(key)
    )

    My programme are working with this chenges.

    NDK and RTFS both are execute now.

    Thank you very much for your help.

    Best regards, Yuri.

     

  • Great news! you're welcome.

    Steve