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.

problem wint Srio_start in SRIO_LoopbackDIOIsrexampleproject on C6657

Dear support,

I am trying to run SRIO_LoopbackDIOIsrexampleproject from pdk_C6657_1_1_2_6. I got it compiling and running.

However, the folowing problem occures:

Both cores always run intil the LLD function 'Srio_start '.

If all  the initialization of SRIO, QMSS.. is done on core 0 (CORE_SYS_INIT=0) and core 0 is the first one to execute 'Srio_start ': Core 0 returns from this function, Core 1 however doesn't (no error message it just does not return from the function.

If the initialization is still done at core 0 and core 1 is the first one to pass 'Srio_start ', both cores return from the function 'Srio_start '.

If I make CORE_SYS_INIT=1, it is the other way around.

Do you have any idea why it is neccesary the let the core that does not do the initialization has to be the first one to pass 'Srio_start '?

Thanks Ralph

  • Hello Ralph,

    Sorry for the late reply, some questions about your problems.

    What do you mean by both cores always run until the LLD function 'Srio_start'?

    Are you loading the .out file to both cores?

    This is a single core example and it is set up to run on core0 only, which I see in my board running as intended. There is a separate multicore example if you wish to look into a multicore application that will utilize both cores.

    Thank You,

    Rolando 

  • Hello Rolando,

    Inside the main routine of the example project there is the code:

        if (coreNum == CORE_SYS_INIT)
        {
            System_printf ("Debug(Core %d): System Initialization for CPPI & QMSS\n", coreNum);

            // System Initialization
            if (system_init() < 0)
            {
                    System_printf ("Error: System Initialization Failed\n");
                    return;
            }

            // Power on SRIO peripheral before using it.
            if (enable_srio () < 0)
            {
                System_printf ("Error: SRIO PSC Initialization Failed\n");
                return;
            }

            // Device Specific SRIO Initializations: This should always be called before initializing the SRIO Driver.
            if (SrioDevice_init() < 0)
            {
                return;
            }

            // Initialize the SRIO Driver.
            if (Srio_init () < 0)
            {
                System_printf ("Error: SRIO Driver Initialization Failed\n");
                return;
            }

            // SRIO Driver is operational at this time.
            System_printf ("Debug(Core %d): SRIO Driver has been initialized\n", coreNum);

            /* Write to the SHARED memory location at this point in time.
             *     The other cores cannot execute till the SRIO Driver is up and running. */
            isSRIOInitialized[0] = 1;

            /* The SRIO IP block has been initialized. We need to writeback the cache here because it will
             * ensure that the rest of the cores which are waiting for SRIO to be initialized would now be
             * woken up. */
            CACHE_wbL1d ((void *) &isSRIOInitialized[0], 128, CACHE_WAIT);
        }
        else
        {
            /* All other cores need to wait for the SRIO to be initialized before they proceed. */
            System_printf ("Debug(Core %d): Waiting for SRIO to be initialized.\n", coreNum);

            /* All other cores loop around forever till the SRIO is up and running.
             * We need to invalidate the cache so that we always read this from the memory. */
            while (isSRIOInitialized[0] == 0)
            {
                CACHE_invL1d ((void *) &isSRIOInitialized[0], 128, CACHE_WAIT);
            }
        }

    In my understanding, this is a code for a multicore application. (Same .out on both cores.)

    The task that runs on both cores after the main looks like this:

    static Void dioExampleTask(UArg arg0, UArg arg1)
    {
         UInt8               isAllocated;
         Srio_DrvConfig      drvCfg;
         int32_t             coreToQueueSelector[2];

         /* Initialize the SRIO Driver Configuration. */
         memset ((Void *)&drvCfg, 0, sizeof(Srio_DrvConfig));

         /* Initialize the OSAL */
         if (Osal_dataBufferInitMemory(SRIO_MAX_MTU) < 0)
         {
            System_printf ("Error: Unable to initialize the OSAL. \n");
            return;
         }

         /********************************************************************************
          * The SRIO Driver Instance is going to be created with the following properties:
          * - Driver Managed
          * - Interrupt Support (Pass the Rx Completion Queue as NULL)
          ********************************************************************************/

         /* Setup the SRIO Driver Managed Configuration. */
         drvCfg.bAppManagedConfig = FALSE;

         /* Driver Managed: Receive Configuration */
         drvCfg.u.drvManagedCfg.bIsRxCfgValid             = 1;
         drvCfg.u.drvManagedCfg.rxCfg.rxMemRegion         = Qmss_MemRegion_MEMORY_REGION0;
         drvCfg.u.drvManagedCfg.rxCfg.numRxBuffers        = 4;
         drvCfg.u.drvManagedCfg.rxCfg.rxMTU               = SRIO_MAX_MTU;

         /* Accumulator Configuration. */

         /* This is the table which maps the core to a specific receive queue. */
         coreToQueueSelector[0] = 704;
         coreToQueueSelector[1] = 705;

         /* Since we are programming the accumulator we want this queue to be a HIGH PRIORITY Queue */
         drvCfg.u.drvManagedCfg.rxCfg.rxCompletionQueue = Qmss_queueOpen (Qmss_QueueType_HIGH_PRIORITY_QUEUE,
                                                                         coreToQueueSelector[coreNum],
                                                                         &isAllocated);
        if (drvCfg.u.drvManagedCfg.rxCfg.rxCompletionQueue < 0)
        {
            System_printf ("Error: Unable to open the SRIO Receive Completion Queue\n");
            return;
        }

        /* Accumulator Configuration is VALID. */
        drvCfg.u.drvManagedCfg.rxCfg.bIsAccumlatorCfgValid = 1;

        /* Accumulator Configuration. */
        drvCfg.u.drvManagedCfg.rxCfg.accCfg.channel             = coreNum;
        drvCfg.u.drvManagedCfg.rxCfg.accCfg.command             = Qmss_AccCmd_ENABLE_CHANNEL;
        drvCfg.u.drvManagedCfg.rxCfg.accCfg.queueEnMask         = 0;
        drvCfg.u.drvManagedCfg.rxCfg.accCfg.queMgrIndex         = coreToQueueSelector[coreNum];
        drvCfg.u.drvManagedCfg.rxCfg.accCfg.maxPageEntries      = 2;
        drvCfg.u.drvManagedCfg.rxCfg.accCfg.timerLoadCount      = 0;
        drvCfg.u.drvManagedCfg.rxCfg.accCfg.interruptPacingMode = Qmss_AccPacingMode_LAST_INTERRUPT;
        drvCfg.u.drvManagedCfg.rxCfg.accCfg.listEntrySize       = Qmss_AccEntrySize_REG_D;
        drvCfg.u.drvManagedCfg.rxCfg.accCfg.listCountMode       = Qmss_AccCountMode_ENTRY_COUNT;
        drvCfg.u.drvManagedCfg.rxCfg.accCfg.multiQueueMode      = Qmss_AccQueueMode_SINGLE_QUEUE;

        /* Initialize the accumulator list memory */
        memset ((Void *)&gHiPriAccumList[0], 0, sizeof(gHiPriAccumList));
        drvCfg.u.drvManagedCfg.rxCfg.accCfg.listAddress = l2_global_address((UInt32)&gHiPriAccumList[0]);

         /* Driver Managed: Transmit Configuration */
        drvCfg.u.drvManagedCfg.bIsTxCfgValid             = 1;
        drvCfg.u.drvManagedCfg.txCfg.txMemRegion         = Qmss_MemRegion_MEMORY_REGION0;
        drvCfg.u.drvManagedCfg.txCfg.numTxBuffers        = 4;
        drvCfg.u.drvManagedCfg.txCfg.txMTU               = SRIO_MAX_MTU;

        if (coreNum == CORE_SYS_INIT)
        {
            while (Srio_start_on_other_core_then_core_sys_init[0] == 0)
            {
                CACHE_invL1d ((void *) &Srio_start_on_other_core_then_core_sys_init[0], 128, CACHE_WAIT);
            }
        }

        /* Start the Driver Managed SRIO Driver. */
        hDrvManagedSrioDrv = Srio_start(&drvCfg);            // Hier hangt core 1
        if (hDrvManagedSrioDrv == NULL)
        {
            System_printf ("Error(Core %d): SRIO Driver failed to start\n", coreNum);
            return;
        }

        if (coreNum != CORE_SYS_INIT)
        {
            Srio_start_on_other_core_then_core_sys_init[0] = 1;

            // We need to writeback the cache here.
            CACHE_wbL1d ((void *) &Srio_start_on_other_core_then_core_sys_init[0], 128, CACHE_WAIT);
        }.
    :
    :
    :
    As you can see 'Srio_start' is could inside this task. So both cores always run until this function.

    Thanks Ralph




  • Ralph,

    The coreNum variable is used to make sure you're loading unto core0 and nothing else, this is a single core example. You don't upload the.out files on both cores, just unto core0. As it says in the readme.txt file of the project:  

    "The example is a demonstration of the SRIO driver running the SRIO IP Block in loopback mode. The example showcases the use of SRIO DIO sockets using LSU interrupts to indicate the completion of packet transfer. It is shown how multiple sockets with different Source IDs can post transactions and process the pending interrupt raised by SRIO device." 

    I hope this helps clarify.

    Thank you,

    Rolando