LWIP学习笔记——官方源码和移植流程

1、LWIP源码库下载

网址:link
进入网站之后,发现有两种压缩包:

  • contrib包:提供移植文件及应用实例
  • LwIP源码包:提供TCP/IP协议栈的核心文件
    下面两幅图是打开下载链接之后的截图,我们可以直接下载最新的两类文件
    1
    2

1.1 contrib包文件介绍

主要包含五个文件:

  • addons——LwIP扩展插件(一般用不到)
  • apps——LWIP应用实例
  • Coverity——LWIP静态分析工具(一般用不到)
  • examples——LWIP高级应用实例(MQTT、HTTPS、网卡驱动ethernetif)
  • ports——LWIP移植的相关文件(freertos、unix、win32…)

1.2 LWIP源码包文件介绍

主要包含三个文件夹:

  • doc:技术文档

  • src:源码,非常重要,主要包含5个文件
    3
    core文件夹内容:
    4
    5

  • test:官方人员内部测试代码

2、移植流程

  • 准备基础工程:创建LWIP工程,并新建arch和lwip_app应用文件夹
  • 添加LWIP库:将LWIP源码包的src文件夹复制到自己创建的基础工程下
  • 添加以太网驱动文件:配置介质接口、初始化IO以及开启ETH中断等操作
  • 在工程中新建分组:添加LWIP配置文件和LWIP核心源码
  • 修改配置文件
  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
INTRODUCTION lwIP is a small independent implementation of the TCP/IP protocol suite. The focus of the lwIP TCP/IP implementation is to reduce the RAM usage while still having a full scale TCP. This making lwIP suitable for use in embedded systems with tens of kilobytes of free RAM and room for around 40 kilobytes of code ROM. lwIP was originally developed by Adam Dunkels at the Computer and Networks Architectures (CNA) lab at the Swedish Institute of Computer Science (SICS) and is now developed and maintained by a worldwide network of developers. FEATURES * IP (Internet Protocol, IPv4 and IPv6) including packet forwarding over multiple network interfaces * ICMP (Internet Control Message Protocol) for network maintenance and debugging * IGMP (Internet Group Management Protocol) for multicast traffic management * MLD (Multicast listener discovery for IPv6). Aims to be compliant with RFC 2710. No support for MLDv2 * ND (Neighbor discovery and stateless address autoconfiguration for IPv6). Aims to be compliant with RFC 4861 (Neighbor discovery) and RFC 4862 (Address autoconfiguration) * DHCP, AutoIP/APIPA (Zeroconf), ACD (Address Conflict Detection) and (stateless) DHCPv6 * UDP (User Datagram Protocol) including experimental UDP-lite extensions * TCP (Transmission Control Protocol) with congestion control, RTT estimation fast recovery/fast retransmit and sending SACKs * raw/native API for enhanced performance * Optional Berkeley-like socket API * TLS: optional layered TCP ("altcp") for nearly transparent TLS for any TCP-based protocol (ported to mbedTLS) (see changelog for more info) * PPPoS and PPPoE (Point-to-point protocol over Serial/Ethernet) * DNS (Domain name resolver incl. mDNS) * 6LoWPAN (via IEEE 802.15.4, BLE or ZEP) APPLICATIONS * HTTP server with SSI and CGI (HTTPS via altcp) * SNMPv2c agent with MIB compiler (Simple Network Management Protocol), v3 via altcp * SNTP (Simple network time protocol) * NetBIOS name service responder * MDNS (Multicast DNS) responder * iPerf server implementation * MQTT client (TLS support via altcp) LICENSE lwIP is freely available under a BSD license. DEVELOPMENT lwIP has grown into an excellent TCP/IP stack for embedded devices, and developers using the stack often submit bug fixes, improvements, and additions to the stack to further increase its usefulness. Development of lwIP is hosted on Savannah, a central point for software development, maintenance and distribution. Everyone can help improve lwIP by use of Savannah's interface, Git and the mailing list. A core team of developers will commit changes to the Git source tree. The lwIP TCP/IP stack is maintained in the 'lwip' Git module and contributions (such as platform ports) are in the 'contrib' Git module. See doc/savannah.txt for details on Git server access for users and developers. The current Git trees are web-browsable: http://git.savannah.gnu.org/cgit/lwip.git http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git Submit patches and bugs via the lwIP project page: http://savannah.nongnu.org/projects/lwip/ Continuous integration builds (GCC, clang): https://travis-ci.org/lwip-tcpip/lwip DOCUMENTATION Self documentation of the source code is regularly extracted from the current Git sources and is available from this web page: http://www.nongnu.org/lwip/ Also, there are mailing lists you can subscribe at http://savannah.nongnu.org/mail/?group=lwip plus searchable archives: http://lists.nongnu.org/archive/html/lwip-users/ http://lists.nongnu.org/archive/html/lwip-devel/ There is a wiki about lwIP at http://lwip.wikia.com/wiki/LwIP_Wiki You might get questions answered there, but unfortunately, it is not as well maintained as it should be. lwIP was originally written by Adam Dunkels: http://dunkels.com/adam/ Reading Adam's papers, the files in docs/, browsing the source code documentation and browsing the mailing list archives is a good way to become familiar with the design of lwIP. Adam Dunkels Leon Woestenberg
LWIP(轻量级IP协议栈)和UIP(嵌入式IP协议栈)都是广泛使用的嵌入式操作系统网络协议栈。在LPC1788处理器上进行LWIP和UIP的移植可以实现网络功能。LPC1788是一款由恩智浦半导体公司生产的ARM Cortex-M3内核的微控制器。 LWIP和UIP的移植过程相似,下面是一个简单的移植指南: 1. 首先,需要在LPC1788处理器上设置合适的硬件和软件环境。确保处理器的外围设备(例如以太网控制器)和网络接口正确配置并连接。 2. 接下来,从LWIP或UIP的官方网站上下载相应的源代码。确保下载的版本与LPC1788处理器兼容。 3. 将源代码解压缩到LPC1788处理器的开发环境中。确保源代码的文件结构正确。 4. 打开源代码文件中的配置文件,通常是一个.h文件,根据LPC1788处理器的硬件配置进行相应的设置。这些配置包括网络接口和IP地址的设置,以太网控制器和中断的配置等。 5. 根据LPC1788处理器的中断控制器的配置,修改源代码中的中断处理函数。这些函数负责接收和处理网络数据包。 6. 根据LPC1788处理器的时钟配置,调整源代码中的时钟设置,以确保网络功能与处理器的时钟频率同步。 7. 最后,对源代码进行编译和链接,生成可执行文件。将可执行文件下载到LPC1788处理器并运行,即可进行网络通信。 通过以上步骤,就可以在LPC1788处理器上成功移植LWIP和UIP的网络协议栈,实现网络功能。可以使用网络协议栈提供的API来进行数据的发送和接收,实现远程数据通信等功能。同时,还可以根据具体应用的需求进行定制和优化,以提高系统的性能和效率。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zianMrY

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值