S32K344 lwip tcp/ip udp send issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K344 lwip tcp/ip udp send issue

Jump to solution
5,706 Views
malove
Contributor IV

Hello,

I am implementing logic to send messages using the lwIP TCP/IP stack, and I have encountered an issue.

Here is my current situation:

  1. The S32K344 MCU is connected to a PC via UDP.
  2. The MCU sends data to the PC.
  3. During data transmission, a memory-related issue occurs (mem_free: illegal memory: non-linked: double free).
    • The issue sometimes happens in TxNotification.
    • Alternatively, it occurs in the send_udp_data function that I implemented.

The attached test.c source file is based on the S32K344 TCP/IP 1.0.3 sample code, with the addition of the send_udp_data function.

Could you please review my UDP transmission code and let me know if I have implemented anything incorrectly?

 

 

Tags (3)
0 Kudos
Reply
1 Solution
5,631 Views
PavelL
NXP Employee
NXP Employee

Hello @malove ,

Based on warnings, udp_sendto (and udp_receive_callback) requires type ip_addr. I use TCPIP_STACK for S32K3XX version 1.0.4 .

Best regards,

Pavel

View solution in original post

0 Kudos
Reply
4 Replies
5,644 Views
malove
Contributor IV

Thank you always @PavelL 

I compared the codes and it seems like all ip4_addr have been changed to ip_addr.

Can I ask why?

 

0 Kudos
Reply
5,632 Views
PavelL
NXP Employee
NXP Employee

Hello @malove ,

Based on warnings, udp_sendto (and udp_receive_callback) requires type ip_addr. I use TCPIP_STACK for S32K3XX version 1.0.4 .

Best regards,

Pavel

0 Kudos
Reply
5,621 Views
malove
Contributor IV

Thank you! 

0 Kudos
Reply
5,669 Views
PavelL
NXP Employee
NXP Employee

Hello @malove ,

I fixed warnings in your code. The code works without any issue on my S32K344EVB-T172. Wireshark sees the UDP messages. The code is attached - please check it out.

Best regards,

Pavel

0 Kudos
Reply