[lwip-users] LPC1768 lpc_low_level_input: Packet dropped with errors (0xffffffff)

2014-11-26 Thread Jan Menzel
Hi All! I'm facing the unpleasant problem that most input packets are dropped by the LPC1768 low level input if my code is run without IDE connected. The same code started using the IDE works well and I don't see this kind of errors. The error message is "lpc_low_level_input: Packet dropped

Re: [lwip-users] LPC1768 lpc_low_level_input: Packet dropped witherrors (0xffffffff)

2014-11-27 Thread Jan Menzel
Dear Darius! Many thanks for your response. This is what I'm doing in some more details: - I retargeted all debug output to a UART (available standalone) - a terminal is watching the debug output - Wireshark is recording network activity - I flash the code into the MCU via SWD using the ID

Re: [lwip-users] problem with creating TCP socket

2014-11-27 Thread Jan Menzel
Hi Gavin! My code uses close() (which is a define to lwip_close()) which frees all the memory. You may wont to trace close() to check if the memory is really freed up. Jan On 27.11.2014 11:18, Gavin wrote: > Hi, > > I got one problem about creating TCP socket. > > In my case, I

Re: [lwip-users] LPC1768 lpc_low_level_input: Packet dropped witherrors (0xffffffff)

2014-11-27 Thread Jan Menzel
d the buffers in AHB-SRAM (0x2007). Any clue why that matters? Jan On 27.11.2014 11:25, Jan Menzel wrote: > Dear Darius! > Many thanks for your response. This is what I'm doing in some more > details: > - I retargeted all debug output to a UART (avail

Re: [lwip-users] LPC1768 lpc_low_level_input: Packet dropped witherrors (0xffffffff)

2014-11-28 Thread Jan Menzel
On 28.11.2014 03:07, Grzegorz Niemirowski wrote: > Jan Menzel napisal(a): >> Hi all! >> It seems that I've found the problem now. For anyone facing the same >> issue: I have changed the linker script and positioned the buffer >> descriptors and the receive buffers

Re: [lwip-users] LPC1768 lpc_low_level_input: Packet dropped witherrors (0xffffffff)

2014-11-29 Thread Jan Menzel
low_level_input: Packet dropped > witherrors (0x) > > Jan Menzel wrote: >> On 28.11.2014 03:07, Grzegorz Niemirowski wrote: >>> Does your low level driver use DMA? Is AHB-SRAM accessible by DMA? >>> >> Yes, all memory is accessible via DMA. IIRC datashee

[lwip-users] unsent_oversize mismatch vs. unexpected RST

2015-01-14 Thread Jan Menzel
Hi All! Currently I'm trying to finalize a data logger application based on LwIP 1.4.1 and FreeRTOS 8.1.2 on LPC1768 with NXPs lpc17xx_40xx_emac as low-level driver. Everything runs smooth so far with one exception: if the logger has collected a larger amount of data and tries to stream it,

Re: [lwip-users] unsent_oversize mismatch vs. unexpected RST

2015-01-19 Thread Jan Menzel
Hi Simon! Today I've tried to reproduce the problem to record the logs, luckily without success. I do not see this unexpected RSTs anymore. Jan On 14.01.2015 10:37, Dr. Jan Menzel wrote: > On 14.01.2015 10:23, Simon Goldschmidt wrote: >> Jan Menzel wrote: >>&g

[lwip-users] Understanding retransmission

2015-01-19 Thread Jan Menzel
Hi All! May I ask for your comments on the attached Wireshark capture? 192.168.5.108 is LwIPs Git master on a LPC1768. 162.242.228.73 is some Linux based server. The LPC is just flushing some larger buffer (a few mb) to the server. In line 21 the shark records a duplicated ACK, whic

Re: [lwip-users] Understanding retransmission

2015-01-19 Thread Jan Menzel
Hi Simon! On 19.01.2015 16:19, Simon Goldschmidt wrote: > Jan Menzel wrote: >> In line 21 the shark records a duplicated ACK, which >> I've seen a few times already (there is one in line 7 for example.). > > I don't know what the reason for the Dup ACK in frame #7

Re: [lwip-users] Understanding retransmission

