Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE
Hi,
Can anyone show the steps to config static IP instead of Dynamic IP in tcpEcho example?
Thank you.
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.
Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE
Hi,
Can anyone show the steps to config static IP instead of Dynamic IP in tcpEcho example?
Thank you.
Hi,
You can update the initIP() function of ndk_tirtos.c file in the project to following, to change the DHCP client to auto IP. It essentially add CFGTAG_IPNET configuration.
/* Add our global hostname to hCfg (to be claimed in all connected domains) */
CfgAddEntry(hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_HOSTNAME, 0,
strlen(hostName),
(unsigned char *)hostName, 0);
/* Configure IP address manually on interface 1 */
CI_IPNET NA;
CI_ROUTE RT;
/* Setup manual IP address */
bzero(&NA, sizeof(NA));
NA.IPAddr = inet_addr("192.168.0.4");
NA.IPMask = inet_addr("255.255.255.0");
strcpy(NA.Domain, "yash.com");
NA.NetType = 0;
CfgAddEntry(hCfg, CFGTAG_IPNET, 1, 0,
sizeof(CI_IPNET), (unsigned char *)&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("192.168.99.1");
CfgAddEntry(hCfg, CFGTAG_ROUTE, 0, 0,
sizeof(CI_ROUTE), (unsigned char *)&RT, 0);
You can refer to documents referred in this e2e for further help.
Regards,
Yashwant
thank you for the reply. I did those changes already. But I got these errors
Building file: "../ndk_tirtos.c" Invoking: ARM Compiler "C:/ti/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me --include_path="C:/ti/ns_2_60_01_06/source/ti/net/bsd" --include_path="C:/ti/nsp_1_10_03_15/packages/ti/ndk" --include_path="C:/ti/bios_6_76_01_12/packages/ti/posix/ccs" --include_path="C:/ti/ns_2_60_01_06/source" --include_path="C:/ti/ndk_f2838x_3_61_01_01/source" --include_path="C:/Users/Sahan Sanjaya/workspace_v10/tcpEchoF2838X" --include_path="C:/ti/ti-cgt-arm_18.12.2.LTS/include" --define=ccs -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --ual --preproc_with_compile --preproc_dependency="ndk_tirtos.d_raw" --cmd_file="configPkg/compiler.opt" "../ndk_tirtos.c" "../ndk_tirtos.c", line 257: warning #225-D: function "bzero" declared implicitly "../ndk_tirtos.c", line 213: warning #179-D: function "serviceReport" was declared but never referenced Finished building: "../ndk_tirtos.c" Building target: "tcpEchoF2838X.out" Invoking: ARM Linker "C:/ti/ti-cgt-arm_18.12.2.LTS/bin/armcl" -mv7M3 --code_state=16 --float_support=none -me --define=ccs -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi --ual -z -m"tcpEchoF2838X.map" --heap_size=0 --stack_size=256 -i"C:/ti/ns_2_60_01_06/source/ti/net/lib/ccs/m4" -i"C:/ti/ndk_f2838x_3_61_01_01/source/ti/ndk/drivers/f2838x/lib" -i"C:/ti/ndk_f2838x_3_61_01_01/source/ti/ndk/slnetif/lib" -i"C:/ti/ndk_f2838x_3_61_01_01/source" -i"/driverlib/f2838x/driverlib_cm/ccs/Release" -i"C:/ti/ti-cgt-arm_18.12.2.LTS/lib" -i"C:/ti/ti-cgt-arm_18.12.2.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="tcpEchoF2838X_linkInfo.xml" --rom_model -o "tcpEchoF2838X.out" "./main_tirtos.obj" "./ndk_tirtos.obj" "./tcpecho.obj" "./tcpechohooks.obj" "../TMS320F2838X.cmd" -l"configPkg/linker.cmd" -lslnetsock_release.a -ldriverlib_cm.lib -l"ti/ndk/slnetif/lib/slnetifndk.aem4" -l"ti/ndk/netctrl/lib/netctrl_min_ipv4.aem4" -l"ti/ndk/nettools/lib/nettool_ipv4.aem4" -l"ti/ndk/hal/ser_stub/lib/hal_ser_stub.aem4" -l"ti/ndk/hal/userled_stub/lib/hal_userled_stub.aem4" -l"ti/ndk/os/lib/os.aem4" -l"ti/ndk/stack/lib/stk.aem4" -lemac_f2838x.aem4 -lslnetifndk.aem4 -l"ti/ndk/hal/timer_bios/lib/hal_timer.aem4" -llibc.a <Linking> error #10008-D: cannot find file "driverlib_cm.lib" warning #10247-D: creating output section ".binit" without a SECTIONS specification undefined first referenced symbol in file --------- ---------------- SysCtl_enablePeripheral C:/ti/ndk_f2838x_3_61_01_01/source/ti/ndk/drivers/f2838x/lib/emac_f2838x.aem4<ethernet.oem4> SysCtl_resetPeripheral C:/ti/ndk_f2838x_3_61_01_01/source/ti/ndk/drivers/f2838x/lib/emac_f2838x.aem4<ethernet.oem4> error #10234-D: unresolved symbols remain error #10010: errors encountered during linking; "tcpEchoF2838X.out" not built
Make sure you have C2000WARE_INSTALL_DIR path variable defined in system variables.