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.
Tool/software: TI-RTOS
Hi,
I'm trying to create an UDP client socket for port 2 in an existing project which is already running for raw socket. The project is using TIRTOS. I've included NDK in my project and enabled IP block in network layer. I've used "Ip.ifIdx = 2;" to configure it for port 2 in .cfg file. Below is my tool configuration.
xcdtool version : 3.25.5.94
IPC : 3.21.0.07
NDK : 2.24.3.35
SYS/Bios : 6.37.2.27
I've provided hook function for network open hook and that hook function is getting called. Inside the hook function I've created a task and from the task i'm trying to send some data. I'm not receiving the data in opposite side (opposite side PC is used to capture the data using wireshark). The code snippet is given below. Kindly point me what other things need to be consider.
SOCKET udpsockfd;
void nw_open_hook()
{
Task_Start(&oUDPTsk);
}
void nw_close_hook()
{
}
//UDP Client
void Ethernet_UDP_Task(void)
{
struct sockaddr_in servaddr;
char *hello = "Hello from client";
uart_write("UDP task created\n");
if ((udpsockfd = socket (AF_INET, SOCK_DGRAM, 0)) == 0){
uart_write("UDP socket failed\n");
return;
}
memset(&servaddr, 0, sizeof(servaddr));
// Filling server information
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(PORT);
servaddr.sin_addr.s_addr = INADDR_ANY;
while (1){
sendto(udpsockfd, (char *)hello, strlen(hello),
0/*MSG_CONFIRM*/, (struct sockaddr *) &servaddr,
sizeof(servaddr));
Task_sleep(1000);
}
}
Along with that how to read back the information about the IP and MAC address configured.
thanks
Thirumoorthy S
Hi,
I'm using customized board. I'm using sys/bios and for NIMU driver i'm using "pdk_C6678_1_1_2_6".
Thanks
Thirumoorthy S
Hi,
I'm using Customized board.lding said:If you used TI 6678 EVM or this testing or your customized board?
Using PDK "pdk_C6678_1_1_2_6" for NIMU.lding said:I didn't see you mentioned any Processor SDK RTOS and NIMU driver. What code you used to initialize the CPSW? Note the NDK must run on top of NIMU driver.
Referred client.c example project and initialized QMSS, CPPI and PASS. NIMU related calls are getting triggered from "nimu_eth.c -> NIMUDeviceTable". Rest of other things like nc_systemopen, cfgnew are all done in the auto generated file "xxxx_sysbios_p66.c" and it is also getting triggered. Finally the stack is up and network_open function is getting called. As mentioned in previous thread, once the network_open function gets triggered a new task is created. The new task will open the socket as SOCK_DGRAM, perform sendto operation.
Added Global, IP and ICMP in the NDK module. These are the setting in .cfg file
BIOS.clockEnabled = true;
Global.autoOpenCloseFD = true;
Global.networkOpenHook = "&nw_open_hook";
Global.networkCloseHook = "&nw_close_hook";
Ip.autoIp = false;
Ip.address = "192.168.1.2";
Ip.mask = "255.255.255.0";
Log I got it from the Customized board :
QMSS successfully initialized
CPPI successfully initialized
PA successfully initialized
PASS successfully initialized
Ethernet subsystem successfully initialized
Ethernet eventId : 48 and vectId (Interrupt) : 7
Verify_Init: Expected 0 entry count for Queue number = 901, found 7 entries
Registration of the EMAC Successful, waiting for link up ..
UDP task created
UDP send :-1
Source code snippet is listed in the above thread. Still i'm not getting UDP packet coming out from DSP (using Wireshark to capture the packet). Kindly suggest what am I missing.
To Perform ping, just enabling ICMP in the NDK module is enough or is there additional code I need to add?
Thanks
Thirumoorthy S
Hi,
Able to generate ARP packet from DSP to PC and PC is also responding, but not sure DSP is receiving it or not. ARP not resolved and error says "Host not found".
What would be problem in Receive side since ARP from DSP is happening and DSP is not accepting response from HOST PC.
Hi,
Good to know you have NIMU driver in the test application. The MCSDK 2.1.2.6 (pdk 1.1.2.6) for c6678 is obsolete. Please use the latest Processor SDK RTOS Rel 5.0 for C6678
Then look at user guide for NDK part: There are several basic NDK test examples, make sure they worked. Then change the network stack portion of the code to a client. The customer test code I mentioned attached.
Regards, Eric
Hi Eric,
I'm in progress of porting my project which was using sys/bios(MCSDK 2.1.2.6+PDK1.1.2.6) to SDK as suggested by you.
In between I'm trying with MCSDK 2.1.2.6 (pdk 1.1.2.6) for c6678 which is required for first release.
I'm trying to send UDP packet from DSP to PC. As a first thing is ARP resolution, DSP is send ARP request to PC and PC also responding back, but ARP is not getting resolved in DSP. I can see the STATA and STATB counters in the DSP is getting updated but ISR is not getting triggered. The event ID 48 and interrupt 7 is used as is in the NIMU driver.
I tried to change the interrupt to 10 and got stuck in the asm loop
ti_sysbios_family_c64p_Hwi_int10:
00817140: 003C54F6 STW.D2T2 B0,*B15--[2]
00817144: 0028A35A MVK.L2 10,B0
00817148: 003C22F6 STW.D2T2 B0,*+B15[1]
0081714c: 0038A02A MVK.S2 0x7140,B0
00817150: 000040EA MVKH.S2 0x810000,B0
00817154: 00000362 B.S2 B0
00817158: 003C52E6 LDW.D2T2 *++B15[2],B0
0081715c: 00006000 NOP 4
Any pointers will be helpful
Thanks
Thiru