2015-01-20 Thread Jan Menzel
Hi Simon! On 19.01.2015 20:30, Jan Menzel wrote: > On 19.01.2015 17:31, Simon Goldschmidt wrote: >> "Jan Menzel" wrote: >>> Your patch is already part of my code. I just disabled >>> LWIP_CHECKSUM_ON_COPY and have not seen a bad packet since the

Re: [lwip-users] Understanding retransmission

2015-02-16 Thread Jan Menzel
other guarding, so I assume no. What would be the correct way to handle this? Jan On 21.01.2015 21:54, goldsi...@gmx.de wrote: > Jan Menzel wrote: >> Maybe I did not enabled all options as I have not seen >> the ASSERT() message. >> [..] >> Today I discove

Re: [lwip-users] memory leak ?

2015-06-04 Thread Jan Menzel
Hi Noam! From earlier discussion on this list, I learned that for this purpose one may schedule a callback into the LWIPs internal task using tcpip_callback() or tcpip_callback_with_blocking(). Both queue your function and its arguments for execution from within the main Lwip task context.

[lwip-users] out of PBUF_POOL, where to start seachring

2015-12-18 Thread Jan Menzel
Hi all! In you application we run into problems with out of memory in PBUF_POOL when the link is not stable. If the link comes up and goes down in less then a second, it seems that buffers from PBUF_POOL are somehow lost. The link-up/down detection is done in a separate thread, which reads

Re: [lwip-users] API question

2016-04-11 Thread Jan Menzel
Hi Noam! I recently finished an application with almost the same setup: mbedTLS (successor of PolarSSL with better licensing options) via socket API (found some example for my MCU which I used as started) and SNTP client from contrib tree which uses RAW API. Works very well since month.

[lwip-users] How do I close a socket/netconn TCP connection

2016-08-05 Thread Jan Menzel
Hi all! Whats the correct way to close a socket/netconn TCP connection without loosing any data in send window? I'm using an OS and version 1.4.1. I've written some terminating message into the connection and now like to close and free it. Unfortunately a call to lwip_shutdown() seems to re

Re: [lwip-users] How do I close a socket/netconn TCP connection

2016-08-05 Thread Jan Menzel
Hi Simone! Many thanks for your response! On 05.08.2016 20:13, goldsi...@gmx.de wrote: > Jan Menzel: >> Whats the correct way to close a socket/netconn TCP connection >> without >> loosing any data in send window? > > The correct way for (standard) socke

Re: [lwip-users] Connection freeze after 29200 Bytes

2016-08-06 Thread Jan Menzel
That smells like you started with a 32k buffer and did not free the memory on receive. On 06.08.2016 13:03, Norbert Kleber wrote: > Hello everyone, > > I ran into a problem while implementing the LwIP stack v1.3.2 onto the > STM32F4 Evalboard. > My Intention is to build a bootloader application w

Re: [lwip-users] stm32 ethernet interrup priority

2016-08-22 Thread Jan Menzel
Hi Erkan! Despite interrupt priorities, system freezes are usually an indication for badly designed interrupt handlers. Interrupt handler shall only do necessary things and execute as fast as possible. In some designs I've see interrupt handler do as little as only wakeup a task that to do

[lwip-users] DNS: handle multiple IPs

2016-09-08 Thread Jan Menzel
Hi All! Has anyone every tried to enhance the dns client to handle all supplied ip addresses? I'm currently facing issues with NTP servers and found, that DNS servers reply with multiple IPs to my query. LwIP only selects the first of this. Now I wonder if using the other IPs might help me

Re: [lwip-users] TCP Zero Window

2016-09-09 Thread Jan Menzel
Hi Norbert! The advertised receive window size specifies the amount of memory the stack can consume without further acknowledgement. Once the application side has read received data and acknowledged/freed it, the receive window is enlarged by this amount and - after a certain timeout - a wi

Re: [lwip-users] TLS over TCP on LwIP

2016-10-27 Thread Jan Menzel
Hi Fred! MBedTLS is straight forward to integrate suppose you find a configuration that matches your ram/flash constraints. Its interface to the network layer is in net.c and comes with a version that uses socket api. IIRC you'll have to make some minor modification there to get the connect

