NOTICE: This website will be shut down in the near future. Product content has moved to nxp.com. Forum content and FAQs have been moved to community.nxp.com. We encourage you to create a user account on nxp.com to use the new community forums and access NXP microcontroller content. We greatly appreciate your contributions and look forward to seeing you at our new web location.

 

LPC1769 LPCOpen ethernet applications (lwip_tcpecho, webserver) have a problem on load.

1 reply [Last post]
S_Candar
Offline
Joined: 2016-05-21
Posts: 2

I' m using LPCXpresso 1769 with CMSIS-DAP Evaluation board and LPCXpresso v8.1.4. I've downloaded LPCOpen Libraries for LPC17XX V2.10

I have been testing Ethernet applications with lwip IP stack. I have tested with and without freeros versions. (lwip_tcpecho, webserver)

I have a common problem at all examples. Applications start to run normaly as expected. But at a bit IP traffic, Ethernet MAC lock. This problem can easily regenerate. You can use ping command for do this. (I'm using "ping 122.122.122.75 -n 10000 -l 10000" command, problem will appear in a minute. Or you can re-load web page 50-100 times in webserver)

In problem case, everything normal except ethernet. (in freertos version all task running) Ethernet MAC is acting like nothing has come. (Transmit continue normaly) All ethernet registers seems normal. You can find register dump in this case.

Ethernet Registers:
Mac1=3
Mac2=31
Command=643
Status=1
RxStatus=10000bb8
RxDescriptorNumber=3
RxConsumeIndex=0
RxProduceIndex=0
TxStatus=10000bf8
TxDescriptorNumber=3
TxConsumeIndex=0
TxProduceIndex=0
RxFliterCtrl=22
IntStatus =0
IntEnable=bb
PowerDown=0

Interrupt registers:
ISER=10400422
ISPR=20010000
IABR=0

As you can see RxConsumeIndex and RxProduceIndex is same so the receive buffer is empty. In this case RxConsumeIndex and RxProduceIndex (this register have to increase) do not change. I checked ethernet phy outputs, there are receive activity. Also I've checked this problem with another hardware, results are same.

I think there is a bug in LPC17xx/40xx LWIP EMAC driver.

0
Your rating: None

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
S_Candar
Offline
Joined: 2016-05-21
Posts: 2

Another issue :

I want to reset the Ethernet RX side when the rx side frezzes. There is a code part for do this in arch/lpc17xx_40xx_emac.c :

/* Temporarily disable RX */
Chip_ENET_RXDisable(LPC_ETHERNET);

/* Reset the RX side */
Chip_ENET_ResetRXLogic(LPC_ETHERNET);
Chip_ENET_ClearIntStatus(LPC_ETHERNET, ENET_INT_RXOVERRUN);

/* De-allocate all queued RX pbufs */
for (idx = 0; idx < LPC_NUM_BUFF_RXDESCS; idx++) {
if (lpc_enetif->rxb[idx] != NULL) {
pbuf_free(lpc_enetif->rxb[idx]);
lpc_enetif->rxb[idx] = NULL;
}
}

/* Start RX side again */
lpc_rx_setup(lpc_enetif);

/* Re-enable RX */
Chip_ENET_RXEnable(LPC_ETHERNET);

This code runs when rx overrun error occurs. I tried to run this code part when rx side freeze to re-enable the rx side, it doesn't work. I tried to run this code when rx side was normal, rx side froze. Accualy, this code never run normaly. (no overrun error at 120Mhz) But I think there is a bug for this reset mechanism.

feedback