2024-05-13 10:32 AM - edited 2024-10-06 07:10 AM
Hi
I have created Ethernet custom board using STM32F407 + LAN8742A attached is my schematic design based on Nucleo board for STM32F429ZI.
on my custom board MX_LWIP_Init is getting error in HAL_ETH_Init in following section.
/* Wait for software reset */
while (READ_BIT(heth->Instance->DMABMR, ETH_DMABMR_SR) > 0U)
{
if (((HAL_GetTick() - tickstart) > ETH_SWRESET_TIMEOUT))
{
/* Set Error Code */
heth->ErrorCode = HAL_ETH_ERROR_TIMEOUT;
/* Set State as Error */
heth->gState = HAL_ETH_STATE_ERROR;
/* Return Error */
return HAL_ERROR;
}
}
For above issue I checked the clock freq at LAN8742A input is correct 25MHz.
I also followed the issues mentioned in this post https://community.st.com/t5/stm32-mcus-embedded-software/how-to-make-ethernet-and-lwip-working-on-stm32/m-p/261456
still facing the same issue.
Also check my PCB file to verify the placement and routing and suggest the changes if there are any files attached.
the application I configured is working on nucleo board but the same configurations not working on custom hardware. attached the application used for testing
Hi @Piranha, @Tesla DeLorean Please help me resolve this issue this is my 3rd iterations on hardware but facing the same issue in all. this time I matched everything with nucleo board BOM.
Solved! Go to Solution.
2024-07-05 04:35 AM
Hello @VivekBorse ,
The clock on your costume board seems to be quite noisy I don't know the reason behind this, but I think it is related to your PCB layout, spacing ,routing ,isolation ...
if you have any updates on this it will be great to if you have succeeded in making your costume board working.
Regards
2024-05-13 11:29 AM
Perhaps clocking / sequencing issue on the STM32F4 side
What's the external clock on the STM32? Is HSE_VALUE correct?
Shouldn't single VCAP be 4u7 ? Not sure issue here.
If you have a working board, check register setting on that vs yours. Look at pins electrically too.
Check DMA settings, what errors/status that's reporting. Confirm timeout duration.
2024-05-13 12:12 PM
Hello @VivekBorse ,
this seems to be a clock issue in MCU side so check the following:
Check presence of the clock using oscilloscope and make sure is precise, check also if the MII/RMII switch is properly set in SYSCFG_PMC.MII_RMII_SEL
- check if all three ETHMACxxEN bits in RCC_AHB1ENR are set
also, after a quick check of your design I find that it is not compliant with the schematic of the Nucleo F429 which embedded the same PHY.
the RXFER/PHYAD0 pin has 33-ohm resistor and in our schematic, we have a 10K resistor:
Nucleo schematic
check also if the Capacitor values associated to your crystal oscillator is compliant because they can cause the PHY to not initialize properly hence not being able to de-assert the software reset bit.
also checked your software everything seems to be set properly and the issue is mostly in the design of the PCB.
BR
2024-05-14 10:15 AM
HI @STea and @Tesla DeLorean,
thank you for quick responses
1. I checked the SYSCFG_PMC.MII_RMII_SEL in debugging mode it is getting set properly.
2. Controller External clk is 8MHz.
3. Tried checking DMA setting but controller goes in Error_handler after finishing HAL_ETH_Init() function
2. checked ETHMACxxEN bits in RCC_AHB1ENR are set or not
Before calling HAL_ETH_Init()
after calling HAL_ETH_Init()
Changed the Resistor value for RXFER/PHYAD0 pin to 10K but issue is still same. on nucleo board after successful init I can observer 50MHz clock on Refclk0 pin but in case of custom board is not observed.
Following is the Clock signal observed for LAN chips on custom board with same of capacitor value (30pf) similar to nucleo board.
with similar part number for oscillator for LAN as nucleo board following is observed on nucleo board
I request you to review the layout also to check weather the problem is in board or not so that I can resolve this issue as soon as possible.
2024-07-04 06:48 AM
Hello @VivekBorse
I'm facing the same issue with my custom board based on the STM32F745IET6.
Did you solve this? If yes, how?
Thank you very much
2024-07-05 04:35 AM
Hello @VivekBorse ,
The clock on your costume board seems to be quite noisy I don't know the reason behind this, but I think it is related to your PCB layout, spacing ,routing ,isolation ...
if you have any updates on this it will be great to if you have succeeded in making your costume board working.
Regards
2024-07-05 05:01 AM
Might not be relevant, but what is the state of your ethernet NRST pin?
This could either be its own GPIO output, or you may have linked it to a push button? NRST should be controlled in user code to enable the PHY.
It might be that your board has an incorrect pull up / pull down, or you haven't implemented the NRST properly. Or there is a slight difference with this and the Nucleo.
Apologies if this isn't the case, your schematic doesn't show all the NRST.
Best of luck with it.