lwIP on a Microcontroller with two MACs

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

lwIP on a Microcontroller with two MACs

sanjayks
Hi All,
   I am new to lwIP. I have a requirement in front of me. Please guide me
where to look for.

Requirement:
1. I need a card with two ethernet ports. ( Two PHY, two MACs and two IP
addresses). The hardware designer suggested Atmel SAM9X25 which has two
PHYs.
2. I do not see a port of lwIP for SAM9X25.
3. Where do I start from? Can I start with a lwIP port for any SAM series of
Atmel and add my own ethernet driver which can handle two MACs ?
4. Are there any specific things that need to be handled when I try to use
lwIP on a microcontroller with two PHYs.

Please suggest what to look for and where to look for. Shall do the
necessary hardwork myself :).

Regards,
Sanjay



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

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwIP on a Microcontroller with two MACs

Sergio R. Caprile
2- There is no need for a specific port for a specific processor. A port
of lwIP needs to handle the OS (if any), and some nice stuff on the
processor architecture that can help making things faster (and some
intricacies of the compiler). As long as there is a port for that core
and that OS (or none), you are almost done. Stay away from esoteric
compilers and you are done.
3- You won't write a driver for two MACs, you will instantiate your
driver two times. You will have two "netifs" in lwIP's jargon. Unless
your sw requirements are not "standard"
4- You can have as many netifs as you want and your hw can fit. Notice
that lwIP is not a router/forwarder, traffic on all netifs has to have
lwIP as an endpoint and netifs should (must ?) belong to different IP
networks. This is what I mean by "standard".

To write a driver you can start by looking at the provided skeleton in
the official distribution, and take advantage of similar drivers written
by vendors and other developers. As long as there is a driver for your
controller (for whatever OS or bare metal), you can use it as an example.
There are some pointers in the wiki
        https://lwip.fandom.com/wiki/LwIP_Wiki
particularly in the Platform Developers Manual
        https://lwip.fandom.com/wiki/LwIP_Platform_Developers_Manual

The wiki is not official docs, but maintained by users. If in doubt, the
official docs rule
        https://www.nongnu.org/lwip/

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwIP on a Microcontroller with two MACs

Sylvain Rochet
Hi,

On Fri, May 03, 2019 at 09:22:46AM -0300, Sergio R. Caprile wrote:
>
> 4- You can have as many netifs as you want and your hw can fit. Notice
> that lwIP is not a router/forwarder, traffic on all netifs has to have
> lwIP as an endpoint and netifs should (must ?) belong to different IP
> networks. This is what I mean by "standard".

That's not true, lwIP supports IP forwarding (IP_FORWARD /
LWIP_IPV6_FORWARD), routing table should be implemented in
LWIP_HOOK_IP4_ROUTE and LWIP_HOOK_IP6_ROUTE hooks.

NAT is however not supported.

Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: lwIP on a Microcontroller with two MACs

Sergio R. Caprile
In reply to this post by Sergio R. Caprile
Hi Sylvain,
last time I checked there were only hooks and the user needed to write
the routing function.
Is this remarkably different now ?

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: lwIP on a Microcontroller with two MACs

Sylvain Rochet
Hi Sergio,

On Fri, May 03, 2019 at 12:44:50PM -0300, Sergio R. Caprile wrote:
> Hi Sylvain,
> last time I checked there were only hooks and the user needed to write
> the routing function.
> Is this remarkably different now ?

So ? It doesn't change my statement, IP forwarding, i.e. passing one
packet from an interface to another interface at the IP level, is
supported.

User have to implement its additional routing table through hooks if the
user need routes other than link intrinsic routes and default route.

Sylvain

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: lwIP on a Microcontroller with two MACs

Markus-3
In reply to this post by sanjayks
Hello,

was 1.) also a question?
I would not start a new design  with a controller which is not recommended
for new designs.
Take a look at the NXP iMX1060 which is faster and quite new. You can get
examples with lwIP in there SDK from here:
https://mcuxpresso.nxp.com/en/select

Best Regards



-----Urspr√ľngliche Nachricht-----
Von: lwip-users <lwip-users-bounces+tsotb=[hidden email]> Im Auftrag von
sanjayks
Gesendet: Donnerstag, 2. Mai 2019 11:23
An: [hidden email]
Betreff: [lwip-users] lwIP on a Microcontroller with two MACs

Hi All,
   I am new to lwIP. I have a requirement in front of me. Please guide me
where to look for.

Requirement:
1. I need a card with two ethernet ports. ( Two PHY, two MACs and two IP
addresses). The hardware designer suggested Atmel SAM9X25 which has two
PHYs.
2. I do not see a port of lwIP for SAM9X25.
3. Where do I start from? Can I start with a lwIP port for any SAM series of
Atmel and add my own ethernet driver which can handle two MACs ?
4. Are there any specific things that need to be handled when I try to use
lwIP on a microcontroller with two PHYs.

Please suggest what to look for and where to look for. Shall do the
necessary hardwork myself :).

Regards,
Sanjay



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

_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-users