This example is based on AN13458: Implement IPv6 + IPv4 Communication on One ENET Port based on LWIP.
/*
* Copyright 2017-2026 NXP
*
* NXP Confidential and Proprietary. This software is owned or controlled by NXP
* and may only be used strictly in accordance with the applicable license terms.
* By expressly accepting such terms or by downloading, installing, activating
* and/or otherwise using the software, you are agreeing that you have read,
* and that you agree to comply with and are bound by, such license terms.
* If you do not agree to be bound by the applicable license terms,
* then you may not retain, install, activate or otherwise use the software.
*********************************************************************************
* File main.c
* Owner Julián Aragón
* Version 1.0
* Date 21-09-2026
* Classification General Business Information
*********************************************************************************
* Detailed Description:
* Updated the example lwip_baremetal_s32k344 to enable simultaneous IPv4 and
* IPv6 pinging of the lwIP stack from the command window, based on AN13458.
*
* ping -4 192.168.0.200
*
* Pinging 192.168.0.200 with 32 bytes of data:
* Reply from 192.168.0.200: bytes=32 time<1ms TTL=255
* Reply from 192.168.0.200: bytes=32 time=1ms TTL=255
* Reply from 192.168.0.200: bytes=32 time<1ms TTL=255
* Reply from 192.168.0.200: bytes=32 time<1ms TTL=255
*
* Ping statistics for 192.168.0.200:
* Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
* Approximate round trip times in milli-seconds:
* Minimum = 0ms, Maximum = 1ms, Average = 0ms
*
* ping -6 FE80::3DD7:9303:126c:0df0%23
*
* Pinging fe80::3dd7:9303:126c:df0%23 with 32 bytes of data:
* Reply from fe80::3dd7:9303:126c:df0%23: time<1ms
* Reply from fe80::3dd7:9303:126c:df0%23: time<1ms
* Reply from fe80::3dd7:9303:126c:df0%23: time<1ms
* Reply from fe80::3dd7:9303:126c:df0%23: time<1ms
*
* Ping statistics for fe80::3dd7:9303:126c:df0%23:
* Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
* Approximate round trip times in milli-seconds:
* Minimum = 0ms, Maximum = 0ms, Average = 0ms
*
* EVB:
* - All jumpers in default positions
*
* Configuration:
* - Updated pin configuration
* - Updated clock configuration
* - IPv4 address: 192.168.0.200
* - IPv6 address: FE80::3DD7:9303:126c:0df0 (static link-local)
* - Enabled LWIP_IPV6 in lwipopts.h
* - Enabled LWIP_RAW in lwipopts.h
* - Set has_IPv6 = 1 in netifcfg.c
*
* main.c
* - Updated header only
* device.c
* - No changes
* test.c
* - Added IPv6 static address assignment in interface_init()
* (IP6_ADDR + netif_add_ip6_address + netif_ip6_addr_set_state)
* - Added icmp_led_init() call in apps_init()
* - Added icmp_led_callback(): raw PCB for IPv4 ICMP (protocol 1)
* flashes GREEN LED on ping receive
* - Added icmp_led_callback(): raw PCB for IPv6 ICMPv6 (protocol 58)
* flashes BLUE LED on ping receive
* - Commented out TCP/IP stack shutdown timeout
*
* -----------------------------------------------------------------------------
* Test HW: FRDM-A-S32K344 SCH-94921 PDF: SPF-94921 Rev. C
* MCU: S32K344
* Debugger: On Board
* Target: internal_FLASH
* EVB connection: EMAC <-> USB-to-Ethernet adapter <-> Laptop DELL, Windows 11
*********************************************************************************
* Revision History:
* Ver Date Author Description of Changes
* 1.0 Sep-21-2026 Julián Aragón Initial version
**********************************************************************************/
Note: In order to ping with IPv6 from Windows 11 Command Prompt, you must specify Ethernet port Idx being used:
ping -6 FE80::3DD7:9303:126c:0df0%<interface_index>
You can find your numeric index with the following command: netsh interface ipv6 show interfaces.