AnsweredAssumed Answered

BF518F and LwIP Issue

Question asked by jpb on Jan 6, 2011
Latest reply on Jan 7, 2011 by PrasanthR

Hello,

 

I've tested the example DSP-BF518F EZ-board\...\Lan\Multicast_Sender to send packet successfully.

So, i modified the example to receive packets using recvfrom() command, but it isn't working.

From a host PC, i send packets to the Blackfin at port 6666 but the VDK remains blocked in the funcion recvfrom().

The same code below i run in a Linux PC and works fine. I tryied to ping the blackfin but doesn't work too.

 

    struct sockaddr_in servaddr;
    struct sockaddr_in cliaddr;
    int fd, cnt;
    struct ip_mreq mreq;
    char message[30];//="Hello, World!";
    char buffer[30];
    int ret,i=0;

 

    /* create what looks like an ordinary UDP socket */
    if ((fd=socket(AF_INET,SOCK_DGRAM,0)) < 0) {
        perror("socket");
        exit(1);
    }

 

    /* set up destination address */
    memset(&servaddr,0,sizeof(servaddr));
    servaddr.sin_family = AF_INET;
    servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
    servaddr.sin_port = htons(6666);

 

    if(bind(fd,(struct sockaddr *)&servaddr,sizeof(servaddr)) == -1){
        perror("bind");
        exit(1);
    }

 

    /* now just sendto() our destination! */
    while (1) {


        int sizeAddr = sizeof(cliaddr);
        ret = recvfrom(fd,(void *) buffer, sizeof(buffer),0,(struct sockaddr *) &cliaddr, &sizeAddr);
        printf("ret: %d\n",ret);

 

    }

 

 

Any ideia?

 

Best regards,

João Paulo

Outcomes