Good day,
Im working on LPC1778 MCU with ethernet DP83848C. Im using library from https://github.com/openxc/nxp-cdl/tree/master.
My application is to serve webpage. Enter Ip from browser, and it will open the MCU webpage.
Can you provide the example for this?
Thanks in advanced.
Hello
LPCOpen examples can be helpful for this, there is already a webserver example on the pack: Getting started with the LPCOpen Ethernet Examples (lwip_tcpecho and webserver) - NXP Community
Best regards,
Omar
Good day,
I have plot the code from LPCOPEN to my Keil IDE for my LPC1778 project. Its managed to detect the PHY link up & down when I plug/unplug Ethernet cable. However, its doesnt respond to the ping when I ping the IP from windows. Below is the debug viewer. I have enabled some debug options from LWIP.
LPC177X_ETH - Initialize
Starting LWIP TCP echo server...
netif: netmask of interface set to 255.255.255.0
netif: GW address of interface set to 192.168.1.254
netif_set_ipaddr: netif address being changed
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 10000870
lpc_rxqueue_pbuf: pbuf packet queued: 10000870 (free desc=3)
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 10000e88
lpc_rxqueue_pbuf: pbuf packet queued: 10000e88 (free desc=2)
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 100014a0
lpc_rxqueue_pbuf: pbuf packet queued: 100014a0 (free desc=1)
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 10001ab8
lpc_rxqueue_pbuf: pbuf packet queued: 10001ab8 (free desc=0)
netif: added interface en IP addr 192.168.1.93 netmask 255.255.255.0 gw 192.168.1.254
netif: setting default interface en
httpd_init
tcp_bind: bind to port 80
LPC177X_ETH - IP_ADDR : 192.168.1.93
LPC177X_ETH - NET_MASK : 255.255.255.0
LPC177X_ETH - GATEWAY_IP : 192.168.1.254
LPC177X_ETH - Link connect status: 0
etharp_request: sending ARP request.
pbuf_alloc(length=28)
pbuf_alloc(length=28) == 100020d0
etharp_raw: sending raw ARP packet.
pbuf_add_header: old 100020f0 new 100020e2 (14)
ethernet_output: sending packet 100020d0
pbuf_alloc(length=42)
pbuf_alloc(length=42) == 10002110
lpc_low_level_output: Switched to DMA safe buffer, old=00000000, new=10002110
lpc_low_level_output: pbuf packet(10002120) sent, chain#=0, size = 42 (index=0)
pbuf_free(100020d0)
pbuf_free: deallocating 100020d0
LPC177X_ETH - Link connect status: 1
LPC177X_ETH - IP_ADDR : 192.168.1.93
LPC177X_ETH - NET_MASK : 255.255.255.0
LPC177X_ETH - GATEWAY_IP : 192.168.1.254
lpc_rxqueue_pbuf: pbuf packet queued: 10000870 (free desc=0)
lpc_low_level_input: Packet dropped with errors (0xffffffff)
lpc_rxqueue_pbuf: pbuf packet queued: 10000e88 (free desc=0)
lpc_low_level_input: Packet dropped with errors (0xffffffff)
lpc_rxqueue_pbuf: pbuf packet queued: 100014a0 (free desc=0)
lpc_low_level_input: Packet dropped with errors (0xffffffff)
lpc_rxqueue_pbuf: pbuf packet queued: 10001ab8 (free desc=0)
lpc_low_level_input: Packet dropped with errors (0xffffffff)
lpc_rxqueue_pbuf: pbuf packet queued: 10000870 (free desc=0)
lpc_low_level_input: Packet dropped with errors (0xffffffff)
lpc_rxqueue_pbuf: pbuf packet queued: 10000e88 (free desc=0)
lpc_low_level_input: Packet dropped with errors (0xffffffff)
thanks in advanced.
*update
I changed to use MII. Then the error disappeared. Now below is my printf debug log. I still cannot ping my DP83848C. What did I miss? I attached my main file, settings & my schematic diagram.
// DEBUG LOG
LPC177X_ETH - Initialize
Starting LWIP TCP echo server...
netif: netmask of interface set to 255.255.255.0
netif: GW address of interface set to 192.168.1.254
netif_set_ipaddr: netif address being changed
Chip_Clock_GetENETClockRate: 120000000
clockRate: 2500000
tmp: 48
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 10000048
lpc_rxqueue_pbuf: pbuf packet queued: 10000048 (free desc=3)
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 10000660
lpc_rxqueue_pbuf: pbuf packet queued: 10000660 (free desc=2)
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 10000c78
lpc_rxqueue_pbuf: pbuf packet queued: 10000c78 (free desc=1)
pbuf_alloc(length=1536)
pbuf_alloc(length=1536) == 10001290
lpc_rxqueue_pbuf: pbuf packet queued: 10001290 (free desc=0)
netif: added interface en IP addr 192.168.1.93 netmask 255.255.255.0 gw 192.168.1.254
netif_is_up: 1
netif: setting default interface en
tcp_bind: bind to port 7
etharp_timer
IP_ADDR : 192.168.1.93
NET_MASK : 255.255.255.0
GATEWAY_IP : 192.168.1.254
Link connect status: 0
etharp_request: sending ARP request.
pbuf_alloc(length=28)
pbuf_alloc(length=28) == 100018a8
etharp_raw: sending raw ARP packet.
pbuf_add_header: old 100018c8 new 100018ba (14)
ethernet_output: sending packet 100018a8
pbuf_alloc(length=42)
pbuf_alloc(length=42) == 100018e8
lpc_low_level_output: Switched to DMA safe buffer, old=00000000, new=100018e8
lpc_low_level_output: pbuf packet(100018f8) sent, chain#=0, size = 42 (index=0)
pbuf_free(100018a8)
pbuf_free: deallocating 100018a8
Link connect status: 1
IP_ADDR : 192.168.1.93
NET_MASK : 255.255.255.0
GATEWAY_IP : 192.168.1.254
lpc_tx_reclaim_st: Freeing packet 100018e8 (index 0)
pbuf_free(100018e8)
pbuf_free: deallocating 100018e8
etharp_timer
etharp_timer
etharp_timer
etharp_timer
etharp_timer