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?
DP83848<->MAC DMA FIFO flush
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: DP83848<->MAC DMA FIFO flush
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
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
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.
PHY scanning is working. It detect the PHY.
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: DP83848<->MAC DMA FIFO flush
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.
My scope is rated at 20MHz
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: DP83848<->MAC DMA FIFO flush
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
Giovanni
Re: DP83848<->MAC DMA FIFO flush
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.
-
ulikoehler
- Posts: 71
- Joined: Tue Mar 17, 2015 2:32 am
- Been thanked: 3 times
Re: DP83848<->MAC DMA FIFO flush
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):
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
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 0x20005C90When 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