Re: [lwip-users] TFTP init

2017-01-18 Thread Jan Menzel
Hi Ajay! If sending an image is all you wont to do, you might consider using tftp. tftp is especially designed for this purpose, requires only udp but lacks features like authentication. Many bootloaders use tftp to boot using an image located on the network. Jan On 18.01.2017 14:

Re: [lwip-users] PolarSSL and mbedTLS

2017-03-01 Thread Jan Menzel
Hi Noam! I've designed a system with almost the same setup which works well since a few years incl. firmware updates of a ~200kb. Did you checked the memory consumption of the ip stack and the ssl max content length setting? The default max content length setting is IIRC 16kb, which

Re: [lwip-users] PolarSSL and mbedTLS

2017-03-01 Thread Jan Menzel
-- > *From:* lwip-users on > behalf of goldsi...@gmx.de > *Sent:* Wednesday, March 1, 2017 9:26 PM > *To:* Mailing list for lwIP users > *Subject:* Re: [lwip-users] PolarSSL and mbedTLS > > I did have mbedTLS running against our httpd (no sockets) but the &

Re: [lwip-users] PolarSSL and mbedTLS

2017-03-02 Thread Jan Menzel
K frame in one pBuf if the sender is sending a large chank. So there > should be something else ? > > > Noam. > -------- > *From:* lwip-users on > behalf of Jan Menzel > *Sent:* Wednesday, March 1, 2017 11:46 PM

Re: [lwip-users] PolarSSL and mbedTLS

2017-03-02 Thread Jan Menzel
> are there to decrypt. So if it > Works for a small message it should work for a larger message that is > decrypted in chunks anyway. > > Any suggestion for an easy to handle (for testing) WSS server in PHP or > similar ? > > I think you are correct that it is a memory probl

Re: [lwip-users] PolarSSL and mbedTLS

2017-03-03 Thread Jan Menzel
, March 01, 2017 9:27 PM > To: Mailing list for lwIP users > Subject: Re: [lwip-users] PolarSSL and mbedTLS > > I did have mbedTLS running against our httpd (no sockets) but the resource > usage was rather high. > I'd imagine the problem could be lwIP's memory configuratio

Re: [lwip-users] PolarSSL and mbedTLS

2017-03-14 Thread Jan Menzel
Hi Noam! IIRC this options is not widely implemented. Especially openssl seems to lack it. If you configure a short FRAGMENT_LENGTH and the other side does not respect the option, transfer of large data blocks (>~ FRAGMENT_LENGTH) will not be possible. Jan On 12.03.2017 10:05, Noa

Re: [lwip-users] PolarSSL and mbedTLS

2017-03-15 Thread Jan Menzel
Hi Noam! Did you follow the error code through mbedtls's net.c? In my code its translated into "MBEDTLS_ERR_SSL_WANT_READ" as follows: int mbedtls_net_recv( void *ctx, unsigned char *buf, size_t len ) [...] ret = (int) read( fd, buf, len ); if( ret < 0 ) { if( net_woul

Re: [lwip-users] Building mbedtls using LWIP library

2017-04-18 Thread Jan Menzel
Hi Shruthi! I'm using mbedtls and lwip on an embedded devices so I can only help integration both if there are no other tcp/ip-stacks around. Basically mbedtls interfaces to any tcp/ip-stack using bsd-socket API. This is archived using the file net.c, which comes with mbedtls such,

Re: [lwip-users] Building mbedtls using LWIP library

2017-04-18 Thread Jan Menzel
On 18.04.2017 16:03, Simon Goldschmidt wrote: [...] > If you want to use mbedTLS with lwIP's callback API, have a look into current > git master, I'm just working on that. No way to integrate that back into > 1.4.x though. Can you tell me more what improvements you're implementing and how this

Re: [lwip-users] HTTPS support in lwip

2017-05-18 Thread Jan Menzel
Hi Sandeep! I've an application where about 500kb of JS-Code, webpages and other stuff is loaded by the browser initially. This does not require more then 2..3 connections in parallel (a pool of 4 clients was always enough). At the end, the buffer size required for encrypting/decryp

