Re: [lwip-users] Porting 2.1.2 to Atmel Studio 7... dirent.h?

2019-02-07 Thread goldsimon


Am 8. Februar 2019 00:27:58 MEZ schrieb Stephen Cowell 
:
>I'm attempting to update the SAM4E example project 
>THIRDPARTY_LWIP_BASIC_HTTP_EXAMPLE1 from 1.4.1 to 2.1.2.  The dev
>system 
>is Atmel Studio 7 using ARM/GNU Common toolchain.  I have NO_SYS =
>1 
>this is the bare-metal implementation.
>
>I've partway through the directory problems... it seems that the 
>directory structure has changed, but the files I have have not been 
>updated.  Is this normal?  Does everyone have to go through and edit
>the 
>header file includes to reflect the new structure?  I can't see why
>this 
>is not fixed in the release.

That should not be required. Can you give an example?

>
>Now I'm getting #error " not supported".  Does this mean that
>
>I'll have to go to a different toolchain?  Do I have to have tinydir

No. Just don't compile all the files. The one with dirent.h is probably 
'makefsdata', the host tool to create the embedded file system for httpd...

>for 
>the stack to work?  My eventual target (we've been selling our product 
>with lwip 1.4.1 for years) has FatFS already, I'd rather not do the 
>filesystem over as well.  Also getting "#error makefsdata not supported
>
>on this platform"... how do I carve up lwIP?  I've already deleted the 
>'api' folder, referring to this link:
>
>https://www.nongnu.org/lwip/2_0_x/group__lwip__opts__nosys.html
>
>This link was a great help, but I'm not sure if these guys are running 
>bare-metal or not...
>
>https://community.atmel.com/forum/upgrading-lwip-141-200-pbuf-issue
>
>Perhaps someone could throw me a bone?  Do I need an RTOS to move 
>forward?  Do I need a different toolchain?
>__
>Steve
>.
>--
>
>Stephen Cowell
>Project Manager/Engineer
>Plasmability LLC
>Office (512) 267-7087
>Cell  (512) 632-8593
>www.plasmability.com
>
>
>___
>lwip-users mailing list
>lwip-users@nongnu.org
>https://lists.nongnu.org/mailman/listinfo/lwip-users
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

[lwip-users] Porting 2.1.2 to Atmel Studio 7... dirent.h?

2019-02-07 Thread Stephen Cowell
I'm attempting to update the SAM4E example project 
THIRDPARTY_LWIP_BASIC_HTTP_EXAMPLE1 from 1.4.1 to 2.1.2.  The dev system 
is Atmel Studio 7 using ARM/GNU Common toolchain.  I have NO_SYS = 1 
this is the bare-metal implementation.


I've partway through the directory problems... it seems that the 
directory structure has changed, but the files I have have not been 
updated.  Is this normal?  Does everyone have to go through and edit the 
header file includes to reflect the new structure?  I can't see why this 
is not fixed in the release.


Now I'm getting #error " not supported".  Does this mean that 
I'll have to go to a different toolchain?  Do I have to have tinydir for 
the stack to work?  My eventual target (we've been selling our product 
with lwip 1.4.1 for years) has FatFS already, I'd rather not do the 
filesystem over as well.  Also getting "#error makefsdata not supported 
on this platform"... how do I carve up lwIP?  I've already deleted the 
'api' folder, referring to this link:


https://www.nongnu.org/lwip/2_0_x/group__lwip__opts__nosys.html

This link was a great help, but I'm not sure if these guys are running 
bare-metal or not...


https://community.atmel.com/forum/upgrading-lwip-141-200-pbuf-issue

Perhaps someone could throw me a bone?  Do I need an RTOS to move 
forward?  Do I need a different toolchain?

__
Steve
.
--

Stephen Cowell
Project Manager/Engineer
Plasmability LLC
Office (512) 267-7087
Cell  (512) 632-8593
www.plasmability.com


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

