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.

TMS320C6678: NDK crashing during Verify_init (during NC_NetStart) when integrating example in a system

Part Number: TMS320C6678

Hi,

I am using:

pdk v 2.0.8

Bios 6.52.00.12

ndk 2_26_00_08

sdk 4.02.00.09

I have a version of the nimu client example working standalone on a custom board mounting the c6678 chip.

I am trying to integrate the example in our system but the NC_NetStart call makes the core crash during the Verify_init.

The library is in release and i can't debug properly but it seems to crash during the queue check:

    for (i = 0; i < max_queue_number; i++ ) {
        if ( (i == gRxFreeQHnd) || (i == gTxFreeQHnd) || (i == gTxCmdFreeQHnd))
            continue;

        count = Qmss_getQueueEntryCount (i);
        if (count != 0) {
            NIMU_drv_log2 ("Verify_Init: Expected 0 entry count for Queue number = %d, found %d entries\n", i, count);
        }
    }

is there any reason why the core should crash during this even if it was working stand-alone?

Consider that core0 (which is running the code) receives continuous IPC_GR0 interrupts at the highest priority which are usually handled with no errors during the rest of the initialization parts.

Any help would be very appreciated.

Thank you in advance.

Best regards,

Fabrizio

  • Hi,

    The NDK team is notified. They will post their feedback directly here.

    Best Regards,
    Yordan
  • Hi,

    Sorry for the late response. For the memory placement, the critical ones are put into the fast memory in L2, you can find out this from .cfg file:
    Memory.defaultHeapInstance = Program.global.heap0;
    Program.sectMap["sharedL2"] = "DDR3";
    Program.sectMap["systemHeap"] = "DDR3";
    Program.sectMap[".sysmem"] = "DDR3";
    Program.sectMap[".args"] = "DDR3";
    Program.sectMap[".cio"] = "DDR3";
    Program.sectMap[".far"] = "DDR3";
    Program.sectMap[".rodata"] = "DDR3";
    Program.sectMap[".neardata"]= "DDR3";
    Program.sectMap[".cppi"] = "DDR3";
    Program.sectMap[".init_array"] = "DDR3";
    Program.sectMap[".qmss"] = "DDR3";
    Program.sectMap[".cinit"] = "DDR3";
    Program.sectMap[".bss"] = "DDR3";
    Program.sectMap[".const"] = "DDR3";
    Program.sectMap[".text"] = "DDR3";
    Program.sectMap[".code"] = "DDR3";
    Program.sectMap[".switch"] = "DDR3";
    Program.sectMap[".data"] = "DDR3";
    Program.sectMap[".fardata"] = "DDR3";
    Program.sectMap[".args"] = "DDR3";
    Program.sectMap[".cio"] = "DDR3";
    Program.sectMap[".vecs"] = "DDR3";
    Program.sectMap[".DbgSection"] = "DDR3";
    Program.sectMap[".far:taskStackSection"] = "L2SRAM";
    Program.sectMap[".stack"] = "L2SRAM";
    Program.sectMap[".nimu_eth_ll2"] = "L2SRAM";
    Program.sectMap[".resmgr_memregion"] = {loadSegment: "L2SRAM", loadAlign:128}; /* QMSS descriptors region */
    Program.sectMap[".resmgr_handles"] = {loadSegment: "L2SRAM", loadAlign:16}; /* CPPI/QMSS/PA Handles */
    Program.sectMap[".resmgr_pa"] = {loadSegment: "L2SRAM", loadAlign:8}; /* PA Memory */
    Program.sectMap[".far:IMAGEDATA"] = {loadSegment: "L2SRAM", loadAlign: 8};
    Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "L2SRAM", loadAlign: 8};
    Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "L2SRAM", loadAlign: 128};

    For the SWI, HWI and Semaphore usage, you can look at the RTOS view for the NDK NIMU example, it is under CCS ---->tools---->ROV classic, there are hwi/swi/semaphore.

    For the integration, it looks that you run NDK on other cores than core 0? Did it work on core 0 or not? There is a thread on how to run NDK NIMU example on other cores than 0 for MCSDK package: e2e.ti.com/.../858287

    Regards, Eric
  • Hi,

    Thank you for your reply.

    we managed to avoid core crash by commenting the for in the previous post:

    #if 0
        for (i = 0; i < max_queue_number; i++ ) {
            if ( (i == gRxFreeQHnd) || (i == gTxFreeQHnd) || (i == gTxCmdFreeQHnd))
                continue;
    
            count = Qmss_getQueueEntryCount (i);
            if (count != 0) {
                NIMU_drv_log2 ("Verify_Init: Expected 0 entry count for Queue number = %d, found %d entries\n", i, count);
            }
        }
    #endif

    At the moment we are facing a different issue:

    we moved the NDK stack task on core 7 (core 0 still do all the initializations in the GEL file).

    From the ROV it seems that the NDK is up but it is not possible to ping the device.

    Any suggestion about this?

    Thank you in advance.

    Best Regards,

    Fabrizio

  • Hi,

    Can you confirm after removing that code and use NDK on core 0 with your application, everything worked fine? If yes, when you move NDK to core 7, did you check the suggestion and the example we did on the link I providede2e.ti.com/.../858287 ?

    Regards, Eric
  • Hi,

    thank you for your reply.
    I confirm that NDK on core 0 works fine. When I move just the NDK task initialization to core 7 everything looks fine: NDK brings up fine but the board does not ping.
    I looked up the differences between the files in the solution you linked and the one I am using:

    the one in that solution refer to the old libraries (MCSDK) but it seems that the new libraries already have this fix.
    I am using:

    pdk v 2.0.8

    Bios 6.52.00.12

    ndk 2_26_00_08

    sdk 4.02.00.09

    any other help?

    Thank you

    Best Regards,
    Fabrizio
  • Hi,

    i tried to do the same thing we want to do on our custom board on the EVM: I connected on Core 0 to run the GEL file initializations, after that I connected on core 7 and uploaded a version a little modified of the client example. The same example works on Core 0. I found on another post that this should be working.

    to let the NDK work on core 7 i did these changes:

    • Change the qmss and cppi master core to core 7:
     if (CSL_chipReadDNUM() == 7)
        {
            qmss_cfg.master_core        = 1;
        }
    
    ...
    
        if (CSL_chipReadDNUM() == 7)
        {
            cppi_cfg.master_core        = 1;
        }
    • I added this line to my .cfg
    Global.multiCoreStackRunMode = Global.STACKRUN_FLG_CORE_7;

    Still the application brings up the NDK (I can see the IP assigned in the ROV view) but the board does not ping.

    Any update?

    Thank you in advance.

    Best Regards,

    Fabrizio

  • Hi,

    When testing on core 7, if you ping it, can you set breakpoints on EmacRxPktISR and EmacSend functions to see if this is Rx or Tx problem?

    Regards, Eric
  • Hi,

    Thank you for you reply.
    I've put the breakpoints where you asked and it seems that both rx and tx were successful (they both returned 0) of course the ping was not successful for timeout reasons.
    When I tried to ping again to have a second look the application didn't stop again at the breakpoint, which is strange to me. Still the ping is not successful

    Is there anything I can do?

    Thank you in advance.
    Best Regards,

    Fabrizio
  • Hi,

    I have compared the solution provided 02/12/2013 with the MCSDK 2.1.2.6 installation. The difference are:
    1) In the NIMU driver side:
    nimu_eth.c, PA_ACC_CHANNEL_NUM = coreNum; //so this changed to coreNum instead of core 0

    2) the test application: The core you run needs to be the master
    qmss_cfg.master_core = 1;
    cppi_cfg.master_core = 1;

    3) There is some discussion to add the Global.multiCoreStackRunMode = STACKRUN_FLG_CORE_7 in the .cfg

    The first change was already inside the NIMU driver of Processor SK RTOS: pdk_c667x_2_0_7\packages\ti\transport\ndk\nimu\src\v1
    accChannelNum = PA_ACC_CHANNEL_NUM + coreNum;

    You also added the 2nd and 3rd changes. All the changes are supposed to be here. I don't understand why the TX and RX breakpoints hit in the first time when you ping, then didn't the next time. I need look at this further.

    Regards, Eric
  • Hi,

    Thank you for your reply.

    It is strange for me too. Also if I don't use the breakpoints the ping is not successful anyway.

    Could you please get back to me ASAP? This task is very critical for us.

    Thank you very much.

    Best Regards,

    Fabrizio

  • Hi,

    Regarding the Global.multiCoreStackRunMode = STACKRUN_FLG_CORE_7 in the .cfg, I did a run keeping this in the file but uploading the NDK on core 0. In this case it pings too.
    Is it possible that in some point there is some code that gives full responsability to core 7 missing?

    Thank you in advance.
    Best Regards,

    Fabrizio
  • Hi Fabrizio,

    Try to update the PA_ACC_CHANNEL_NUM to (PA_ACC_CHANNEL_NUM + coreNum) in the following lines, and then either rebuilding NIMU or adding the nimu_eth.c to your project should resolve the NDK client issue running on core 7.

    C:\ti\pdk_c667x_2_0_8\packages\ti\transport\ndk\nimu\src\v1\nimu_eth.c:
    Line 817: Qmss_ackInterrupt(PA_ACC_CHANNEL_NUM + coreNum, 1);
    Line 818: Qmss_setEoiVector(Qmss_IntdInterruptType_HIGH, PA_ACC_CHANNEL_NUM + coreNum);
    Line 1017: Qmss_ackInterrupt(PA_ACC_CHANNEL_NUM + coreNum, 1);
    Line 1018: Qmss_setEoiVector(Qmss_IntdInterruptType_HIGH, PA_ACC_CHANNEL_NUM + coreNum);

    Regards,
    Garrett
  • Hi Garrett,

    Thank you for your support. This solved the issue!

    Thank you very much.

    Best Regards,
    Fabrizio