2021-06-14 02:32 PM
I am trying to get the LwIP_TCP_Echo_Client example to work on my custom board.
I never get past the HAL_ETH_GetReceivedFrame.
/* get received frame */
if (HAL_ETH_GetReceivedFrame(&heth) != HAL_OK)
return NULL;
The board I am using has a STM32F429ZIT6 connected to a DP83848 PHY
The STM32429I-EVAL was used as a reference to the custom board. Different CPU pins were used due to the use of a STM32429ZI processor. Interrupt pin goes directly to the processor instead of to an expansion chip.
The hardware is connected MII.
/**ETH GPIO Configuration
PC1 ------> ETH_MDC
PC2 ------> ETH_TXD2
PC3 ------> ETH_TX_CLK
PA0/WKUP ------> ETH_CRS
PA1 ------> ETH_RX_CLK
PA2 ------> ETH_MDIO
PA3 ------> ETH_COL
PA7 ------> ETH_RX_DV
PC4 ------> ETH_RXD0
PC5 ------> ETH_RXD1
PB0 ------> ETH_RXD2
PB1 ------> ETH_RXD3
PB10 ------> ETH_RX_ER
PB11 ------> ETH_TX_EN
PB12 ------> ETH_TXD0
PB13 ------> ETH_TXD1
PB8 ------> ETH_TXD3
*/
/**ETH Interrupt GPIO Configuration
PB14 ------> ETH_INT (GPIO_EXTI14)
/**Switch GPIO Configuration
PE6 ------> Switch_INT (GPIO_EXTI6)
Compiler:
STM32CubeIDE Version 1.6.1 build 9958_20210326_1446 (UTC)
STM32CubeMX Version: 6.2.1-RC2 Build: 20210324-1236 (UTC)
LwIP Version 2.1.2
The PHY Chip defaulted to address 1. I changed it to address 3. I read online that there might be a problem with using address 1. Neither address worked. I just changed the address via software I did not re-strap the pins.
I have been able to connect to the PHY chip and the following is a data dump of the settings:
low_level_init
PHY_PHYIDR1 : 0x2000
PHY_PHYIDR2 : 0x5c90
PHY_ANAR : 0x01e1
PHY_ANLPAR : 0x45e1
PHY_ANLPARNP: 0x45e1
PHY_ANNPTR : 0x2801
PHY_MICR : 0x0000
PHY_FCSCR : 0x0000
PHY_RECR : 0x0000
PHY_PCSR : 0x0100
PHY_RBR : 0x0001
PHY_LEDCR : 0x0000
PHY_BTSERIAL: 0x0804
PHY_CDCCTRL1: 0x0000
PHY_EDCR : 0x6011
PHY_ANER : 0x0005
PHY_PHYCR : 0x8023
PHY_BMCR : 0x2100
PHY_BMSR : 0x784d
PHY_STS : 0x0605
PHY_MICR : 0x0003
PHY_MISR : 0x0020
When I press the switch to start the TCP transmission, I do not get past the ARP.
WireShark Results example:
60 ARP announcement for 10.100.0.20
60 Who has 10.100.0.23? Tell 10.100.0.20
42 10.100.0.23 is at 50:3f:56:02:5c:2c
60 Who has 10.100.0.23? Tell 10.100.0.20
42 10.100.0.23 is at 50:3f:56:02:5c:2c
I have converted the example code to STM32CubeIDE and ran it on the STM32429I-EVAL successfully.
On an O-scope, I was able to see signals on the RX_DV line and the RXD0 line. I think the data is getting through the PHY.
Has anyone experienced a problem similar to this?
Any Ideas would be greatly appreciated.
2021-06-15 11:42 AM
I wanted to add the Ethernet Portion of the schematic.
Also the Wireshark Image.
2021-06-16 09:31 AM
I found a solution to my problem.
R98 which is connected to the MII_RXD3 line was a 4.7K Resistor not a 33 ohm resistor.
After changing that resister to a 33 Ohm the Ethernet started communicating.
Thanks for looking at this issue.