I’m trying to follow the HW stack demo found on old.wiznet.co.kr/microchip/#tab using the Explorer 16 platform with a TWIX5200 PICtail and I’m having trouble issuing a DHCP request.
I select the following options:
#define STACK_USE_UART // Application demo using UART for IP address display and stack configuration
#define STACK_USE_DHCP_CLIENT // Dynamic Host Configuration Protocol client for obtaining IP address and other parameters
#define STACK_USE_GENERIC_TCP_CLIENT_EXAMPLE // HTTP Client example in GenericTCPClient.c
#define STACK_USE_DNS // Domain Name Service Client for resolving hostname strings to IP addresses
#define STACK_USE_TCP_PERFORMANCE_TEST // Module for testing TCP TX performance characteristics
#define STACK_USE_BERKELEY_API // Berekely Sockets APIs are available
I initialize the following sockets
{TCP_PURPOSE_GENERIC_TCP_CLIENT, TCP_ETH_RAM, W5200_TX_RAM_SIZE, W5200_RX_RAM_SIZE},
{TCP_PURPOSE_TCP_PERFORMANCE_TX, TCP_ETH_RAM, W5200_TX_RAM_SIZE, W5200_RX_RAM_SIZE},
{TCP_PURPOSE_TCP_PERFORMANCE_RX, TCP_ETH_RAM, W5200_TX_RAM_SIZE, W5200_RX_RAM_SIZE},
{TCP_PURPOSE_DEFAULT, TCP_ETH_RAM, W5200_TX_RAM_SIZE, W5200_RX_RAM_SIZE},
{TCP_PURPOSE_BERKELEY_CLIENT, TCP_ETH_RAM, W5200_TX_RAM_SIZE, W5200_RX_RAM_SIZE},
These result in a malformed BOOTP/DHCP packet and consequently, no ip address is assigned as can be seen in the Wireshark capture.
I’ve also attached a Wireshark capture of the same base TCPIP stack library (microchip_solutions_v2013-06-15) using the ETH97 hardware which shows a successful DHCP exchange.
Note that in the DHCP.h file, I have
#define DHCP_SERVER_PORT (67u)
After SM_DHCP_GET_SOCKET state the UDPSocketInfo remote port is correct but the Wireshark log shows 0.
Please advise on how to obtain an IP address from a DHCP server using the W5200 HW stack.
Thank you.