Hi, I have a custom board of c6678 with two ethernet ports. in this post "e2e.ti.com/.../974898, it changes NIMU to to use the two ethnet interfaces of c6678 at the same time. I have changed the nimu and rebuild it. but I have no idea of how to change the code of example HelloWorld to assign two different IP to ethernet port 0 and port 1. (Since the above post was created about 3 years ago, I asked this question under that post, no one replied, I created this post). In helloWorld.c, it seems the following code is used to configure IP for one of the two ports.
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 );
I duplicated the above code with different IP variables, but I can only get one IP added(seems the callback function NetworkIPAddr() only execute once).
So here is my question:
1. How do I change the code of NDK init code in helloWorld.c in order to use the two ethernet ports at the same time with two different IPs?
2. CfgAddEntry( hCfg, CFGTAG_IPNET, 1, 0, sizeof(CI_IPNET), (UINT8 *)&NA, 0 );
it seems this function is not use to assign an IP to the physical ethernet port. because i tried to change the platform_init() to init different SGMII, not change helloWorld.c. the ethernet can work properly. My question here is: How could I know which physical ethernet port I am configuring with the IP address? I am very confused about this problem.
ps: my ccs version is:5.2.1.00018
ndk version: ndk_2_21_01_38
pkd version: pdk_C6678_1_1_1_4
bios version: bios_6_33_06_50
mcsdk version: mcsdk_2_01_01_04
thanks.