Page 1 of 1

STM32F427 Ethernet support

Posted: Mon Oct 07, 2019 1:46 pm
by martinkuhn
Hey there!
I'm running ChibiOS (and nanoFramework) on a STM32F427 based board and am trying to make the Ethernet interface work. I have an external ethernet PHY (maxim 78Q2123) which uses the MII Interface of the MAC. The communication with the PHY seems to work as the mii_write and mii_read functions during the initialization for powering down/up the PHY work fine.
But in the function mac_lld_start() in hal_mac_lld.c right after the start of the send and receive process
ETH->DMAOMR = ETH_DMAOMR_DTCEFD | ETH_DMAOMR_RSF | ETH_DMAOMR_TSF | ETH_DMAOMR_ST | ETH_DMAOMR_SR;
the Ethernet DMA state register has the value 0x3802102 which means that RX and TX process stopped and a fatal bus error occurred. The error codes say that there was an error during data transfer TxDMA, read transfer and descriptor access.
I can't find the cause of this issue. Do you have any idea?

Re: STM32F427 Ethernet support

Posted: Mon Oct 07, 2019 5:33 pm
by Giovanni
Hi,

There are several things to check:

1) Clock frequencies for Ethernet peripheral and PHI.
2) GPIO settings for all pins between the two.
3) Are descriptors and buffers placed in an accessible RAM area?

Giovanni

Re: STM32F427 Ethernet support

Posted: Mon Oct 07, 2019 9:47 pm
by mikeprotts
It's probably worth getting the processing working with a fairly similar board that's already well supported, perhaps the STM32F429 nucleo (https://www.st.com/en/evaluation-tools/ ... 429zi.html). That helps to ensure that you avoid problems with pin assignments etc. until you have a functioning system, and then the number of variables is reduced significantly when you move to a different board.

I've found the STM32CubeMX software is very helpful in highlighting pin assignments when changing processor, even if you don't use it for anything else.

Mike

Re: STM32F427 Ethernet support

Posted: Tue Oct 08, 2019 12:18 pm
by martinkuhn
Thanks for your answer. The buffers and descriptors were indeed placed in a RAM region that wasn't accessible by the DMA. It works now.