LwIP TCP/IP Stack And MCUXpresso SDK Integration User’s

Transcription

NXP SemiconductorsUser's GuideDocument Number: MCUXSDKLWIPUGRev. 8, 03/2018lwIP TCP/IP Stack andMCUXpresso SDK IntegrationUser’s GuideContents1 OverviewThis document describes how to compile and run the lwIPTCP/IP stack examples. This document also provides theboard-specific information related to the jumper and hardwaresettings.2 Release scope2.1 HardwareThis release includes support for the TWR-K64F120, TWRKV58F220M, TWR-K65F180M, and TWR-K35F180MTower System modules, EVK-MIMXRT1050, FRDM-K64Fand FRDM-K66F Freedom development platforms, andLPCXpresso54xxx derivatives.3 Requirements for runninglwIP demosReview Draft1Overview.12Release scope. . 13Requirements for running lwIP demos.14lwIP code structure. 35Compiling or running the lwIP stack anddemos.36Revision history. . 14

Requirements for running lwIP demos3.1 Supported hardware platforms Tower System development platforms: TWR-SER serial peripheral board TWR-ELEV boards (pair) USB cable Ethernet cableNOTEFor Tower System boards, extra TWR-SER and TWR-ELEV modules areneeded Freedom development platforms: USB cable Ethernet cable LPCXpresso development platforms: USB cable Ethernet cable3.2 Software development tools MCUXpresso SDK release package that includes the lwIP TCP/IP packageMCUXpresso IDEIAR Embedded Workbench for Arm version 7.80.2Keil μVision 5 Integrated Development Environment Version 5.21aKinetis Design Studio IDE Version: 3.2.0NOTEMCUXpresso targets only. KDS IDE does not support LPC boards. Makefiles support with GCC revision 5-2016-q3-update from GNU Arm Embedded Toolchain3.3 Board jumper settingsThe Ethernet-related jumper settings are described in this document. For other jumper settings, see the board-specific user’sguide. By default, the lwIP stack uses RMII mode. Follow the below hardware configuration: TWR-K64F120M J32 1-2: Use the external clock from the CLOCKIN0 to keep the synchronization with the external PHY onTWR-SER Tower System module. TWR-K65F180M No jumper specifications. TWR-SER J2 3-4: Ethernet PHY Clock Select 50 MHz, RMII mode. Cut off other connections on this jumper. J3 2-3: Route 50 MHz clock to CLOCKIN0. Cut off other connections on this jumper. J12 9-10: Ethernet PHY Configuration, pull-up CONFIG0, RMII select. Cut off other connections on this jumper. Freedom FRDM-K64F platform No jumper specifications.lwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/20182Review DraftNXP Semiconductors

lwIP code structure4 lwIP code structureThe lwIP code is located in this folder: install dir /middleware/lwip 2.0.0. The lwIP folder includes the source code. Thereare two subfolders in the lwip folder as shown in the figure.Figure 1. lwIP folder structure contrib This subfolder includes third party demo applications provided by the lwIP project (lwIP project has two separatedownloads, lwIP and lwIP contrib). doc This subfolder includes some readme files and some files for generating Doxygen documentation from lwIPsources. src This subfolder includes the lwIP 2.0.0 source code which can be downloaded from this link: savannah.gnu.org port This subfolder includes the adapter files which can make the lwIP stack run on the MCUXpresso SDK anddifferent RTOSes.5 Compiling or running the lwIP stack and demos5.1 Step-by-step guide for MCUXpresso IDEThis section shows how to compile and run demos in the MCUXpresso IDE.1. After opening an existing or creating a new workspace, drag and drop the SDK zip file into the "Installed SDKs" viewto install an SDK. Next, import the lwIP demos.Figure 2. Install SDKs viewlwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/2018NXP SemiconductorsReview Draft3

Compiling or running the lwIP stack and demosFigure 3. Import projectlwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/20184Review DraftNXP Semiconductors

Compiling or running the lwIP stack and demosFigure 4. Select the boardlwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/2018NXP SemiconductorsReview Draft5

