This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

rl_net for UDP implementation on lpc4357, KEIL5

Dear Team,

I am implementing UDP protocol on HITEX dev board (lpc4357) using rl_net library with KEILv5.36 compiler 5. I have written the code as per the documentation found on LINK.

Test Setup: HITEX board is connected to windows 10 laptop using ethernet cable. Laptop is running Hercules utility to test UDP.

HITEx board IP: 192.168.0.100, port: 2000

laptop ip: 192.168.0.10             , port: 2005

Problem: 1. Ethernet jack LEDs (orange & green) are glowing on both sides, but i am not able to ping hitex board.

2. While debugging I get successful response for functions but data is not seen on hercules terminal.

3. I am using network debug facility in keil5 and receiving error as "ARP-ERR: Cache_find ETH0 Unresolved MAC".

Does the (3) is causing the problem.

I am attaching my UDP send task below for reference.

// Notify the user application about UDP socket events.
uint32_t udp_cb_func (int32_t socket, const NET_ADDR *addr, const uint8_t *buf, uint32_t len) 
	{ 
  // Data received
  if ((buf[0] == 0x01) && (len == 2)) {
    // Switch LEDs on and off
    //LED_out (buf[1]);
		//do something
  }
  return (0);
}
 
// Send UDP data to destination client.
void send_udp_data (uint8_t *str) 
{ 
  if (udp_sock >= 0 && !udp_open_status) {
    // IPv4 address: 192.168.0.10
    NET_ADDR addr = { NET_ADDR_IP4, 2005, 192, 168, 0, 10 };
    // IPv6 address: [fe80::1c30:6cff:fea2:455e]
    //  NET_ADDR addr = { NET_ADDR_IP6, 2000,
    //                    0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    //                    0x1c, 0x30, 0x6c, 0xff, 0xfe, 0xa2, 0x45, 0x5e };
    uint8_t *sendbuf;
 
    sendbuf = netUDP_GetBuffer (strlen((char *)str));
		if(sendbuf)
		{
			strcpy((char *)sendbuf, (char *)str);
			//sendbuf[0] = 0x01;
			//sendbuf[1] = 0xAA;
		}
		else
			u0TxString(getBufferErr);
 
    udp_send_status = netUDP_Send (udp_sock, &addr, sendbuf, strlen((char *)sendbuf));
  }
}

void udp_thread (void *argument) 
{
	//udp socket testing
  net_init_status = netInitialize();
	osDelay(6000);
	
	// Initialize UDP socket and open port 2000
  udp_sock = netUDP_GetSocket (udp_cb_func);
  if (udp_sock >= 0) {
    udp_open_status = netUDP_Open (udp_sock, 2000);
		u0TxString(ethConnectSuccess);
  }
	else
		u0TxString(getSocketErr);
	
	while(1)
	{
		send_udp_data((uint8_t *)ethConnectSuccess);
		osDelay(500);
	}
}

Hercules window: 

KEIL network debug window:

       

Please help me resolve the issue. Thanks in advance.

Parents
  • Since RL_TCPnet lib has been deprecated since many years, if possible, consider using the latest MDK Middleware.

    On the other hand, better focusing on the ping issue first. If you cannot ping your target device, other things like UDP connection won't work.

    You can just leave IP and ETH debug output active and turn of others, since you have already had "Trace: Data overflow".

Reply
  • Since RL_TCPnet lib has been deprecated since many years, if possible, consider using the latest MDK Middleware.

    On the other hand, better focusing on the ping issue first. If you cannot ping your target device, other things like UDP connection won't work.

    You can just leave IP and ETH debug output active and turn of others, since you have already had "Trace: Data overflow".

Children
  • Since RL_TCPnet lib has been deprecated since many years, if possible, consider using the latest MDK Middleware.

    Can you please suggest one interms of stability and good development community support? 

    You can just leave IP and ETH debug output active and turn of others, since you have already had "Trace: Data overflow".

    I tried this, still it is showing "Trace: Data Overflow".

    On the other hand, better focusing on the ping issue first. If you cannot ping your target device, other things like UDP connection won't work.

    I have one doubt in this as, to be able to ping my LPC4357 do I need to implement ICMP separately? If yes, can you please suggest some path to do that?