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.

NDK Hello World DHCPC Mode On TMDXEVM6678LE

Hi 

I ran the NDK/Helloworld project on 6678 evaluation board in static IP mode.

Now i want to run this project in DHCPC mode so i turn on the second bit of SW9 and run the program but i face with the following error. What should i do for resolving this problem?

[C66xx_0] TCP/IP Stack 'Hello World!' Application
[C66xx_0]
[C66xx_0] QMSS successfully initialized
[C66xx_0] CPPI successfully initialized
[C66xx_0] PASS successfully initialized
[C66xx_0] Ethernet subsystem successfully initialized
[C66xx_0] eventId : 48 and vectId : 7
[C66xx_0] Registration of the EMAC Successful, waiting for link up ..
[C66xx_0] Service Status: DHCPC : Enabled : : 000
[C66xx_0] Service Status: DHCPC : Enabled : Running : 000
[C66xx_0] Service Status: DHCPC : Enabled : Fault : 002

  • Hi,
    How did you connect the C6678 EVM board ?
    Do you have DHCP server running on your LAN where you connected the board ?
    Please make sure that you have DHCP server running and getting IP address from there.
  • Hi Titusrathinaraj 

    I connect to core 0 of the board with XDS100V1 USB JTAG. After connecting, i load evmc6678.gel and selected global_default_setup for default initializing and then i load helloworld.out on core 0. after running i face with that error.

    How can i have DHCPC server running on my LAN?

  • Hi,
    Sorry for the delay in response.
    You can check with your IT (network) team about the DHCP setup.
    How did you connect the C6678EVM board ethernet cable ?
    Is that connected between PC to C6678EVM board ?
    Or Is connected to network ?

    In your LAN connection, DHCP server would run and you can get assigned IP address dynamically.
  • Hi,

    I'm trying to reproduce the problem.

    I've connected the ethernet cable between windows host PC to EVMC6678 board and got the same problem.

    So please make sure about your EMAC connection.

    The above mentioned setup is only for "static IP mode" configuration and not for DHCP.

    You have to connect the C6678 EVM board ethernet cable to the LAN where DHCP server runs and provide the IP.

    Static Mode - > You would set IP manually.

    DHCP Mode - > DHCP server provide the IP automatically.


    Working : Here, I would connect the C6678 ethernet cable to ethernet switch which is connected company LAN where I get IP from DHCP server.

     

    Not Working : Here, I would connect the C6678 ethernet cable to my windows host PC

    FYI: I'm running "client" NDK application.

  • Hi Titusrathinaraj

    Thanks for your hint. As you said i connected my LAN cable to windows host PC. Probably my problem is the same. 

    Actually i don't know how can i fix this problem. I have a custom board that i want to implement this project on it but i do not consider spartan for that so i don't have SW9 and i don't know how i can switch to static mode. For this reason i must set up DHCP mode for this project. Do you know how can i switch to static mode?

  • Hi,

    Sure, I will check.


    I ran the NDK/Helloworld project on 6678 evaluation board in static IP mode.

    Now i want to run this project in DHCPC mode so i turn on the second bit of SW9 and run the program but i face with the following error. What should i do for resolving this problem?


    BTW, you said that already you ran the example with static mode right ?
  • Thanks for your response
    Yes. i can run the example with static mode right on evaluation board. Now i want run this on a custom board but can not change the mode!
  • Hi,

    As per the C6678EVM schematics, that SW9 (user input) pin had been connected to FPGA IO port named as "User_define" so please check with your hw team for how that FPGA IO has been connected on your custom board.

  • Hi

    I checked the schematic and i know the pin tht goes to fpga(spartan3). I do not know that what work the fpga do for switching to static mode?
  • Actually that pin was just IO, in code they would read the status of that IO and decide upon what configuration we can do.

    We can also enable the "static IP" mode with sw change and no hw change.

    Modify like below, this code always runs on static IP mode configuration without considering hw change.

    Try this let me update.

        // If the IP address is specified, manually configure IP and Gateway
    #if defined(_SCBP6618X_) || defined(_EVMTCI6614_) || defined(DEVICE_K2H) || defined(DEVICE_K2K)
        /* SCBP6618x, EVMTCI6614, EVMK2H, EVMK2K always uses DHCP */
        if (0)
    #else
    //    if (!platform_get_switch_state(1))
        	if(1)	//Titus : Always runs "Static Ip mode"
    #endif
        {
        	printf("############ I'm manual from staic IP setup\n");
            CI_IPNET NA;
            CI_ROUTE RT;
            IPN      IPTmp;
    
            // 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
        {
        	printf("############ I'm from DHCPC IP setup\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 );
        }
    

  • Hi Titusrathinaraj

    Thanks for your help. it worked. Now i can use static IP mode without using SW9. Thanks for your response.
  • Hi Armin,
    Sounds good.
    Thanks for your update.