[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] lwip + modbus TCP + UDP
From: |
goldsimon |
Subject: |
Re: [lwip-users] lwip + modbus TCP + UDP |
Date: |
Mon, 31 Dec 2018 15:58:38 +0100 |
User-agent: |
K-9 Mail for Android |
Pablo Ledergerber wrote:
>
>hello,
>
>I'm working on a project for a new sensor with ethernet connectivity,
>modbus TCP for data and a kind of discovery function with udp packets
>for identificationdata. During the sensor is working well, there are
>sometime packet retransmission and after a cupple of minutes or when I
>send new data over UDP to the sensor the software got stuck. This is
>the
>first time for me that I use the lwip stack in a project. I've tried to
>
>set the parameters into the lwipopts.h file without success.
>In this function get stuck:
>
>tcp_fasttmr(void)
>{
> struct tcp_pcb *pcb;
> ++tcp_timer_ctr;
>tcp_fasttmr_start:
> pcb = tcp_active_pcbs;
> while (pcb != NULL) {
> if (pcb->last_timer != tcp_timer_ctr) { <------ exactly here!
Looks like a threading issue to me.
>Enclosed you find a wireshark data file. My setup is the following:
>- xmc4400 from Infineon
>- KSZ8081 Phy from Microchip
>- RTOS: CMSIS
>- Freemodbus Library for Modbus TCP
>- lwip 2.2
>The freemodbus library uses the TCP Raw library and the upd discovery
>function the netconn api. We have one thread for modbusTCP,
Having a thread for modbusTCP when that library uses the raw (callback) API
looks like a threading violation.
Have you read the docs at http://www.nongnu.org/lwip/ (especially the chapter
"common pitfalls")?
Regards,
Simon
> one for the
>
>sensor data (ADC) and one for the discovery function (UDP Netconn API).
>
>I tried to implement the netconn API for TCP into the freemodbus
>library
>without success. I don't know exactly if I'm having a memory leak or
>another problem.
>I'm a bit lost in the jungle and I would appreciate a lot if somebody
>could me lead to the right way, so that I could solve this problem.
>Please don't excitate to ask me. I have done a lot of things and right
>now I don't know exactly which information is important to find a
>solution.
>Thank you in advance.
>
>Pablo Ledergerber