Compiling or running the lwIP stack and demosFigure 5. Select the path of lwip ping bmlwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/20186Review DraftNXP Semiconductors

Compiling or running the lwIP stack and demosFigure 6. Demo project2. Build the lwip ping bm using [Build] on the Quickstart panel.3. Select “Debug ‘MK64FN1M0xxx12 Projectdemo apps lwip ping bm’ [Debug]” on the Quickstart Panel. Wait forthe download to finish.lwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/2018NXP SemiconductorsReview Draft7

Compiling or running the lwIP stack and demosFigure 7. Debug the demo4. Click the “Resume” button to run the demo.5.2 Step-by-step guide for IAR Embedded Workbench for ArmThis section shows how to compile and run demos in IAR Embedded Workbench for Arm.1. Open the workspace corresponding to different demos and different boards. For example, the lwip ping bm.eww onthe Freedom FRDM-K64F Platform under install dir /boards/frdmk64f/demo apps/lwip/lwip ping/bm/iar/ or thelwip ping demo freertos.eww on the Freedom FRDM-K64F platform under install dir /boards/frdmk64f/demo apps/lwip/lwip ping/freertos/iar/. These steps use lwip ping demo.eww on FRDM-K64F as an example.lwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/20188Review DraftNXP Semiconductors

Compiling or running the lwIP stack and demosFigure 8. Workspace2. Build the lwip ping bm.Figure 9. lwip ping bm3. Click the “Download and Debug” button. Wait for the download to finish.4. Click the “Go” button to run the demo.lwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/2018NXP SemiconductorsReview Draft9

Compiling or running the lwIP stack and demos5.3 Step-by-step guide for Keil µVision 5 IDEThis section shows how to compile and run demos in Keil µVision 5 IDE.1. Open the workspace corresponding to different demos and different boards. For example, the lwip ping bm.uvmpw onthe Freedom FRDM-K64F platform under install dir /boards/frdmk64f/demo apps/lwip/lwip ping/bm/mdk/ or thelwip ping freertos.uvmpw on the Freedom FRDM-K64F platform under install dir /boards/frdmk64f/demo apps/lwip/lwip ping/freertos/mdk/. These steps take lwip ping bm.uvmpw on the Freedom FRDM-K64F platform for anexample.Figure 10. Workspace2. Build the lwip ping bm.3. Click Start/Stop Debug Session. Wait for the download to finish.4. Click the “Run” button to run the demo.5.4 Step-by-step guide for the Kinetis Design Studio IDElwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/201810Review DraftNXP Semiconductors

Compiling or running the lwIP stack and demosThis section shows how to compile and run demos in the Kinetis Design Studio IDE.1. The Kinetis Design Studio IDE does not have a workspace. Create a workspace and import the lwIP demos. Forexample, import the .cproject for lwip ping bm on Freedom FRDM-K64F platform under install dir /boards/frdmk64f/demo apps/lwip/lwip ping/bm/kds/; or import the lwip ping freertos on the Freedom FRDM-K64Fplatform under install dir /boards/frdmk64f/demo apps/lwip/lwip ping/freertos/kds/.Figure 11. Import project with KDS IDElwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/2018NXP SemiconductorsReview Draft11

Compiling or running the lwIP stack and demosFigure 12. Import project selectlwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/201812Review DraftNXP Semiconductors

Compiling or running the lwIP stack and demosFigure 13. Demo project2. Build the lwip ping bm.3. Open debug configurations and choose J-Link Debugging.lwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/2018NXP SemiconductorsReview Draft13

Revision historyFigure 14. Debug Configurations4. Click the “Debug” button. Wait for the download to finish.5. Click the “Resume” button to run the demo.5.5 Step-by-step guide for ARMGCC and KDSGCC1. ARMGCC and KDSGCC both use cMake to generate makefiles. Run the batch file (in the Windows operatingsystem) or sh file (in Linux operating system) to build projects. These steps use ARMGCC as an example.2. Change to the demo directory. For example: install dir /boards/frdmk64f/demo apps/lwip/lwip ping/bm/armgcc3. Run build all.bat to build both debug and release projects.4. Go to the debug/release directory to download and run the elf file using gdb.6 Revision historyThis table summarizes revisions to this document.lwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/201814Review DraftNXP Semiconductors

