Hi,

I am testing listener modules using LM3S9B96, lwip1.3.2, safeRTOS,
StellarisWare 10636, ccs 5.4.x.

The listener task running in safeRTOS basically receives message from
server daemon in Unix using socket(UDP).

As the server daemon sends messages, the listener seems like not getting
anything from the server

Here is a capture of Wireshark:

<http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/471/1321.wireshark.JPG>

Also I directly attempts to access the listener using telnet command(telnet
192.2.0.208 5701), but the below error message comes out

"telnet : Unable to connect to remote host: Connection refused"

Here is my listener task codes:
?<http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/291329.aspx#>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    // Setup the local address.
    memset((char *) &sClient, 0, sizeof(sClient));
    sClient.sin_family = AF_INET;
    sClient.sin_len = sizeof(sClient);
//  sClient.sin_addr.s_addr = lwIPLocalIPAddrGet();
    sClient.sin_addr.s_addr = inet_addr("192.2.0.208");
    sClient.sin_port = htons(sPort);// int sPort = 5701

    //setup the destination address
    memset((char *) &sDestAddr, 0, sizeof(sDestAddr));
    sDestAddr.sin_family = AF_INET;
    sDestAddr.sin_len = sizeof(sDestAddr);
    sDestAddr.sin_addr.s_addr = inet_addr("192.2.0.3");// for test,
hard-corded
//  sDestAddr.sin_addr.s_addr = chgd_in_addr();
    sDestAddr.sin_port = htons(sPort);

    while((socket_fd = lwip_socket(AF_INET, SOCK_DGRAM, 0)) == 0)
    {
        //xTaskDelay(CHGD_OPEN_TIME);
        xTaskDelay(SECONDS(5));//arbitrary time for test
    }

    //bind socket to the local address and port
    if(lwip_bind(socket_fd, (struct sockaddr *) &sClient, sizeof(sClient))
== -1)
        lwip_close(socket_fd);

    while(1)
    {
        //receive from server
        length = lwip_recvfrom(socket_fd, (char *) msg_buf, sizeof(msg_buf),
                MSG_DONTWAIT, (struct sockaddr *)&sDestAddr, &size);

        if(length > 0)
        {
            sMsg = (NET_MSG *) (msg_buf);
            mon_cmd_do(socket_fd, &sDestAddr, sMsg, length);
        }
        lwip_close(socket_fd);
        xTaskDelay(1);// 1ms tick delay
    }

Whenever I set a breakpoint to see if the packets are received, but
safeRTOS doesn't let me debug. It directly brings about the fail of
scheduler. So, I don't know how I can debug other than WireShark.

I have not found out what is wrong with my modules.

Anyone can help me out?
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to