unnamed | 27 Jul 08:33 2015
Picon

freertos + lwip = no uart ?

hi, i'am trying to port FreeRTOS + lwip to atxmega128a3u and almost every
thing is working fine, only my uart wont fire up when i compile my project
with lwip files included, what can be the cause of this ? Any help would be
appreciated.

without lwip files uart is working great
with lwip files i just get one character "?" upon uart init function and
nothing else, tasks are still working fine.

tried uart with and without interrupts

lwip is not initialized in my project, only compiled

i'am using
microchip: atxmega128a3u on internal 32mhz clock
freeRTOS 8.2
lwip 1.4.1

any help where should i search for erros ? right now i can't use my debugger
becouse there is something wrong with amtel-ice+osx+avrdude so i'am stuck...

--
View this message in context: http://lwip.100.n7.nabble.com/freertos-lwip-no-uart-tp24724.html
Sent from the lwip-users mailing list archive at Nabble.com.
Xun Chen | 24 Jul 22:52 2015

Re: lwip-users Digest, Vol 143, Issue 18

Hi Sergio,

Thanks for your pointer and patience!

After some debugging and tracking, I found the problem. I am writing to confirm the problem is neither in
lwip nor the port, but the communication between the remote side and my codes, since this is my first try
with callback, I didn't handle things properly.

Here is what happened (simplified):

The program is like a data pump to convey data to the remote side at 200kb/sec rate. On the first call to
tcp_write, I write 3000 bytes, so after two packets of 1460 bytes, or 2920 bytes, I get an ACK from remote and
the tcp_sent callback is invoked. At this point, I have only 300 points. Adding the 80 bytes from previous
tcp_write, 380 bytes are sent out by lwip.

Now the remote side is waiting for the second TCP packets before it ACKs

There is NO second packet since I only use callback to send out data (my previous approach that is not relying
on callback will work fine here, but it eventually gives me problem and I switched to callback approach per
your suggestion)

Finally the remote side ACK the last odd packet after waiting for 200ms, and now I have A LOT of data in queue
for tcp_write, so I observe the pause in my data stream, this cycle repeats

I don't lose any data, but the GUI is very jerky due to this 200ms pause.

I can work around it with tricks, but maybe you can give me a better pointer on how to deal with the problem so
that I can get tcp_sent callback in a nice pace for smooth data display.

Thanks and have a nice weekend!
(Continue reading)

Sandra Gilge | 24 Jul 10:28 2015

Assertion on Select

Hi,

regarding my Problem with the assertion on select:
I'm using the IP stack in several tasks (Webserver, SIP, mDNS, TFTP,
MODBUS). 
But every task uses its own sockets. Still there seems to be a problem with
multithreading.
The problem occurs (sporadically) in one task, when another socket is closed
in another task.

It seems that the error NEVER occurs, when SO_REUSE is disabled. (mDNS for
example uses SO_REUSEADDR, so I enabled it recently)
Could it be that the socket is reused before it is really closed and the
select_waiting is set to zero (by doing the new connection) but there is one
more select (by the just closed connection)?

I'm still hoping for answers.

Best regards,
Sandra

-----Ursprüngliche Nachricht-----
Von: lwip-users-bounces+sgilge=adatis.com@...
[mailto:lwip-users-bounces+sgilge=adatis.com@...] Im
Auftrag von
lwip-users-request@...
Gesendet: Mittwoch, 22. Juli 2015 18:00
An: lwip-users@...
Betreff: lwip-users Digest, Vol 143, Issue 16

(Continue reading)

Grzegorz Niemirowski | 23 Jul 03:34 2015
Picon

Can't process incoming UDP packets after one of hosts is powered down

Hello

I have a strange problem with UDP packets on my STM32 board. It communicates 
with four hosts:
A - an NTP server in Internet (UDP "connection")
B - a PC running a simple TCP server
C - second board runnging UDP server
D - a WWW server in Internet (providing weather data using JSON)
There is also a WWW server running on my board. I use lwip 1.4.1 with 
FreeRTOS and socket API. Everything works fine and there are no problems. 
Except when host B is turned off. Then UDP stops working on my board. It no 
longer synchronizes time over NTP and can't exchange data with host C. Local 
WWW server works OK and the board downloads weather data from server D. In 
other words TCP still works but UDP doesn't.
The problem occurs after B is powered down. There is no problem when B was 
turned off while my lwip board was powered on. There is no problem when 
network service on B is turned off or was turned off. The problem is only 
when the operating system of B is shot down during my board operating.
I can't explain this behavior. My only idea is that there is a problem with 
ARP cache. Maybe powering down host B removes its entry from ARP cache in 
some uncontrolled way which affects UDP memory allocation? I also traced 
down UDP handling. I discovered that in recv_udp the 
memp_malloc(MEMP_NETBUF) function returns NULL. It doesn't happen during 
normal operation. I don't understand why memory can't be allocated.

