This demo application demonstrates the UDP Echo demo on lwIP TCP/IP stack with bare metal KSDK or different RTOSes.
Overview
This is a UDP echo demo on the lwIP TCP/IP stack with bare metal KSDK or different RTOSes, which uses the UDP protocol and acts as an echo server. The application on board sends back the UDP packets from the PC, which can be used to test whether the UDP connection is available.
Supported RTOS
- Freescale MQX™ RTOS
- FreeRTOS
- µC/OS-II
- µC/OS-III
- Bare Metal (no RTOS)
Supported Hardware
These Freescale Freedom development platforms and Tower System modules are supported by the KSDK UDP Echo demo.
- FRDM-K64F
- TWR-K60D100M
- TWR-K64F120M
- TWR-K65F180M
System Requirement
Hardware requirements
- J-Link ARM
- P&E Micro Multi-link universal
- Mini/micro USB cable
- USB A to micro AB cable
- Hardware (tower/base board, ...) for specific device
- Personal Computer
Toolchain requirements
- IAR embedded Workbench version 7.30.4
- ARM GCC 4.8.3 2014q3
- Keil MDK 5.13
- Kinetis Design Studio IDE v.2.5.0
- Atollic TrueSTUDIO for ARM win32 v5.2.1
Software requirements
- The project files are in:
- Bare metal: <KSDK_Install>/examples/<board>/demo_apps/lwip/lwip_udpecho_demo/udpecho_bm/<toolchain>
- RTOS: <KSDK_Install>/examples/<board>/demo_apps/lwip/lwip_udpecho_demo/udpecho_rtos/<rtos>/<toolchain>
- Library dependencies:
- Bare metal, FreeRTOS, uC/OS: ksdk_platform_lib
- MQX RTOS: mqx_<board>, mqx_stdlib_<board>
Getting Started
See the lwIP TCPIP Stack and Kinetis SDK Integration User's Guide (document KSDKLWIPUG) for instructions and requirements.
Prepare the Demo
- Connect a USB cable between the PC host and the OpenSDA USB port on the board.
- Open a serial terminal with these settings:
- 115200 baud rate
- 8 data bits
- No parity
- One stop bit
- No flow control
- Download the program to the target board.
- Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
For detailed instructions, see a Kinetis SDK User's Guide for your board.
Network Configuration
Configure the IP address of PC network adapters as shown:
Run the demo
- Download the program to the target board.
- Connect the Ethernet cable between the PC and the board.
- When successfully connected, reset the board to run the demo.
- Open the command window on PC, type in "ping 192.168.2.102" to test whether the lwIP is running.
- If it is running, use an external echo tool to perform the echo request. This tool sends UDP packets to the board and checks whether the content sent back from board is the same. A similar tool named "echotool" can be downloaded from the: http://bansky.net/echotool/ [example: echotool 192.168.2.102 /p udp /r 7 /d hello]
- If the operation is successful, all packets sent back are the same as the packets sent to the board.