AnsweredAssumed Answered

the problem about the Ethernet Interrupt, i have debug it two weeks.

Question asked by roy on May 25, 2013
Latest reply on Jul 27, 2015 by jones.david.009
hello:
     i do some tests about the ethernet,when i connected the board with PC use the Ethernet crossover cable,the windows  remind me the connected have some problems.but i don't know why.
maybe the confiure GPIO have some problems,but i configure it as the same with demo(SMT32F407).I change the GPIO as my board.
the configuration is like this:
 /* Configure PA1, PA2 and PA7 */
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_7;
  GPIO_Init(GPIOA, &GPIO_InitStructure);
  GPIO_PinAFConfig(GPIOA, GPIO_PinSource1, GPIO_AF_ETH);
  GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF_ETH);
  GPIO_PinAFConfig(GPIOA, GPIO_PinSource7, GPIO_AF_ETH);
  /* Configure PB8 */
  GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_8;//GPIO_Pin_5 |
  GPIO_Init(GPIOB, &GPIO_InitStructure);
 // GPIO_PinAFConfig(GPIOB, GPIO_PinSource5, GPIO_AF_ETH);     
  GPIO_PinAFConfig(GPIOB, GPIO_PinSource8, GPIO_AF_ETH);
  /* Configure PC1, PC2, PC3, PC4 and PC5 */
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5;
  GPIO_Init(GPIOC, &GPIO_InitStructure);
  GPIO_PinAFConfig(GPIOC, GPIO_PinSource1, GPIO_AF_ETH);
  GPIO_PinAFConfig(GPIOC, GPIO_PinSource2, GPIO_AF_ETH);
  GPIO_PinAFConfig(GPIOC, GPIO_PinSource3, GPIO_AF_ETH);
  GPIO_PinAFConfig(GPIOC, GPIO_PinSource4, GPIO_AF_ETH);
  GPIO_PinAFConfig(GPIOC, GPIO_PinSource5, GPIO_AF_ETH);
this is a part of code , i open all the GPIO(connected with PHY )  Alternate Fuction, configure the GPIO like this.

The PYH chip is DP83848C ,The mode of Ethernet i used the MII,I test the RXCLK and TXCLK is 25MHZ, the CLK of PHY is external 25MHZ, I think the  CLK configuration have  no problem.

at the same time ,i can pass the fuction ETH_MACDMA_Config();
then i judge the the status of PHY,
  if (EthInitStatus == 0)
  {
     LCD_DisplayStringLine(LCD_LINE_8, (uint8_t*)" Ethernet Init failed ");
     while(1);
  }
it can pass, that's means the DP83848C have no problem,right?
the  DP83848_PHY_ADDRESS  0x01.
Then  i initialize the LwIP_Init();
HelloWorld_init();// configure the telnet port 23
  while(1)
  {
      System_Periodic_Handle();
  }

the NVIC_Configuration i open the  ETH_IRQn;that's all.
when i run tht software ,the LED of Ethernet is on ,that means the hardware is ok, however,the windows reminds the link have some problems,then i ping the IP ,i found can't work.
then i read the Register of PHY ,
RegValue =ETH_ReadPHYRegister(PHYAddress, PHY_BSR)
the value is the 0x0115, is right?(i think it's right)
now , i don't know i can't come into the interrupt,i don't know why ?
can you help me ?thanks。

pic.png

Outcomes