Revision historyTable 1. Revision HistoryRevision numberDateSubstantive changes209/2015Updated tool versions in Section 3.2 andupdated Section 5.2311/2015Updated Section 1401/2016Updated Section 1 and Section 3.2510/2016Updated Section 2.1 and Section 3.1603/2017Updated for MCUXpresso SDK711/2017803/2018 Removed unsupported board forMCUXpresso SDK v2.3.0 release Added EVK-MIMXRT1050 boardsupportEditorial updates for MCUXpresso SDKv2.3.1 and v2.4.0lwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide, Rev. 8, 03/2018NXP SemiconductorsReview Draft15

How to Reach Us:Home Page:nxp.comWeb Support:nxp.com/supportInformation in this document is provided solely to enable system and softwareimplementers to use NXP products. There are no express or implied copyrightlicenses granted hereunder to design or fabricate any integrated circuits basedon the information in this document. NXP reserves the right to make changeswithout further notice to any products herein.NXP makes no warranty, representation, or guarantee regarding the suitability ofits products for any particular purpose, nor does NXP assume any liability arisingout of the application or use of any product or circuit, and specifically disclaimsany and all liability, including without limitation consequential or incidentaldamages. “Typical” parameters that may be provided in NXP data sheets and/orspecifications can and do vary in different applications, and actual performancemay vary over time. All operating parameters, including “typicals,” must bevalidated for each customer application by customerʼs technical experts. NXPdoes not convey any license under its patent rights nor the rights of others. NXPsells products pursuant to standard terms and conditions of sale, which can befound at the following address: nxp.com/SalesTermsandConditions.NXP, the NXP logo, NXP SECURE CONNECTIONS FOR A SMARTERWORLD, COOLFLUX, EMBRACE, GREENCHIP, HITAG, I2C BUS, ICODE,JCOP, LIFE VIBES, MIFARE, MIFARE CLASSIC, MIFARE DESFire, MIFAREPLUS, MIFARE FLEX, MANTIS, MIFARE ULTRALIGHT, MIFARE4MOBILE,MIGLO, NTAG, ROADLINK, SMARTLX, SMARTMX, STARPLUG, TOPFET,TRENCHMOS, UCODE, Freescale, the Freescale logo, AltiVec, C-5, CodeTest,CodeWarrior, ColdFire, ColdFire , C-Ware, the Energy Efficient Solutions logo,Kinetis, Layerscape, MagniV, mobileGT, PEG, PowerQUICC, Processor Expert,QorIQ, QorIQ Qonverge, Ready Play, SafeAssure, the SafeAssure logo,StarCore, Symphony, VortiQa, Vybrid, Airfast, BeeKit, BeeStack, CoreNet,Flexis, MXC, Platform in a Package, QUICC Engine, SMARTMOS, Tower,TurboLink, and UMEMS are trademarks of NXP B.V. All other product or servicenames are the property of their respective owners. ARM, AMBA, ARM Powered,Artisan, Cortex, Jazelle, Keil, SecurCore, Thumb, TrustZone, and μVision areregistered trademarks of ARM Limited (or its subsidiaries) in the EU and/orelsewhere. ARM7, ARM9, ARM11, big.LITTLE, CoreLink, CoreSight,DesignStart, Mali, mbed, NEON, POP, Sensinode, Socrates, ULINK andVersatile are trademarks of ARM Limited (or its subsidiaries) in the EU and/orelsewhere. All rights reserved. Oracle and Java are registered trademarks ofOracle and/or its affiliates. The Power Architecture and Power.org word marksand the Power and Power.org logos and related marks are trademarks andservice marks licensed by Power.org. 2018 NXP B.V.Document Number MCUXSDKLWIPUGRevision 8, 03/2018Review Draft

5.4 Step-by-step guide for the Kinetis Design Studio IDE Compiling or running the lwIP stack and demos lwIP TCP/IP Stack and MCUXpresso SDK Integration User’s Guide