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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3,617 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by S_Candar on Mon Jun 13 00:40:58 MST 2016
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.
Labels (1)
6 Replies

2,737 Views
engineering1
Contributor II

Hello,

Just reading the code (I did not run into this bug), I simply noticed that the RXRESET bit is not applied to the COMMAND register, which should be according to the datasheet.

I mean something like this is missing:

pENET->CONTROL.COMMAND |= ENET_COMMAND_RXRESET;

It is not in the Chip_ENET_ResetRXLogic() function which only resets the MAC part.

Not tested though.

2,737 Views
selamicandar
Contributor I

I' ve tested this applications on my own board with LPC1768, same problem. I tried to contact directly NXP, But I couldn't get any responce from my NXP contact . (We are using this controller with another projects (without ethernet) and we are consume more than 10Kpsc/year) Dissapointment!

0 Kudos

2,737 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Selami,

Are you using a custom base board with Ethernet PHY with your lpc1768 MCU? Do you have other LPC176x board which can be used for the Ethernet test?

You could try to use our lpc175x_6x CMSIS driver library to test if there is the same issue. The EMAC driver in the software platform don't use LWIP.  Here is the link:

https://www.lpcware.com/content/nxpfile/lpc175x6x-cmsis-compliant-standard-peripheral-firmware-drive...

Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos

2,737 Views
selamicandar
Contributor I

Dear Carlos,

I have performed test “LPCXpresso 1769 with CMSIS-DAP Evaluation board” from NXP first. And then I tried my custom board with PCP1768. Result was same. I have used LPCXpresso v8.1.4 IDE and LPCOpen Libraries for LPC17XX V2.10 your software. You can see the details about my problem. All softwares (IDE, source codes) come from NXP, I didn’t make any modification to the source codes.

In my new project I need RTOS and IP, because of that I have to use Freertos and LWIP. When I faced this problem and no answer from you, I seach another solutions. I tried STM32F407 from ST and their STM32Cube software (freertos and lwip), I’m still working on this solution without any problem.

Thanks and regards.

S. Selami CANDAR

MSc in Electronics

R&D Manager

Adam ArGe Haberlesme Teknolojileri

Arastirma Gelistirme Ltd.

Phone : (90) 262 6787245

email : selami.candar@adam.com.tr<mailto:scandar@adam.com.tr>

Kimden: Carlos_Mendoza

Tarih: 30 Ağustos 2016 Salı 02:03

Kime: Selami CANDAR <scandar@adam.com.tr>

Konu: Re: - LPC1769 LPCOpen ethernet applications (lwip_tcpecho, webserver) have a problem on load.

NXP Community <https://community.freescale.com/resources/statics/1000/35400-NXP-Community-Email-banner-600x75.jpg>

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

reply from Carlos_Mendoza<https://community.nxp.com/people/Carlos_Mendoza?et=watches.email.thread> in LPC - View the full discussion<https://community.nxp.com/message/826827?commentID=826827&et=watches.email.thread#comment-826827>

0 Kudos

2,737 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos

2,737 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by S_Candar on Tue Jun 14 04:30:51 MST 2016
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.
0 Kudos