I am interfacing ARM Controller LPC2378 with DP83848C Ethernet Physical Layer Transceiver. I have downloaded a code for ethernet related to the above interface called -EasyWEB- from NXP. While compiling the program, it was not showing any error. But while running the program in my board it was Hanging. As soon as it reach -MAC_COMMAND- to execute the instruction in -Init_EMAC- function, the program Hangs over there:
void Init_EMAC(void) { /* Power Up the EMAC controller. */ PCONP = PCONP | 0x40000000; /* Enable P1 Ethernet Pins. */ if ( MAC_MODULEID == OLD_EMAC_MODULE_ID ) PINSEL2 = 0x50151105; else PINSEL2 = 0x50150105;
PINSEL3 = ( PINSEL3 & ~0x0000000F ) | 0x00000005;
/* Reset all EMAC internal modules. */ MAC_MAC1 = MAC1_RES_TX|MAC1_RES_MCS_TX|MAC1_RES_RX| MAC1_RES_MCS_RX|MAC1_SIM_RES| MAC1_SOFT_RES;
MAC_COMMAND = CR_REG_RES | CR_TX_RES | CR_RX_RES; :
:
Since the code was hanging in -MAC_COMMAND, I modified the code. I brought the Command register before the Power Control (PCONP) register to Reset the Rx, Tx and RegReset bit. Then the program was working properly. I was able to write and read to/from DP83848C, I was able to get the correct PHY ID. But I was not able to Initialise Tx and Rx DMA Descriptors. While in the function -rx_descr_init- it gets hanged in the instruction -MAC_RXSTATUS-.