LPC1857 DMA_BUS_MODE Ethernet Software Reset Issue - cannot initialize EMAC

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC1857 DMA_BUS_MODE Ethernet Software Reset Issue - cannot initialize EMAC

1,946件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JTR298 on Tue Feb 17 16:53:38 MST 2015
Hello,

I recently purchased a KEIL MCB1800 evaluation board and built the Ethernet demonstration from the Keil example projects in IAR 7.20.2.7431. The ethernet driver provided in the example, for that board, works correctly and the EMAC initializes, Ethernet packets are received, all is well. I feel I have a decent understanding of the process.

However, when following a very similar process on my own LPC1857 board, outlined below, the SWR bit of the DMA_BUS_MODE register (user manual page 720) never reads a zero after resetting - it reads '1' before I initialize anything, and it remains stuck at '1' apparently regardless of what I'm doing. The manual states that you must wait for SWR to clear before programming any core registers. My SCU pinmuxes are setup correctly, and I'm receiving a 50MHz input to the 1857 on the EREFCLK pin (P1_19 in my case, set to E_REF_CLK, page 318 user manual). When I try to go on initializing my PHY chip (Micrel KSZ8081RNA), the E_MDC output (PC_1 Mode 3, page 322) doesn't have a clock output on it, so I know the peripheral is stalling. My goal is simply to initialize the EMAC correctly, nothing more, so I can then initialize my PHY chip and resume development.

My current initialization given the above:

LPC_CREG->CREG6 |= RMII_SELECT;     //set RMII mode for EMAC

LPC_CCU1->CLK_M3_ETHERNET_CFG = 0x07;     //RUN, AUTO enable, WAKEUP enable - should start the peripheral clock?

LPC_RGU->RESET_CTRL0 = (1 << 22);    //22 is the bit position of ethernet reset, reset EMAC in RGU
while (1) {
  if(LPC_RGU->RESET_ACTIVE_STATUS0 & (1<<22) )      //wait for reset status to go away, normally does in one IRC clock cycle, just like manual states
    break;
}

LPC_ETHERNET->DMA_BUS_MODE |= 0x01;     //set the SWR bit to reset the peripheral
vTaskDelay(1);      //1mS delay, doesn't matter if we do 500uS, 1mS, 10mS... SWR bit never resets
temp = LPC_ETHERNET->DMA_BUS_MODE;     //always reads 0x00020101 in my case, the SWR bit position is always 1

**further init to follow, but above should reset EMAC correctly, unless I'm missing something**






The manual states "The reset operation is completed only when all the resets in all the active clock domains are de-asserted. Hence it is essential that all the PHY inputs clocks (applicable for the selected PHY interface) are present for software reset completion." How do I check this? I've verified that I have a 50MHz input clock on E_REF_CLK, and the value of LPC_RGU->RESET_STATUS1 (page 198 manual) all '01's except for ETHERNET_RST which is '11' - this tells me that the EMAC received the RGU reset. Is there any setup step or input condition that I'm missing regarding initializing the EMAC peripheral? Thanks in advance, and I'll be checking this regularly if any more information is needed.
ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,820件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JTR298 on Thu Apr 02 13:48:49 MST 2015
Found the problem - the solution was to adjust the slew rate on the 50 MHz clock pin - it was basically high-pass filtering the clock signal right out.
0 件の賞賛
返信

1,820件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JTR298 on Thu Feb 19 13:30:03 MST 2015
*Bump*

Any NXP guys to chime in? I'm really at a loss.
0 件の賞賛
返信

1,820件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JTR298 on Wed Feb 18 07:54:08 MST 2015
The line above -

"LPC_CCU1->CLK_M3_ETHERNET_CFG = 0x07; //RUN, AUTO enable, WAKEUP enable" - this should turn on the EMAC peripheral clock. I'm not sure what you mean by the internal clock of the EMAC. The clock is turned on by the clock control unit, and the bits in question (bits 0,1,2) are detailed on pg. 182 of the user's manual. The working demonstration I have (on a separate board) sets all those bits high, thus the 0x07.

Turning on this clock should give me an output on the E_MDC pin (pin 9 in my case, ENET MIIM CLK, listed in the original post) that is the BASE_M3_CLK (64 MHz in my case) divided by the value designated in the MAC_MII_ADDR register bits 5:2 (pg 705 user's manual), which in my case is the standard divider of 42. However, as above, my SWR bit in the DMA_BUS_MODE register never goes to 0, and my E_MDC output remains constant low.

Is my setup above missing any steps or timing parameters to initialize the EMAC on the 1857? I've been poking pins and trying different values for days.
0 件の賞賛
返信

1,820件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Wed Feb 18 00:51:02 MST 2015
Is the internal clock of the EMAC set up?
0 件の賞賛
返信