cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f767zi nucleo - LwIP udp seems not be working

TStra.11
Associate

I am trying to send a simple udp Packet with the stm32f767zi nucleo sincle 3 days. At first I tried to use the drivers and project generated by cubemx. Sending the packets was done with this:

void lwip_udp_send(void) {
	struct udp_pcb *UdpPcb;
	ip_addr_t ipaddr;
	struct pbuf *p;
	err_t err = ERR_Mine;
	p = pbuf_alloc(PBUF_RAW, sizeof(UDPData), PBUF_RAM);
	p->payload = (void *) UDPData;
	UdpPcb = udp_new();
	udp_bind(UdpPcb, IP_ADDR_ANY, 6000);
	IP4_ADDR(&ipaddr, 192, 168, 0, 2);
	err = udp_connect(UdpPcb, &ipaddr, 6001);
	if (err == ERR_OK) {
		err = ERR_Mine;
		err = udp_send(UdpPcb, p);
	}
	udp_disconnect(UdpPcb);
	pbuf_free(p);
	udp_remove(UdpPcb);
}

Wireshark did not received any udp packet from the stm32s ip.

I tried to use the by st supplied example for a http webserver using rtos, this obviously worked and tried to remove the rtos bit but was not able to send udp packets.

Is there any example code for sending simple udp packets the stm32f767zi nucleo without any "knickknacks"?

Since this is my first time using lwip, I am not really aware where to start.

I wanted to use the udp echo client example supplied for the STM32756G_EVAL. Which part of the project do I have to customize to get it to work on the stm32f767. In my eyes, I do not have to touch the LwIP part of the project and only fit the drivers to work with the device.

Every help is very valued of mine!

Best whishes

Tristan

0 REPLIES 0