lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Scan through the heap searching for a free block that i


From: Sergio R. Caprile
Subject: Re: [lwip-users] Scan through the heap searching for a free block that is big enough, beginning with the lowest free block.
Date: Mon, 25 Mar 2019 11:14:43 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Thunderbird/60.6.0

OK,
I know Modscan is a Modbus master tool, so I guess you are polling your
device, which happens to be a slave, a server, a TCP listener.
You are trying to implement ModbusTCP where the PC running Modscan (and
I guess Wireshark too) will connect (send SYN) to the lwIP device.

Second issue:
Those checksum errors you see on Wireshark are ON THE PC SIDE, you can
see those belong to the packets sent by .200 which I guess it is your PC
since it sends the SYN and the read coils query. That is usually due to
the checksum being handed over to the hardware, the network controller
does that and Wireshark can't see it. Anyway, we are debugging your
device, not your PC.

First issue:
Usually, memory problems are caused by people not respecting threading
rules or buggy (DMA) drivers.
https://www.nongnu.org/lwip/2_1_x/pitfalls.html

When you say "heap 4", I don't understand. Is it a FreeRTOS parameter or
some vendor setting or ? Where do you set that ? What is your lwIP
memory configuration ? (those MEM_ in an lwipopts.h file or in
src/include/lwip/opt.h)
I don't think you expect to run a TCP stack with 4 bytes, so clarifying
that comment would be a good idea so the memory experts can help you in
case there is a memory configuration issue.
Then...
What API are you using ?
You copied an echo server... which one ? The netconn one in contrib ?
the raw one in contrib ? A vendor provided one ? One you got from the
Internet ? Does it work ? Did you try it before modification ?
Then, when you <???> (please fill in the <???> with either "receive" or
"answer") a query, something happens and you find the lwIP thread is
looping where you describe.

if (<???> == "answer") then {
        well, what are you trying to send ? How many bytes ? Which function do
you call ?
} else if (<???> == "receive" then {
        does your app get an indication or this is a problem in the driver ?
} else {
        I guessed you wrong
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]