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.

the conflict between NDK scheduling and the receiving data of the uart`s hwi

Other Parts Discussed in Thread: SYSBIOS

I find my receive data ( from the uart`s hwi  ) is not complete. If I close NDK , my receive data ( from the uart`s hwi  ) is complete.

if I change ndkTickPeriod to 500, my receive data is complete more times than when ndkTickPeriod is 100.

Baud_rate of Uart is 921600. 

Thanks, everyone.

  • llTimerTick() in the NDK every 100 ms. llTimerTick()  is called for INT4 of hwi? 

  • Hi,

    Thanks for your post.

    Usually, the llTimerTick() function is supposed to run every 100 milliseconds and in general, if the network scheduler is in interrupt mode, the PRD function llTimerTick() would be executed, yes since the PRD is driving the stack like polling the driver to see if it has any actions to perform.  It also drives timeouts in the protocols (e.g. TCP).

    Please ensure the PRD object llTimerTick() is defined in the project target configuration file (*.tcf) and kindly check the project configuration settings.

    Thanks & regards,

    Sivaraj K

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

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

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

  • Hi Sivaraj Kuppuraj,

         We are running SYS/BIOS with NDK on our production board. Our current software versions:

    Processor TMS320C6748
    Code Composer Version: 6.0.1.00040
    Compiler TI v5.1.6
    SYS/BIOS 6.40.2.27
    XDCTools 3.30.3.47_core
    NDK 2.24.0.11

    I add llTimerTick() in my main NDK thread. But the conflict still happened.This code like this:

    int NetworkMain()
    {
        HANDLE   hCfg;
        int      rc;
        uint     tmp;

        CI_IPNET NA;
        CI_ROUTE RT;
        ti_sysbios_knl_Clock_Params clockParams;

          /* Create the NDK heart beat */

          ti_sysbios_knl_Clock_Params_init(&clockParams);

          clockParams.startFlag = TRUE;

          clockParams.period = 100;

          ti_sysbios_knl_Clock_create(&llTimerTick, clockParams.period, &clockParams, NULL);

        Semaphore_pend(semI2ENT,BIOS_WAIT_FOREVER);//+++
        memcpy(bMacAddr,Macbuf,6);   // MAC //+++

        rc = NC_SystemOpen( NC_PRIORITY_LOW, NC_OPMODE_INTERRUPT );
        //rc = NC_SystemOpen( NC_PRIORITY_HIGH, NC_OPMODE_INTERRUPT );
    //    rc = NC_SystemOpen( NC_PRIORITY_LOW, NC_OPMODE_POLLING );

        if( rc )
        {
            printf("NC_SystemOpen Failed (%d)\n",rc);
            for(;;);
        }

        // Create a new configuration
        hCfg = CfgNew();
        if( !hCfg )
        {
            printf("Unable to open configuration\n");
            goto main_exit;
        }

        // Manually configure our local IP address
        bzero( &NA, sizeof(NA) );
        NA.IPAddr = L_ipAddr;//+++
        NA.IPMask = L_netMask;//+++
        strcpy( NA.Domain, DomainName );
        NA.NetType = 0;
        // Add the address to interface 1
        CfgAddEntry( hCfg, CFGTAG_IPNET, 1, 0, sizeof(CI_IPNET), (UINT8 *)&NA, 0 );

        // Add our hostname
        CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_HOSTNAME, 0, strlen(HostName), (UINT8 *)HostName, 0 );
        // Add the default gateway. Since it is the default, the
        // destination address and mask are both zero (we go ahead
        // and show the assignment for clarity).
        bzero( &RT, sizeof(RT) );
        RT.IPDestAddr = 0;
        RT.IPDestMask = 0;
        RT.IPGateAddr = L_gwAddr;//+++
        // Add the route
        CfgAddEntry( hCfg, CFGTAG_ROUTE, 0, 0, sizeof(CI_ROUTE), (UINT8 *)&RT, 0 );

        // We don't want to see debug messages less than WARNINGS
        tmp = DBG_WARN;
        CfgAddEntry( hCfg, CFGTAG_OS, CFGITEM_OS_DBGPRINTLEVEL,
                     CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&tmp, 0 );

        // Save the configuration to a linear buffer
        MainConfigSize = 0;
        CfgSave( hCfg, &MainConfigSize, 0 );
        printf("%d bytes required for save\n",MainConfigSize);
        if( MainConfigSize > sizeof( MainConfig ) )
            printf("FATAL: Config buffer too small\n");
        else
        {
            CfgSave( hCfg, &MainConfigSize, MainConfig );
            CfgFree( hCfg );

            //Semaphore_pend(semI2ENT,BIOS_WAIT_FOREVER);
            // Now call what would really be the "boot" function
            NetBoot();
        }

        // Close the OS
    main_exit:
        NC_SystemClose();
        return(0);
    }