Re: [lwip-users] HTTPS support in lwip

2017-05-18 Thread Jan Menzel
On 18.05.2017 21:37, goldsi...@gmx.de wrote: > Jan Menzel wrote: >> At the end, the buffer size required for encrypting/decrypting >> transmitted/received data is something, that depends on your setup and >> on configuration options commonly available. So, if you carefully

Re: [lwip-users] Raw api + multiple TCP Connections

2017-05-22 Thread Jan Menzel
Hi Werner! In you initial post you wrote, that your system catches a Hardfault. A Hardfault indicates are general MCU failure which can be something like memory corruption, stack problem, unaligned address, division by zero or even escalated from some other fault. The actual reason can usua

Re: [lwip-users] lwip complex example

2017-07-04 Thread Jan Menzel
Hi Max! It's the nature of the stack that you may combine any examples you like suppose you can provide sufficient resources. Running eg. http and sntp is quite easy you just need more udp pcbs for sntp and/or tcp support for http... In case of problems I'd suggest to carefully chec

Re: [lwip-users] lwip complex example

2017-07-05 Thread Jan Menzel
this with two threads or I have to do with just > one. > > I have other doubts about initialization > > > best regards > > Max > > On 04/07/2017 17:53, Jan Menzel wrote: >> Hi Max! >> It's the nature of the stack that you may combine any examp

Re: [lwip-users] Randomized initial local port in tcp_connect()

2017-08-07 Thread Jan Menzel
Hi Gus! You also need to define LWIP_RAND to a rand()-like function which will be called to get the next random number. This number is used to initial the local port. Only if both (LWIP_RAND and LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS) are defined, UDP (udp.c line 98) and TCP (tcp.c line 144) us

Re: [lwip-users] how to handle multiple TCP socket simultaneously

2017-08-08 Thread Jan Menzel
mbox.err is used in the OS-interface layer only. My implementation (FreeRTOS) increments it if sending a message fails or if the mailbox is not empty when deleted. Jan On 08.08.2017 10:58, Mohsin Madki wrote: > SYS > sem.used: 6 > sem.max: 11 > sem.err: 0 > mutex.used: 0 > mutex.max:

[lwip-users] netconn send broadcast

2017-11-07 Thread Jan Menzel
Hi all! Today I've implemented a little debug facility that sends out some data using netconn api in broadcast mode. It took a while until I figured out, that broadcast transmission is disabled by default and requires SOF_BROADCAST to be set in the pcbs so_options member. I found the macro

Re: [lwip-users] Problem running lwip on cortex M7 with D cache enabled

2017-11-30 Thread Jan Menzel
Hi Jochen! Please recap where the D-cache is located, what its intended to provide and how it effects the memory content. If the CPU and some hardware (GPDMA/GMAC) are accessing the memory for Ethernet transmission and reception, you've to make sure, that each sees the correct information.

Re: [lwip-users] Problem running lwip on cortex M7 with D cache enabled

2017-12-01 Thread Jan Menzel
On 30.11.2017 15:58, goldsimon wrote: > > > Jan Menzel wrote: >> I'd suggest to align (position and size) all receive >> buffers to d-cache lines so that invalidation does not cause any side >> effects. > > And it's exactly this that lwip does not fu

Re: [lwip-users] Problem running lwip on cortex M7 with D cache enabled

2017-12-04 Thread Jan Menzel
On 01.12.2017 17:26, goldsimon wrote: >> For RX the Ethernet data part has to be aligned to cache line to void >> issues due to cache invalidation. >> In my implementations I use pooled memory. From the lwip code I can >> see, that LWIP_MEM_ALIGN_SIZE() is used to add padding between >> m

Re: [lwip-users] Problem running lwip on cortex M7 with D cache enabled

