ALP-Schoof | 22 Jul 09:53 2014

Can't connect through netconn API

Hello,

I'm using Netconn API (LWIP 1.4.1) and FreeRTOS to implement an FTP server.
When I want to make a listening connection
  struct netconn *ftp_listener = netconn_new(NETCONN_TCP);
  netconn_bind(ftp_listener, IPADDR_ANY, 21);
  netconn_listen(ftp_listener);
  netconn_accept(ftp_listener, &commandConnection);
everything will work fine, I can create a connection and send/receive data
through
  netconn_write(conn, data, length, NETCONN_COPY);
  netconn_recv(conn, &rcvBuff);

However when I want to connect to a server, I get an error. 

  struct netconn* nc = netconn_new(NETCONN_TCP);
  err_t err = netconn_connect(nc, &server, serverPort);
>>>>>>> err is -10 (ERR_ABRT) at this point
  for(; ; )
  {
    netconn_write(nc, "test", 5 , NETCONN_COPY);
    vTaskDelay(1000);
  }
I've checked all communications with Wireshark, but it appears LWIP doesn't
send any connection requests.

Cheers!

--
View this message in context: http://lwip.100.n7.nabble.com/Can-t-connect-through-netconn-API-tp22930.html
(Continue reading)

Ivan Delamer | 21 Jul 20:20 2014

Re: IPV6 Porting

This used to be in one of the LwIP Wikia pages but now it is gone ... 
??

The netif has some placeholders for IPv6 addresses: 
my_netif->ip6_addr[xx]. The number of addresses is configurable in 
lwipopts.h, usually 3 is a good number.

Usually address [0] is reserved for the link-local address. If your 
netif has a hw_addr configured you can use 
netif_create_ip6_linklocal_address() to create the address. You can 
manually create the rest of the adresses, or if you have adress 
auto-configuration enabled you can let the ND6 protocol generate the 
rest of the adresses with help from your IPv6 router. you should set 
netif->ip6_autoconfig_enabled = 1; and make sure it is enabled in 
lwipopts.h

Any address you manually configure, you should use the macro 
netif_ip6_addr_set_state(netif, addr_index, IP6_ADDR_TENTATIVE) to let 
ND6 protocol validate it.

That is all you need to get set up.

If you have any other questions just ask.

Cheers
Ivan

> Date: Sun, 20 Jul 2014 15:22:12 +0800
> From: "=?ISO-8859-1?B?ZmZkZHlieg==?=" <184453147@...>
> To: "=?ISO-8859-1?B?bHdpcC11c2Vycw==?=" <lwip-users@...>
(Continue reading)

Geppo | 21 Jul 09:59 2014
Picon

New stable release

Hello,
I'd like to know when the next stable release will be available.

Thanks in advance,
Giuseppe
_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
Rainer Thaden | 21 Jul 12:13 2014

lwip PPP malloc problem

Dear all,

I am using lwIP 1.3.2 on a Stellaris LM3S6965 processor together with
FreeRTOS for UDP communication over ethernet.
lwIP is configured not to use malloc, so is FreeRTOS. Both use their own
heap implementation.
Everything is running as it should up to this point.

Since I need to communicate over serial ports, too, I activated PPP
support in lwipopts.h.
Now, the linker complains about undefined references to _sbrk which (to
me) is a sign for a call to malloc in the libc somewhere.
I do not use malloc anywhere else, so I didn't provide my own
implementation of _sbrk.
If I deactivate PPP support again, the complaints are gone.

I couldn't find any direct malloc call in the PPP sources. I also looked
through the c-preprocessed sources to have all macro substitutions done
before searching, but couldn't find it.
The linker map file also doesn't provide any clue.

Any ideas how to get rid of this?

Thanks in advance,

Rainer
ffddybz | 20 Jul 09:22 2014

IPV6 Porting

Hi,everyone. I try to port lwip-master to RT-Thread Operating System(An embedded Real-Time open source system form china).