Re: [lwip-users] TCP snd_queuelen issue

2019-02-07 Thread goldsi...@gmx.de

Am 07.02.2019 um 16:36 schrieb Jasper Verschueren:

Hi,


I'm running the lwIP latest master on a NXP -  K64F without operating 
system and I'm having some troubles with TCP.



I'm using a stripped down version of the httpd and added a simple HTTP 
POST command protocol to it. This command protocol is keeping the device 
and webapp in sync.


A webapp is sending POST messages to my device with the webapp state in 
it every +-60ms. The httpd sets a flag when it receives such a message. 
In main loop we evaluate the flag, if true we evaluate the received 
webapp state and send a HTTP OK with the latest device state in it. From 
this main loop flag check we construct the message, we call http_send 
and directly after tcp_output.


(I know this polling method is far from ideal but it was a quick 
implementation before we continue with websockets.)



It works great except that on completely random moments lwIP crashes and 
the complete MCU is halted.


 From time to time I get following assert when that happens:


     LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", 
(pcb->snd_queuelen >= clen));



There are also moments were no assert is triggered and it just crashes 
(or maybe the assert message is not printed on these occasions i'm not 
sure).


I have been evaluating the code that influences snd_queuelen and I 
noticed that there are some open tcp bugs at the moment that can have 
influence on sequence numbers and ack's.


I'm not aware of any having an effect on snd_queuelen. Could you point 
me at the ones you mean?


Regards,
Simon




It would really help if someone could point me in the right direction.


Thanks!

Jasper


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




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


[lwip-users] TCP snd_queuelen issue

2019-02-07 Thread Jasper Verschueren
Hi,


I'm running the lwIP latest master on a NXP -  K64F without operating system 
and I'm having some troubles with TCP.


I'm using a stripped down version of the httpd and added a simple HTTP POST 
command protocol to it. This command protocol is keeping the device and webapp 
in sync.

A webapp is sending POST messages to my device with the webapp state in it 
every +-60ms. The httpd sets a flag when it receives such a message. In main 
loop we evaluate the flag, if true we evaluate the received webapp state and 
send a HTTP OK with the latest device state in it. From this main loop flag 
check we construct the message, we call http_send and directly after tcp_output.

(I know this polling method is far from ideal but it was a quick implementation 
before we continue with websockets.)


It works great except that on completely random moments lwIP crashes and the 
complete MCU is halted.

>From time to time I get following assert when that happens:


LWIP_ASSERT("pcb->snd_queuelen >= pbuf_clen(next->p)", (pcb->snd_queuelen 
>= clen));


