Page 1 of 1
DP83848<->MAC DMA FIFO flush
Posted: Mon Mar 16, 2015 11:14 pm
by JoVM
I try to init the ethernet interface but I'm stuck at the MAC Transmit FIFO flush. FTF bit don't get cleared. I use ChibiOS 3.0.
How to configure the DMA controller for MAC?
Re: DP83848<->MAC DMA FIFO flush
Posted: Mon Mar 16, 2015 11:17 pm
by Giovanni
Hi,
MAC has its own internal DMA, no need to configure anything. It could be a PHY clock problem or a problem with I/O setup in board.h.
Search for DP83848 on the forum because the device needs a special setup, it is a recent post.
Giovanni
Re: DP83848<->MAC DMA FIFO flush
Posted: Tue Mar 17, 2015 12:39 am
by JoVM
I use the 25MHz external crystal from an STM32 20-21-45-46 G-EVAL board. MII mode. I'm not sure if I need to connect TX_CLK?
PHY scanning is working. It detect the PHY.
Re: DP83848<->MAC DMA FIFO flush
Posted: Tue Mar 17, 2015 7:59 am
by Giovanni
Not sure, I only used RMII mode.
Giovanni
Re: DP83848<->MAC DMA FIFO flush
Posted: Tue Mar 17, 2015 10:06 am
by JoVM
Is it possible to clock MCO1 at 50MHz? I use RMII mode with clock at PA8. It pass the FIFO flush but I get a link fault.
My scope is rated at 20MHz

so I can not check MCO.
Re: DP83848<->MAC DMA FIFO flush
Posted: Tue Mar 17, 2015 10:41 am
by Giovanni
I think no unless the system clock is a multiple of 50, I remember of problems in using MCO for the PHY clock, the PLL introduces too much jitter. You need an external oscillator.
Giovanni
Re: DP83848<->MAC DMA FIFO flush
Posted: Tue Mar 17, 2015 11:15 am
by JoVM
I run systemclock at 150MHz and MCO1 /3. PHY is linked now. But indeed a 50MHz external oscillator is needed to run the system at full speed. Need to order one.
Re: DP83848<->MAC DMA FIFO flush
Posted: Sun Mar 29, 2015 5:35 pm
by ulikoehler
Not sure if this is related to your problem: I had a board with a DP83848 a few years back. DO NOT use the clockout as RMII clock! Somewhere in the datasheet TI writes that it can't be used for that purpose (probably not phase-correct in respect to the main clock). Use an oscillator and fan-out the RMII clk to the STM32 and the PHY.
I got it to work with ChibiOS 2.6 successfully, so there is no fundamental problem here. Remember to use this PHY ID (which is correct at least for my board):
Code: Select all
#define MII_DP83848I_ID 0x20005C90
When using the MCO pin (I believe it should be theoretically possible if you use exactly 100Mhz system clock speed), pay close attention to duty cycle requirements of the PHY, use traces with a length which is somewhat matched etc. You could get yourself into a lot of analog issues using the MCO for this purpose, especially if your system needs to work over the full temp range.
AFAIK you can only shift out MCLK or MCLK/2 or MCLK/4, not MCLK/3, so 150Mhz won't work. However, that might depend on the exact STM32 model.
Best regards