[STM32-E407] DMABMR Software reset never finishes

Started by nafets, September 05, 2015, 05:38:28 AM

Previous topic - Next topic

nafets

Hi,

I am trying to write my own ethernet driver but I am kind of stuck! I hope you guys can help me out.

Here is my code, trying to initialize ethernet:

        // Enabling RMII
RCC.APB2ENR.SYS_CFG = true;
SYSCFG.PMC.MII_RMII_SEL = 0b1;

// Enabling MAC clocks
RCC.AHB1ENR.ETHMAC = true;
RCC.AHB1ENR.ETHMACRX = true;
RCC.AHB1ENR.ETHMACTX = true;

// Enabling GPIO clocks
RCC.AHB1ENR.GPIOA = true;
RCC.AHB1ENR.GPIOB = true;
RCC.AHB1ENR.GPIOC = true;
RCC.AHB1ENR.GPIOE = true;
RCC.AHB1ENR.GPIOG = true;
RCC.AHB1ENR.GPIOH = true;
RCC.AHB1ENR.GPIOI = true;

// reset MAC
RCC.AHB1RST.ETHMAC = true;
RCC.AHB1RST.ETHMAC = false;

// software reset
ETH0.DMABMR.SR = true;
while(ETH0.DMABMR.SR == true) {} // wait until reset is finished

// LED on
GPIO_C.BSRR.BR13 = true;


But the while loop on the end never quits but I have no glue why the software reset doesn't work.

The upper code is the first thing I do in my main.

I am using a STM32-E407 Rev. E (LAN8710 PHY)

Thanks for your help

Best,
Stefan