There are also moments were no assert is triggered and it just crashes (or 
maybe the assert message is not printed on these occasions i'm not sure).

I have been evaluating the code that influences snd_queuelen and I noticed that 
there are some open tcp bugs at the moment that can have influence on sequence 
numbers and ack's.


It would really help if someone could point me in the right direction.


Thanks!

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

Re: [lwip-users] How receive UDP broadcast with LwIP ?

2019-02-07 Thread goldsimon



Am 7. Februar 2019 16:56:04 MEZ schrieb Dirk Ziegelmeier :
>Can you at least check/debug to be sure your MAC delivers the desired
>packet to lwIP? e.g. by dumping the first few bytes of all received
>packets
>and looking for your desired broadcast?
>
>If that is not the case, consult your MAC manual about broadcast
>reception
>/ MAC filters.

Does non broadcast traffic work? Does ARP or DHCP work? If so, broadcast ETH 
works ok...

Simon

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


Re: [lwip-users] How receive UDP broadcast with LwIP ?

2019-02-07 Thread Dirk Ziegelmeier
Can you at least check/debug to be sure your MAC delivers the desired
packet to lwIP? e.g. by dumping the first few bytes of all received packets
and looking for your desired broadcast?

If that is not the case, consult your MAC manual about broadcast reception
/ MAC filters.

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

Re: [lwip-users] How receive UDP broadcast with LwIP ?

2019-02-07 Thread Pekub
Hello Dirk,

I set MAC address to: ff:ff:ff:ff:ff:ff, but it still doesn't work. 

Peter



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

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


Re: [lwip-users] How receive UDP broadcast with LwIP ?

2019-02-07 Thread Pekub
Hello Simon,

I tried it, but it doesn't work: 

err = udp_bind(upcb2, IP_ADDR_ANY, 8000);

Peter



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

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


Re: [lwip-users] How receive UDP broadcast with LwIP ?

2019-02-07 Thread Simon Goldschmidt
Pekub wrote:
> [..]
>  err = udp_bind(upcb, IP_ADDR_BROADCAST, 8000);

Maybe you should bind to the ANY addr, not to BROADCAST.

Regards,
Simon

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


Re: [lwip-users] How receive UDP broadcast with LwIP ?

2019-02-07 Thread Dirk Ziegelmeier
Did you configure your MAC to receive multicasts/boradcasts? lwIP cannot do
this!

Ciao
Dirk


On Thu, Feb 7, 2019 at 3:39 PM Pekub  wrote:

> Hello,
>
> I have this problem. I need to receive UDP Broadcast, but The "callback"
> function is never called.
>
> I use LwIP 2.0.3.
>
> /*- Default Value for IP_SOF_BROADCAST: 0 ---*/
> #define IP_SOF_BROADCAST 1
> /*- Default Value for IP_SOF_BROADCAST_RECV: 0 ---*/
> #define IP_SOF_BROADCAST_RECV 1
>
> void udp_server_init(void)
> {
>  struct udp_pcb *upcb;
>  err_t err;
>
>  upcb = udp_new();
>  ip_set_option(upcb, SOF_BROADCAST);
>
>  if (upcb)
>  {
>  err = udp_bind(upcb, IP_ADDR_BROADCAST, 8000);
>
>  if(err == ERR_OK)
>  {
> udp_recv(upcb, udp_receive_callback, NULL);
>  }
>  }
> }
>
> void udp_receive_callback(void *arg, struct udp_pcb *upcb, struct pbuf *p,
> const ip_addr_t *addr, u16_t port)
> {
>HAL_GPIO_TogglePin(GPIOE, GPIO_PIN_2);
>
>pbuf_free(p);// Free the p buffer
>
>//udp_transmit(upcb, addr, udp2_tx_data, udp2_tx_len);
> }
>
> What is wrong ?
>
> Peter
>
>
>
> --
> Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html
>
> ___
> lwip-users mailing list
> lwip-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
___
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

[lwip-users] How receive UDP broadcast with LwIP ?

2019-02-07 Thread Pekub
Hello,

I have this problem. I need to receive UDP Broadcast, but The "callback"
function is never called. 

I use LwIP 2.0.3.

/*- Default Value for IP_SOF_BROADCAST: 0 ---*/
#define IP_SOF_BROADCAST 1
/*- Default Value for IP_SOF_BROADCAST_RECV: 0 ---*/
#define IP_SOF_BROADCAST_RECV 1
   
void udp_server_init(void)
{
 struct udp_pcb *upcb;
 err_t err;
   
 upcb = udp_new();
 ip_set_option(upcb, SOF_BROADCAST);

 if (upcb)
 {
 err = udp_bind(upcb, IP_ADDR_BROADCAST, 8000);

 if(err == ERR_OK)
 {
udp_recv(upcb, udp_receive_callback, NULL);
 }
 }
}

void udp_receive_callback(void *arg, struct udp_pcb *upcb, struct pbuf *p,
const ip_addr_t *addr, u16_t port)
{
   HAL_GPIO_TogglePin(GPIOE, GPIO_PIN_2);

   pbuf_free(p);// Free the p buffer

   //udp_transmit(upcb, addr, udp2_tx_data, udp2_tx_len);
}  

What is wrong ?

Peter



--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

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