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.

SYSBIOS exit when Ethernet cable connecte to K2EVM board with PDK example delivered by TI

Other Parts Discussed in Thread: SYSBIOS

Hi

When i try to test PDK example delivered for K2E "NIMU_emacExample_EVMK2E_armBiosExampleProject" ,  The project results in SYSBIOS exit if Ethernet link is connected. Since this is a out of the box solution for along with PDK for K2E, i can't able to find solution for this issue after a long time trials. 

I was using K2EVM with 66AKe05 processor device for running the example code. Is it a n issue someone observed or any evm settings is required for running this project?

Kindly help me to resolve or make some comments on this issue as support is required to move forward.

  • We will check and get back to you as soon as possible. Please provide Processor SDK version information.

    Thank you.
  • Hi,

    Thanks for your response.

    pdk_k2e_4_0_2 is the package i have been using.

    The project is generated with help of ti wiki with steps to rebuild pdk for example projects. I was able to import & rebuild this project using CCS also

    Regards,
  • int StackTest()

    {

       int             rc;

       int        i;

       HANDLE          hCfg;

       NIMU_QMSS_CFG_T      qmss_cfg;

       NIMU_CPPI_CFG_T      cppi_cfg;

    #ifdef __ARM_ARCH_7A__

       /* Add MMU entries for MMR's required for PCIE example */

       Uint32 privid, index;

       CSL_MsmcRegs *msmc = (CSL_MsmcRegs *)CSL_MSMC_CFG_REGS;

       Mmu_DescriptorAttrs attrs;

       extern char ti_sysbios_family_arm_a15_Mmu_Module_State_0_secondLevelTableBuf_1__A;

       uint32_t addr = (uint32_t)&ti_sysbios_family_arm_a15_Mmu_Module_State_0_secondLevelTableBuf_1__A;

       Mmu_initDescAttrs(&attrs);

       attrs.type = Mmu_DescriptorType_TABLE;

       attrs.shareable = 0;            // non-shareable

       attrs.accPerm = 1;              // read/write at any privelege level

       attrs.attrIndx = 0;             // Use MAIR0 Register Byte 3 for

                                       // determining the memory attributes

                                       // for each MMU entry

       // Update the first level table's MMU entry for 0x80000000 with the

       // new attributes.

       Mmu_setFirstLevelDesc((Ptr)0x40000000, (UInt64)addr, &attrs);

       // Set up SES & SMS to make all masters coherent

       for (privid = 0; privid < 16; privid++)

       {

         for (index = 0; index < 8; index++)

         {

           uint32_t ses_mpaxh = msmc->SES_MPAX_PER_PRIVID[privid].SES[index].MPAXH;

           uint32_t sms_mpaxh = msmc->SMS_MPAX_PER_PRIVID[privid].SMS[index].MPAXH;

           if (CSL_FEXT (ses_mpaxh, MSMC_SES_MPAXH_0_SEGSZ) != 0)

           {

             // Clear the "US" bit to make coherent.  This is at 0x80.

             ses_mpaxh &= ~0x80;

             msmc->SES_MPAX_PER_PRIVID[privid].SES[index].MPAXH = ses_mpaxh;

           }

           if (CSL_FEXT (sms_mpaxh, MSMC_SMS_MPAXH_0_SEGSZ) != 0)

           {

             // Clear the "US" bit to make coherent.  This is at 0x80.

             sms_mpaxh &= ~0x80;

             msmc->SMS_MPAX_PER_PRIVID[privid].SMS[index].MPAXH = sms_mpaxh;

           }

         }

       }

    #endif

       if (setupRm ())

       {

         platform_write ("Function setupRm failed\n");

         System_flush();

         goto main_exit;

       }

       /* Initialize the components required to run this application:

        *  (1) QMSS

        *  (2) CPPI

        *  (3) Packet Accelerator

        */

    #ifdef _TMS320C6X

       if (CSL_chipReadDNUM() == 0)

       {

           qmss_cfg.master_core        = 1;

       }

    #else

      qmss_cfg.master_core =1;

    #endif

       qmss_cfg.max_num_desc       = MAX_NUM_DESC;

       qmss_cfg.desc_size          = MAX_DESC_SIZE;

       qmss_cfg.mem_region         = Qmss_MemRegion_MEMORY_REGION0;

       if (NIMU_initQmss (&qmss_cfg) != 0)

       {

           platform_write ("Failed to initialize the QMSS subsystem \n");

           goto main_exit;

       }

       else

       {

        platform_write ("QMSS successfully initialized \n");

       }

    #ifdef _TMS320C6X

       if (CSL_chipReadDNUM() == 0)

       {

           cppi_cfg.master_core        = 1;

       }

    #else

       cppi_cfg.master_core        = 1;

    #endif

       cppi_cfg.dma_num            = Cppi_CpDma_PASS_CPDMA;

       cppi_cfg.num_tx_queues      = NUM_PA_TX_QUEUES;

       cppi_cfg.num_rx_channels    = NUM_PA_RX_CHANNELS;

       if (NIMU_initCppi (&cppi_cfg) != 0)

       {

           platform_write ("Failed to initialize CPPI subsystem \n");

           goto main_exit;

       }

       else

       {

        platform_write ("CPPI successfully initialized \n");

       }

       if (NIMU_initPass()!= 0) {

           platform_write ("Failed to initialize the Packet Accelerator \n");

           goto main_exit;

       }

       else

       {

        platform_write ("PA successfully initialized \n");

       }

       //

       // THIS MUST BE THE ABSOLUTE FIRST THING DONE IN AN APPLICATION before

       //  using the stack!!

       //

       rc = NC_SystemOpen( NC_PRIORITY_LOW, NC_OPMODE_INTERRUPT );

       if( rc )

       {

           platform_write("NC_SystemOpen Failed (%d)\n",rc);

           for(;;);

       }

       //

       // Create and build the system configuration from scratch.

       //

       // Create a new configuration

       hCfg = CfgNew();

       if( !hCfg )

       {

           platform_write("Unable to create configuration\n");

           goto main_exit;

       }

       //

       // THIS MUST BE THE ABSOLUTE FIRST THING DONE IN AN APPLICATION!!

       //

       rc = NC_SystemOpen( NC_PRIORITY_LOW, NC_OPMODE_INTERRUPT );

       if( rc )

       {

           platform_write("NC_SystemOpen Failed (%d)\n",rc);

           for(;;);

       }

       // Print out our banner

       platform_write(VerStr);

       //

       // Create and build the system configuration from scratch.

       //

       // Create a new configuration

       hCfg = CfgNew();

       if( !hCfg )

       {

           platform_write("Unable to create configuration\n");

           goto main_exit;

       }

       // We better validate the length of the supplied names

       if( strlen( DomainName ) >= CFG_DOMAIN_MAX ||

           strlen( HostName ) >= CFG_HOSTNAME_MAX )

       {

           platform_write("Names too long\n");

           goto main_exit;

       }

       // Add our global hostname to hCfg (to be claimed in all connected domains)

       CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_HOSTNAME, 0,

                    strlen(HostName), (UINT8 *)HostName, 0 );

       // If the IP address is specified, manually configure IP and Gateway

    #if defined(_SCBP6618X_) || defined (DEVICE_C6678) || defined(_EVMTCI6614_) || defined(DEVICE_K2H) || defined(DEVICE_K2K) || defined(DEVICE_K2L) || defined(DEVICE_K2E)

       /* SCBP6618x, EVMTCI6614, EVMK2H, EVMK2K always uses DHCP */

       if (0)

    #else

       if (!platform_get_switch_state(1))

    #endif

       {

           CI_IPNET NA;

           CI_ROUTE RT;

           IPN      IPTmp;

           platform_write("StackTest: using localIp\n");

           // Setup manual IP address

           bzero( &NA, sizeof(NA) );

           NA.IPAddr  = inet_addr(LocalIPAddr);

           NA.IPMask  = inet_addr(LocalIPMask);

           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 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 = inet_addr(GatewayIP);

           // Add the route

           CfgAddEntry( hCfg, CFGTAG_ROUTE, 0, 0,

                              sizeof(CI_ROUTE), (UINT8 *)&RT, 0 );

           // Manually add the DNS server when specified

           IPTmp = inet_addr(DNSServer);

           if( IPTmp )

               CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_DOMAINNAMESERVER,

                            0, sizeof(IPTmp), (UINT8 *)&IPTmp, 0 );

       }

       // Else we specify DHCP

       else

       {

           platform_write("StackTest: using dhcp\n");

           CI_SERVICE_DHCPC dhcpc;

           // Specify DHCP Service on IF-1

           bzero( &dhcpc, sizeof(dhcpc) );

           dhcpc.cisargs.Mode   = CIS_FLG_IFIDXVALID;

           dhcpc.cisargs.IfIdx  = 1;

           dhcpc.cisargs.pCbSrv = &ServiceReport;

           CfgAddEntry( hCfg, CFGTAG_SERVICE, CFGITEM_SERVICE_DHCPCLIENT, 0,

                        sizeof(dhcpc), (UINT8 *)&dhcpc, 0 );

       }

       //

       // Configure IPStack/OS Options

       //

       // We don't want to see debug messages less than WARNINGS

       rc = DBG_WARN;

       CfgAddEntry( hCfg, CFGTAG_OS, CFGITEM_OS_DBGPRINTLEVEL,

                    CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );

       //

       // This code sets up the TCP and UDP buffer sizes

       // (Note 8192 is actually the default. This code is here to

       // illustrate how the buffer and limit sizes are configured.)

       //

       // UDP Receive limit

       rc = 8192;

       CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_SOCKUDPRXLIMIT,

                    CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );

       //

       // Boot the system using this configuration

       //

       // We keep booting until the function returns 0. This allows

       // us to have a "reboot" command.

       //

       do

       {

           rc = NC_NetStart( hCfg, NetworkOpen, NetworkClose, NetworkIPAddr );

       } while( rc > 0 );

       // Delete Configuration

       CfgFree( hCfg );

       // Close the OS

    main_exit:

       printf("StackTest: exiting\n");

       NC_SystemClose();

       return(0);

    }

     

    Is that master core need to be 1? 

    I was working on ARM core of 66AKE05 , and i think its a slave core. The exit is occurring at 

    rc = NC_NetStart( hCfg, NetworkOpen, NetworkClose, NetworkIPAddr );

    line. Its a dataabort exception too.

     


    Hope it helps.

     

  • Screenshot shows Project View, stack view @ error happened. It ends at function do_AngelSWI from kill function

    Regards

  • Yes, its known issue.
    We are working on this, I let you know once its fixed.
  • Hi Titus ,

    Thanks for the response. Hope for a solution soon.

    Regards,
  • Hi Titus,

    Will you say the time window needed for the correction on that project? I was just waiting for your input to start my design. I think if you can send patch it will be faster than a proper package release.

    Regards,

  • Dear Shino Samuel,
    I have got response from Dev team.

    For the exception errors that you are seeing are related to an insufficient NS_BootTask stack size. This change will need to be made in C:\ti\ndk_2_24_03_35\packages\ti\ndk\netctrl\netctrl.c around line 197. Change to:
    TaskCreate( NS_BootTask, "ConfigBoot", OS_TASKPRINORM, 4096,
    (UINT32)hCfg, 0, 0 );

    We have to rebuild the NDK package with this change.

    I am also trying to rebuild the NDK and update you.
  • Hi,

    I was able to rebuild the NDK with this change, and the issue i reported was resolved.

    Presently can you provide support on this project? Because i find issue in DHCP client service and it is not able to fetch IP. But for static IP it was able to attach the network set on the example.

    We are using K2EVM from TI and i was not able to find the code line in which MAC is configured.

    Regards,

    Shino

  • Hi Titus

    One more query. Will you say how to change MAC which is set in the same example?

    Regards,
  • Glad to hear that you are able to fix the problem.
    We filed an IR and this issue will be fixed in next release of NDK/PSDK.
    Let me check the for changing the MAC.

    BTW, which NDK version is you used ?
    Can you please update here on how you rebuild the NDK for K2H ?
    Something like "ti.targets.elf.C66 ?=" and XDC, SYSBIOS path.
    It would be useful to other community members as well.
    processors.wiki.ti.com/.../Rebuilding_The_NDK_Core_Using_Gmake
  • I think, the MAC address is taking from EFUSE, you can also put your MAC address.
    Here is the file you need to change.
    C:\ti\pdk_k2hk_4_0_2\packages\ti\transport\ndk\nimu\src\v0\nimu_eth.c
  • Hi Titus,

    NDK version used for rebuilt is ndk_2_24_03_35.

    1. Copied base version  ndk_2_24_03_35 to a new folder (all build and edit has done on that package).

    2. Edited ndk.mak file at root of the package.

    XDC_INSTALL_DIR ?= C:/ti/xdctools_3_32_00_06_core

    SYSBIOS_INSTALL_DIR ?= C:/ti/bios_6_46_00_23

    gnu.targets.arm.A15F ?= C:\ti\ccsv6\tools\compiler\gcc-arm-none-eabi-4_9-2015q3

    BUILDMINSTACK ?= 1

    Note: For older version of NDK's this procedure will not work

    All packages should be installed before the rebuild (XDC Tools/ SYSBIOS with correct path). Also add gmake to PATH variable by adding xdc path to environment variable of windows.

    3.     Execute command at copied ndk root directory

    gmake -f ndk.mak 

    It will take some time for the rebuilt


    I had requirement with A15 device, any one can add appropriately for their requirement. Also no need to perform clean command

    Regards,

  • Thanks for your steps.
    It would help other users.
  • Hi Titusrathinaraj Stalin,

    This was an old thread, but presently I would like to restart my work on this. I would like to use NDK with 66AKL06 A15 core for a base station  project.  

    The error reported with stack overflow was rectified by rebuilding the NDK, but, while running the project we were not able to get ping to the stack. However the project is running without any errors.

    This same application logic works perfectly for DSP core in static and DHCP client mode.

     

    Debug Output:

    [arm_A15_0] QMSS successfully initialized
    CPPI successfully initialized
    PA successfully initialized

    TCP/IP Stack 'Hello World!' Application

    StackTest: using dhcp
    Service Status: DHCPC : Enabled : : 000
    Service Status: DHCPC : Enabled : Running : 000

     

    Any clue on this?

    Regards,