ERR_MEM while running

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

ERR_MEM while running

2,920 次查看
sivaji
Contributor I

hi every one,

      Presently I am working on LPC 4357 IC with LWIP_TCPECHO with Modbus integration with port 502. I am getting queries from Modbus PC Software and then my code will give a response to function code 3  with 98 registers data while running this I am getting an error code - ERR_MEM, IN echo.c file from an echo_send function while tcp_write, so anyone knows this error

标签 (1)
0 项奖励
回复
6 回复数

2,577 次查看
sivaji
Contributor I

when  I GET that error my TCP communication getting failed

0 项奖励
回复

2,577 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Shivaji yannaboina,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Actually, I'm still a bit confused about your issue, so I was wondering if you can answer the following queries.
1. What demo code you use, do it from LPCOpen library or you create by yourself?
2. Whether the LPC4347 work as Server or client.
3. Whether you can introduce the demo code and testing process in briefly.
I'm looking forward to your reply.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

2,577 次查看
sivaji
Contributor I

HI, jeremyzhou,

did you find any Solution for my problem

On Thu, Dec 13, 2018 at 10:43 AM sivaji yennaboina <sivaji@yagatek.com>

0 项奖励
回复

2,577 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Shivaji yannaboina,

Thanks for your reply.

The tcp_write() function will fail and return ERR_MEM if the length of the data exceeds the current send buffer size or if the length of the queue of the outgoing segment is larger than the upper limit defined in lwipopts.h. The number of bytes available in the output queue can be retrieved with the tcp_sndbuf() function.
The proper way to use this function is to call the function with at most tcp_sndbuf() bytes of data. If the function returns ERR_MEM, the application should wait until some of the currently enqueued data has been successfully received by the other host and try again.


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

2,577 次查看
sivaji
Contributor I

HI, jeremyzhou,

1. Actually, I took the code from lpcopen_3_02_keil_iar_hitex4350 and

in that I am working on lwip_examples.

2. LPC4357 works as a slave

3. In Echo.c file I am receiving a query from master i.e MODBUS

SIMULATOR (Mdbus) via RTU TCPand depending on the function code I am

responding for that. You can check it on attachment.

while running this process when I connected more than 2 masters I am

getting ERR_MEM while tcp_write in tcp_send function

0 项奖励
回复

2,577 次查看
sivaji
Contributor I

hi, check the debug.

   

tcp_slowtmr: polling application

tcp_output: nothing to send (00000000)

tcp_slowtmr: processing active pcb
tcp_slowtmr: polling application

tcp_output: nothing to send (00000000)

tcp_slowtmr: processing active pcb
tcp_slowtmr: polling application

tcp_output: nothing to send (00000000)

pbuf_alloc(length=1536)
ethernet_input: dest:00:60:37:12:34:03, src:44:1c:a8:1a:df:cf, type:800

pbuf_header: old 100026e0 new 100026ee (-14)

ip_input: iphdr->dest 0xc800a8c0 netif->ip_addr 0xc800a8c0 (0xa8c0, 0xa8c0, 0xc8000000)

ip_input: packet accepted on interface en

ip_input:

IP header:

+-------------------------------+

| 4 | 5 | 0x00 | 52 | (v, hl, tos, len)

+-------------------------------+

| 9489 |010| 0 | (id, flags, offset)

+-------------------------------+

| 128 | 6 | 0x538d | (ttl, proto, chksum)

+-------------------------------+

| 192 | 168 | 0 | 13 | (src)

+-------------------------------+

| 192 | 168 | 0 | 200 | (dest)

+-------------------------------+

ip_input: p->len 52 p->tot_len 52

pbuf_header: old 100026ee new 10002702 (-20)

pbuf_header: old 10002702 new 10002716 (-20)

tcp_write(pcb=10003198, data=10002716, len=205, apiflags=1)

pbuf_alloc(length=205)

tcp_write : could not allocate memory for pbuf copy size 205

0 项奖励
回复