Best regards,
Grzegorz Niemirowski
http://www.grzegorz.net/ 
Xun Chen | 22 Jul 15:41 2015

Re: lwip-users Digest, Vol 143, Issue 10

Hi Sergio,

I took your suggestion of only sending out more data in tcp_sent callbak 
and rewrite the codes

And I run into another problem: The data stream is very jerky (I am 
streaming 200kb/s)

So I used a scope to see how often the tcp_sent callback is invoked, it 
turns out:

I will get about 10-20 callbacks within a short burst of 5 to 10ms, then 
there is NO callback for 200ms, then repeat

I tried to tune lwip based on various previous suggestions on the forum 
and didn't have much luck.

With this callback frequency, it is impossible to plot data in real time 
smoothly (data acquisition application)

Any suggestion? Thanks!

Chen

On 7/11/2015 12:00 PM, lwip-users-request@... wrote:
> Send lwip-users mailing list submissions to
> 	lwip-users@...
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.nongnu.org/mailman/listinfo/lwip-users
(Continue reading)

Sandra Gilge | 22 Jul 14:11 2015

Assertion on select

Hallo

 

I’m using LWIP 1.4.1 and the Blackfin VDK port from analog devices (which is originally for 1.4.0). I moved on to 1.4.1 on my own.

 

Now I’m having problems with following assertion when calling select.

LWIP_ASSERT("sock->select_waiting >= 0", sock->select_waiting >= 0);

 

I have several threads that use the socket interface. For me it looks like a thread safety problem, but SYS_ARCH_PROTECT is implemented.

 

Has anybody a hint what could go wrong?

 

Best Regards,

Sandra

 

 

 

 

_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
Michał Karczewski | 21 Jul 11:01 2015
Picon

HTTP server with null files

I'm working on http server that is using netconn api and could read files
from SD Card. I'm using STM32F429. I've configured LwIP, FatFS and FreeRTOS
that it is possible to ping using tcp and udp protocol. After some
pre-configuration of netconn server I tried to connect using browser. In the
result, standard pc browser download window is coming and starts to download
file with random name which contains only NULL values. The size of
downloaded file matches chosen file from http_server_serve() function, so in
some way it is connected with file on SD Card, but problems are with data
value.

Next to that I can tell previously I configured http server without any API
(raw version) and I hadn't had any problems with displaying website from SD
Card.
Pîrvu Mihai | 19 Jul 05:54 2015
Picon

Problems with MiniOS and lwIP (1.3.2) on their daytime server application


Hello, I want to start by saying that I'm really new with the platform (like 3 days of research), but i stumbled upon a problem i can't fix. I hope this won't be considered spam :)

Anyway, my problem is pretty simple probably. I'm trying to access the daytime server, which is ran default when compiling with lwIP 

I looked inside the source of daytime.c, provitded by Mini OS, and I saw that the setting up of an IP address is disabled with an "if(0) { ... }" construct, so I changed that and set my ip to: 10.0.2.10/24  (so it is in the same network as Dom0) like this:

....
    start_networking();

    if (1) {
        struct ip_addr ipaddr = { htonl(0x0a00020A) }; //10.0.2.10
        struct ip_addr netmask = { htonl(0xffffff00) }; // 255.255.255.0
        struct ip_addr gw = { 0 };
        networking_set_addr(&ipaddr, &netmask, &gw);
    }
....

The compiling is fine (though I also have something to say about this, but in the footer of the mail).

I start the VM, with xl create domain_config, which looks like this:
kernel = "mini-os.gz"
memory = 32
name = "Mini-OS"
on_crash = 'destroy'
vif=['xenif']

I go into the console, and it all seems fine:

.....
mac is 00:16:3e:70:4a:02
**************************
[server] IP 0 netmask 0 gateway 0.
[server] TCP/IP bringup begins.
Thread "tcpip_thread": pointer: 0x00000000000ca738, stack: 0x0000000000220000
[tcpip_thread] TCP/IP bringup ends.
[server] Network is ready.
[server] Opening connection
[server] Connection at 0000000000042820


This is where I'm lost a little. I try to ping 10.0.2.10 and it works!

root <at> ubuntuZen:/home/mihai/xen/extras/mini-os# ping 10.0.2.10
PING 10.0.2.10 (10.0.2.10) 56(84) bytes of data.
64 bytes from 10.0.2.10: icmp_seq=1 ttl=255 time=0.546 ms
64 bytes from 10.0.2.10: icmp_seq=2 ttl=255 time=0.189 ms
64 bytes from 10.0.2.10: icmp_seq=3 ttl=255 time=0.142 ms
64 bytes from 10.0.2.10: icmp_seq=4 ttl=255 time=0.247 ms

But when I try to connect to 10.0.2.10:13 nothing happens.
My netcat just hangs, but it hangs on all ports, not just 13. I have to ctrl+c it so it dies, so it's not like the connection is rejected. But, on the console, nothing is printed. I even put a little print code after the 