I succeed in running IPV4 application, but the main purpose for me is porting IPV6 to it.
The wiki said that when you using ipv6 you can add macro LWIP_IPV6 in lwipopts.h
But I don't know how to call some functions to set static IPV6 address. Is there any documents talking about it? 
_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
ske | 18 Jul 19:10 2014
Picon

Change CONFIG_LINKSPEED_AUTODETECT to CONFIG_LINKSPEED

Hello all,

In the board support package i can change the value for
temac_adapter_options from 
CONFIG_LINKSPEED_AUTODETECT to CONFIG_LINKSPEED100. Then i can see in the
haeder file, that
<#define CONFIG_LINKSPEED_AUTODETECT  1> is changed with <#define
CONFIG_LINKSPEED100 1>. But in the function <unsigned Phy_Setup (XEmacPs
*xemacpsp) in xemacpsif_physpeed this compiler switch doesen't work. The
code for &lt;#ifdef  CONFIG_LINKSPEED_AUTODETECT&lt; is always aktiv.
I had regenarte the board support package and compiled the lwip application.
What is wrong?

I want to use the lwip example in my project for comminicate over ethernet.
But i don't want that the application wait for &lt;Waiting for PHY to
complete autonegotiation>.
The application should also run without connection to the ethernet. What can
i do?

I have teste it with SDK 2013.4 and SDK 2014.2.

best regards
baui

--
View this message in context: http://lwip.100.n7.nabble.com/Change-CONFIG-LINKSPEED-AUTODETECT-to-CONFIG-LINKSPEED-tp22913.html
Sent from the lwip-users mailing list archive at Nabble.com.
Steffen Wolfer | 18 Jul 11:31 2014
Picon

Multi-threaded socket access once again

Dear all,

I'm trying to access a TCP socket from multiple threads. One thread is
listening for incoming data while multiple threads are submitting data.

I've learned and understood from other postings that lwIP's sockets
are not thread safe, so I protected the calls to the send routine with
a mutex.
The receiving thread, however, blocks waiting for incoming data so I
can't use the mutex for that. But without protection, the application
crashes if there is a send call from another thread while a receive
call is active.

I resolved the issue by blocking the receive thread using an
unprotected call to select(), waiting for incoming data. Then, after
the thread has unblocked, doing a protected call to recv() that
fetches the data from lwIP.

What do you think about that? It seems to work for me but is it safe?
Or might the select() call also interfere with send() in a way that
makes the application crash at some point?

Any advice is appreciated.

Thanks,
Steffen
Sebastian Subik | 18 Jul 10:30 2014

multiple timers.c in project

Dear lwip community,

 

I am using lwip on freeRTOS 7.4.2 and everything is working.

Now I would like to use additionally the freeROTS timer (defined in timers.c).

The problem is that my CrossStudio has some linking problems, I think it could not deal with two timers.c within the same project.

 

Although this is not a lwip problem, maybe anyone has faced the same?

 

I would appreciate any comments or ideas,

 

Best Regards

Sebastian

_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users
Friedrico | 17 Jul 17:36 2014
Picon

UDP Raw receive / pbuf_free?

Hello,
I've been using the following code (lwip 1.4.1 on Infineon Tricore).
It only processes approx. 10 packages, after that it doesn't even 
process incoming packages (nor responds to pings).
Without calling the udpInit I can send/receive a lot of icmp messages - 
even tcp works, so I guess that its related to my code.

A question in advance: are the pbuf_frees called in the right moment? At 
least it doesnt work for me. (Though there are a lot of code snippets 
similar to this)

Thanks

> struct udp_pcb *udpPcb;
>

> void udpReceive(void *arg, struct udp_pcb *pcb, struct pbuf *p,
>         ip_addr_t *addr, u16_t port) {
>    sendMsgUdp((char*)p->payload, /*some ip*/);
>     pbuf_free(p);
> }

