[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] lwIP trouble
From: |
Slava Zilberfayn |
Subject: |
[lwip-users] lwIP trouble |
Date: |
Mon, 25 Feb 2019 21:30:28 -0500 |
Hello Lwip-users,
I have a networked device that was running lwIP 1.4.1 in the
past, but now I'm upgrading it to 2.1.0. The reason for the
upgrade is that we have a bit of instability. I have
previously identified two bugs in 1.4.1 that we were hitting,
and applied fixes. But since we still have occasional faults,
I decided to upgrade. The application is an http_server that
uses netconn API.
Now, I have also upgraded the FreeRTOS, which went relatively
trouble free.
With lwIP I first hit the new #ifdef in
netconn_write_vectors_partly:
#if LWIP_SO_SNDTIMEO
if (conn->send_timeout != 0) {
dontblock = 1;
}
#endif /* LWIP_SO_SNDTIMEO */
if (dontblock && !bytes_written) {
/* This implies netconn_write() cannot be used for non-blocking send, since
it has no way to return the number of bytes written. */
return ERR_VAL;
}
I was using netconn_write() macro, and so it was exiting
here with ERR_VAL.
I switched to netconn_write_partly() and it made things work,
sort of. I'm testing the access of a single file. It works
about 90% of the time, but the other 10% it explodes in a
strange way.
Here is the log file.
Netcnn a009879c
http_server_netconn_thread: Sending Message
Netcnn 2 a009879c
http_file_server: Processing Message
netconn_recv...
resource requested = '/s.xml'
tcp_write(), LR = 28a77
tcp_write(pcb=a0098eac, data=10003160, len=68, apiflags=1)
tcp_write: queueing 1b1c:1b60
tcp_output_segment: 1b1c:1b60
XML Generated 2000 bytes
calling netconn_write_partly 36
tcp_write(), LR = 28a77
tcp_write(pcb=a0098eac, data=1000c2c0, len=1460, apiflags=1)
tcp_write: queueing 1b60:2114
tcp_output_segment: 1b60:2114
calling netconn_write_partly 37
tcp_write(), LR = 28a7************tcp_write(), LR = 28a77
tcp_write(pcb=a0098eac, data=1000c874, len=540, apiflags=1)
tcp_write: queueing 2114:2330
tcp_output_segment: 2114:2330
************7
tcp_write(pcb=a0098eac, data=1000c874, len=540, apiflags=1)
tcp_write: queueing 2330:254c
HARD FAULT
_CFSR 8200
_BFAR 18
LR 2022d
I have added the ********* manually to demark the
intervening call. What I see is that in
the middle of the tcp_write execution another call of
tcp_write comes in with exactly the same parameters.
Presumably to send the same piece of data. I've added
printing LR register at the entry into tcp_write to see there
it is called from. Both calls come from the same location
(api_msg.c:1712). Now I'm kind out of ideas. Any pointers
where to look at would be appreciated.
attached are my config files.
Thank you, Slava
--
Slava Zilberfayn mailto:address@hidden
Phone: 416 7289367
Home Electronics, www.home-electro.com
100 Drumlin Circle,
Suite 205
Concord, ON, L4K 3E6
CANADA
FreeRTOSConfig.h
Description: Text document
lwipopts.h
Description: Text document
lwippools.h
Description: Text document
- [lwip-users] lwIP trouble,
Slava Zilberfayn <=