lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Lwip 1.4.1 initialization


From: Keith Rubow
Subject: [lwip-users] Lwip 1.4.1 initialization
Date: Fri, 16 Mar 2018 16:08:38 -0700
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

I am trying to use LwIP for the first time, and am having trouble figuring out what I need to do to properly initialize it.

I am trying to run LwIP version 1.4.1 on an STM23F427 Arm processor, but I am NOT using the on-chip ethernet interface. I am using it with a Wiznet W810MJ ethernet module in mac-raw mode. I wish to use the netconn api in a multi-threaded system. My operating system is a very simple cooperative multitasking system with no preemption and no task priorities.

So far I have implemented the sys_arch with semaphores, mailboxes, thread creation and sys_now. I have also written the basic low level driver interface for my Wiznet ethernet module, including hardware iniitialization and sending/receiving ethernet frames. For this I followed the "skeleton" driver sample code.

Now I am trying to get LwIP 1.4.1 initialized. I am doing the following:

tcp_init(NULL,NULL);
netif_add(&wiznetif,&ipaddr,&netmask,&gateway,NULL,&ethernetif_init,&tcpip_input);

Where wiznetif is a netif struct, and the IP addresses are initiallized to my desired static IP, netmask and gateway. When I run my code, I get as far as calling netif_add, but netif_add never returns. It seems to be hung in sys_arch_mbox_fetch where it is waiting for a message to be posted to a mailbox. The mailbox is empty, and nothing is getting posted to it, which is not surprising since the only LwIP related thread running is the tcp_ip thread.

I suspect I am doing something wrong in my initialization sequence. Can someone give me a hint/clue/example of how to initialize LwIP 1.4.1 in a simple multi-threaded environment?

Keith



reply via email to

[Prev in Thread] Current Thread [Next in Thread]