2017-12-04 Thread Jan Menzel
On 30.11.2017 23:09, Jochen Strohbeck wrote: > As already written in my previous posts I can place the buffer > descriptors to non-cache memory. I checked the address in the debugger. > But if I try to place 'memp_memory' (which seems to be the data buffer > for the lwip pool and is used to hold th

Re: [lwip-users] Problem running lwip on cortex M7 with D cache enabled

2017-12-05 Thread Jan Menzel
On 05.12.2017 8:22, Jochen Strohbeck wrote: > I found an error in the non-cacheable section declaration in the linker > configuration file. Fixed that. > Did you check the performance for your system? I suppose with buffers in non-cached memory you do not have any benefits of the d-cache. If you c

Re: [lwip-users] Queueing up UDP packets in RAW api

2018-02-16 Thread Jan Menzel
Hi Michael! I like this type of discussions so let me put my five cents in too: - due to the zero-copy approach, the pbufs you see in receive callbacks are the ones you queued up in the input driver. So, if you're in charge for the input driver, you could only provide reasonable large pbufs

[lwip-users] SSI: error codes not handled

2018-02-19 Thread Jan Menzel
Hi all! I just discovered a mismatch between documentation and implementation of the SSI support in the httpd application (version 2.0.3): The documentation of tSSIHandler says "The handler returns the number of characters written to pcInsert excluding any terminating NULL or a negative nu

[lwip-users] httpd: how to redirect to a new address

2018-02-19 Thread Jan Menzel
Hi all! In our application we wont to allow the user to change the ip address of the server using a webpage. I wonder what would be the best way of doing that. At present we use a very basic webserver that servers a different page (with HTTP status code 301) if the parameters update

Re: [lwip-users] httpd: how to redirect to a new address

2018-02-20 Thread Jan Menzel
On 20.02.2018 9:00, goldsi...@gmx.de wrote: > On 19.02.2018 23:18, Jan Menzel wrote: [...] >> At present we use a very basic webserver that servers a different >> page >> (with HTTP status code 301) if the parameters update the ip address. >> After sending out the

Re: [lwip-users] [OT] httpd: download static files from an external HTTP server

2018-02-20 Thread Jan Menzel
On 20.02.2018 11:01, Giuseppe Modugno wrote: [...] > I don't need to change this behaviour at runtime or depending on a > variable in the MCU that runs lwip/httpd. I will decide this behaviour > at *compile time*, so when generating the httpd filesystem. I'm > searching for an *HTML only* technique

[lwip-users] dns: remember multiple IP addresses patch

2018-02-21 Thread Jan Menzel
Hi all! I'd like to share a small patch with you that allows the dns subsystem to remember and handle more then one IP address from response messages. It basically parses out all IP address and stores them in an array. It then returns a random entry. The patch was created against lwip 2.0.0

Re: [lwip-users] dns: remember multiple IP addresses patch

2018-02-21 Thread Jan Menzel
On 21.02.2018 19:49, goldsi...@gmx.de wrote: > On 21.02.2018 17:18, Jan Menzel wrote: >> Hi all! >> I'd like to share a small patch with you that allows the dns >> subsystem >> to remember and handle more then one IP address from response messages. >> It b

Re: [lwip-users] TCP Sessions Scale Limit

2018-02-27 Thread Jan Menzel
On 27.02.2018 14:54, Anil kumar wrote: [...] >         memerr: 20829 [...] You have memory (RAM) problems. Jan ___ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users

Re: [lwip-users] TCP Sessions Scale Limit

2018-02-27 Thread Jan Menzel
ugePages:   2727936 kB > CmaTotal:              0 kB > CmaFree:               0 kB > HugePages_Total:    4096 > HugePages_Free:     4032 > HugePages_Rsvd:        0 > HugePages_Surp:        0 > Hugepagesize:       2048 kB > DirectMap4k:      272572 kB > DirectMap2M: 

Re: [lwip-users] Getting Raw ARP Packets

2018-05-22 Thread Jan Menzel
Hi Dave! What you described looks like a bridge to me. If you don't have to process tcp/udp packets (send an receive data from your local device) you don't need lwip. You could just build an Ethernet driver (which you would have to do for lwip anyhow as its hardware related and not part of

Re: [lwip-users] lwIP Packets are not received

2018-06-23 Thread Jan Menzel
Hi Arul! Enabling d-cache requires code changes wherever other hardware is accessing ram because the cache might contain data not yet written back to memory or old data that does not reflect the current memory content. As most emacs use DMAs to send and receive you have to drain d-cache for

Re: [lwip-users] LWIP connection problem

2018-08-27 Thread Jan Menzel
Hi! What you're reporting sounds to me as if you're missing to check the line status or if you link status check is not working properly. Usually you've to poll the phy and react to link status changes by updating the emac configuration and informing lwip if a link is available or not.

Re: [lwip-users] Threading Question using LWIP with TM4C1294NCPDT

2018-10-26 Thread Jan Menzel
On 26.10.2018 10:27, vr roriz wrote: >> and only one interrupt runs at a time and isn't interrupted by another >> interrupt while using > lwIP - you should be safe. > > Simon, could you clarify why nesting interrupts are a problem and > non-nesting are not? Do you mean that, if an interrupt execu

Re: [lwip-users] Threading Question using LWIP with TM4C1294NCPDT

2018-10-26 Thread Jan Menzel
On 26.10.2018 15:57, vr roriz wrote: >> Vitor, make sure your processes are never cycled by the scheduler > otherwise you'll violate the threading requirements. I'd suggest to just > have a single thread for lwip and use a mailbox or similar to trigger > certain actions. The OS will take care that

Re: [lwip-users] lwIP with mbedTLS

2019-01-27 Thread Jan Menzel
Hi Pawel! On 27.01.2019 14:08, Paweł wrote: [...] > I'm missing two messages: Client Key Exchange and then Session ticket. [...] Thats where the expensive part has been done. I'd suggest to check your memory setup. You need a lot of memory to validate the servers identity... Jan > Regar

Re: [lwip-users] lwIP with mbedTLS

2019-01-27 Thread Jan Menzel
, data=@20005920, len=102, apiflags=1) > *tcp_write: queueing 6510:6612* > ssl->f_send() returned 102 (-0xff9a) > <= flush output > <= write record > <= write handshake message > <= write client hello > client state: 2 > => flush output > <= flush out

Re: [lwip-users] Network Loss causes network to go down

2020-04-01 Thread Jan Menzel
Hi Dan! Its a fundamental thing with TCP and UDP that there is not way to know, that the link is valid but the other side just did not had anything to say unless you added it to your protocol. Using cable detection in the phy might help, but only a little bit as most devices talk to other d

Re: [lwip-users] Control priority processing of the packages

2020-09-20 Thread Jan Menzel
Hi Mario! If you say "OS delay" you're probably using an OS. If you're using the netcon or socket API you could send your "data transfer of application" to a separate task and assign it a lower priority. That way your application code can run as fast as mcu permits and "networking managemen

Re: [lwip-users] SPAM: lwIP on STM32H743 - memory problems

2020-12-04 Thread Jan Menzel
Hi Christoph! The emac-driver that ships with STMs examples (CubeMX) has a few issues. It sounds as if you hit some. You might find this article helpfull: https://community.st.com/s/question/0D50XBOtfhnSQB/how-to-make-ethernet-and-lwip-working-on-stm32 I'd suggest that you check the netwo

Re: [lwip-users] unsent_oversize mismatch vs. unexpected RST

2015-01-14 Thread Dr. Jan Menzel
On 14.01.2015 10:23, Simon Goldschmidt wrote: > Jan Menzel wrote: >> the "unsent_oversize mismatch" assert from tcp_out.c line 444 hits. I've >> googled around and found, that this is a know problem with a related >> bug-report and a fix in the current git

Re: [lwip-users] PolarSSL and mbedTLS

2017-03-14 Thread Dr. Jan Menzel
last mail. OTOH, for getting the > errno set by recvfrom, you don't have to be an lwIP developer... > > Simon > > > ___ > lwip-users mailing list > lwip-users@nongnu.org > https://lists.nongnu.org/mailman/listinf

Re: [lwip-users] PolarSSL and mbedTLS

2017-03-16 Thread Dr. Jan Menzel
the call to mbedtls_ssl_set_bio to use the > mbedtls_net_recv_timeout instead of > mbedtls_net_recv function. With this change I am able to read the first SSL > record without problems > > Thanks for all the help so far :-) > > > BR, > Noam. > > -Original Me