session = netconn_accept(listener); 

part, so it shows me when that function has returned a "session", thus the connection is understood, but it never gets there, the function just blocks and never returns.

Here's the entire code, if you think I've done something wrong: http://pastebin.com/riuh5n0w

I tried to look with nmap, and all ports are closed.

Sorry if the question is 'stupid', I'm new to both projects (mini os and lwip) and I'm just trying to learn. 


Mihai
_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
Pîrvu Mihai | 19 Jul 05:49 2015
Picon

Fwd: Problems with MiniOS and lwIP (daytime server)

Hello, I want to start by saying that I'm really new with the platform (like 3 days of research), but i stumbled upon a problem i can't fix. I hope this won't be considered spam :)

Anyway, my problem is pretty simple probably. I'm trying to access the daytime server, which is ran default when compiling with lwIP 

I looked inside the source of daytime.c, provitded by Mini OS, and I saw that the setting up of an IP address is disabled with an "if(0) { ... }" construct, so I changed that and set my ip to: 10.0.2.10/24  (so it is in the same network as Dom0) like this:

....
    start_networking();

    if (1) {
        struct ip_addr ipaddr = { htonl(0x0a00020A) }; //10.0.2.10
        struct ip_addr netmask = { htonl(0xffffff00) }; // 255.255.255.0
        struct ip_addr gw = { 0 };
        networking_set_addr(&ipaddr, &netmask, &gw);
    }
....

The compiling is fine (though I also have something to say about this, but in the footer of the mail).

I start the VM, with xl create domain_config, which looks like this:
kernel = "mini-os.gz"
memory = 32
name = "Mini-OS"
on_crash = 'destroy'
vif=['xenif']

I go into the console, and it all seems fine:

.....
mac is 00:16:3e:70:4a:02
**************************
[server] IP 0 netmask 0 gateway 0.
[server] TCP/IP bringup begins.
Thread "tcpip_thread": pointer: 0x00000000000ca738, stack: 0x0000000000220000
[tcpip_thread] TCP/IP bringup ends.
[server] Network is ready.
[server] Opening connection
[server] Connection at 0000000000042820


This is where I'm lost a little. I try to ping 10.0.2.10 and it works!

root <at> ubuntuZen:/home/mihai/xen/extras/mini-os# ping 10.0.2.10
PING 10.0.2.10 (10.0.2.10) 56(84) bytes of data.
64 bytes from 10.0.2.10: icmp_seq=1 ttl=255 time=0.546 ms
64 bytes from 10.0.2.10: icmp_seq=2 ttl=255 time=0.189 ms
64 bytes from 10.0.2.10: icmp_seq=3 ttl=255 time=0.142 ms
64 bytes from 10.0.2.10: icmp_seq=4 ttl=255 time=0.247 ms

But when I try to connect to 10.0.2.10:13 nothing happens.
My netcat just hangs, but it hangs on all ports, not just 13. I have to ctrl+c it so it dies, so it's not like the connection is rejected. But, on the console, nothing is printed. I even put a little print code after the 

session = netconn_accept(listener); 

part, so it shows me when that function has returned a "session", thus the connection is understood, but it never gets there, the function just blocks and never returns.

Here's the entire code, if you think I've done something wrong: http://pastebin.com/riuh5n0w

I tried to look with nmap, and all ports are closed.

Sorry if the question is 'stupid', I'm new to both projects (mini os and lwip) and I'm just trying to learn. 


Mihai

_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
Mario Viara | 16 Jul 11:47 2015
Picon

lwIP GPRS module helper

I have posted in GITHUB a module for PPP over GPRS.
The module is working in more than one project and 

--

Cordiali saluti / Best regards
Mario Viara
_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
Xun Chen | 13 Jul 15:02 2015

Re: Retransmit too quick?

Thanks for the clarification, I will take your suggestion and modify my 
codes accordingly

On 7/11/2015 12:00 PM, lwip-users-request@... wrote:
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 10 Jul 2015 13:31:37 -0300
> From: "Sergio R. Caprile" <scaprile@...>
> To: lwip-users@...
> Subject: Re: [lwip-users] Retransmit too quick?
> Message-ID: <559FF369.3050406@...>
> Content-Type: text/plain; charset=utf-8
>
> The RAW API is event driven code.
> The ACK is handled as an ACK by lwIP. This means the window is updated,
> the sent pbufs are freed, and you can send data again.
> You can't send more data until you receive an ACK for your window size.
> You can't queue more data until lwIP frees pbus (when you receive an ACK).
> There is no point in calling the send function when you don't have room
> to queue/send more data, this causes CPU hog.
> There is no point in calling the send function at specific intervals
> (assuming you need to send a big bunch of data); if the ACK gets
> received in between the interval, you'll have dead times where nothing
> is sent.
> The write time to call the send function is when the sent callback is fired.
> You are free to choose and write your app the way you want; but, if it
> does not work and you ask for help...
> Good luck.
>

Gmane