S32K344 lwip tcp/ip udp send issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K344 lwip tcp/ip udp send issue

ソリューションへジャンプ
5,820件の閲覧回数
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?

 

 

タグ(3)
0 件の賞賛
返信
1 解決策
5,745件の閲覧回数
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 件の賞賛
返信
4 返答(返信)
5,758件の閲覧回数
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 件の賞賛
返信
5,746件の閲覧回数
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 件の賞賛
返信
5,735件の閲覧回数
malove
Contributor IV

Thank you! 

0 件の賞賛
返信
5,783件の閲覧回数
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 件の賞賛
返信