> err_t sendMsgUdp(char *msg, u32_t ip) {
>     err_t err = ERR_OK;
>     ip_addr_t ip_addr;
>     struct pbuf *pb;
>     pb = pbuf_alloc(PBUF_TRANSPORT, 0, PBUF_REF);
>     if (pb == NULL) {
>         return ERR_MEM;
>     }
>     ip_addr.addr = ip;
>     pb->payload = msg;
>     pb->len = pb->tot_len = messageSize;
>         err = udp_connect(udpPcb, &ip_addr, MY_PORT);
>         if (err != ERR_OK) {
>             return err;
>         }
>         err = udp_send(udpPcb, pb);
>         pbuf_free(pb);
>         return err;
> }

> err_t initUdp() {
>     err_t err = ERR_OK;
>     udpPcb = udp_new();
>     if (udpPcb == NULL) {
>         return ERR_MEM;
>     }
>     err = udp_bind(udpPcb, IP_ADDR_ANY, MY_PORT);
>
>     if (err != ERR_OK) {
>         return err;
>     }
>      udp_recv(udpPcb, udpReceive, NULL);
>     return err;
> }
RedCollarPanda | 17 Jul 08:39 2014
Picon

Finish lwip application

Good day!

I made my application with lwip from tcpecho example. Now I need to change
some logic in my application and one of the points is to finish whole
application after some flag. Question is - how? In "tcp echo" there are 4 or
5 threads and I need to kill them all - HOW ? 

Is there a function or semaphore  that says - "turn it off!"  or else?

Thank you. 

--
View this message in context: http://lwip.100.n7.nabble.com/Finish-lwip-application-tp22901.html
Sent from the lwip-users mailing list archive at Nabble.com.
Andrew Silverman | 10 Jul 22:15 2014
Picon

Trouble getting lwIP to respond to ARP on Xilinx Microblaze config (1.4.0)-

Please pardon the noob question, but I’m kinda stuck:

 

I have a Microblaze running on a Digilent Nexys 4 board (Artix 7 FPGA, SMC 8720 RMII PHY) and I’m having some pretty serious difficulty getting any of the sample apps provided in their SDK to work properly. I’m using the 1.4.0 distribution of lwIP that’s included in the Xilinx 2014.2 SDK – latest stuff from them, although not 1.4.1 from lwIP.  I have done some poking around the Wiki and am getting my bearings with the lwIP implementation, but I’m not quite there yet.

 

In particular, I’m just trying to run the raw mode echo server app that listens on port 7 which is supposed to echo back anything that comes in on TCP to that port, however I’ve verified with netmon that the board is not responding to any ARP requests from the PC, so it’s pretty much dead in the water.  However the application appears to start normally: On the console I can see the app assigning the static IP address/mask/gateway, and then the startup message from the echo server app appears.

 

When lwIP debugging is enabled, the startup messages from the app are followed by a long stream of pbuf frees of this sort:

pbuf_free(0x6e01a8c0)

pbuf_free: 0x6e01a8c0 has ref 65535, ending here.

 

This is interspersed with this message:

tcp_slowtmr: no active pcbs”

 

And eventually, the pbuf_free messages stop, leaving just the periodic “no active pcbs” message going as the timer fires.

 

I’m not really quite sure whether this behavior points the finger in any particular direction, so I’m also unsure where to go next in the debugging process. I’m also uncertain as to whether the problem is something in the underlying FPGA PHY->MAC implementation that I’ve put together, or whether the pbuf messages indicate that packets of some sort are being recognized and there’s some purely software problem as to why the ARPs aren’t getting handled and responded to.  Incidentally, I also tried turning on the ICMP debugging option, but this causes garbage to get spewed to the console, which doesn’t occur with any of the other debug options.

 

Any pointers of what I might want to look at next would be greatly appreciated.

 

Thanks!

Andy

_______________________________________________
lwip-users mailing list
lwip-users@...
https://lists.nongnu.org/mailman/listinfo/lwip-users

Gmane