cancel
Showing results for 
Search instead for 
Did you mean: 

Can't enable port B & D clocks

vneff
Associate III

I tried the following code in a STM32F107:

RCC->AHBENR = RCC->AHBENR | RCC_APB2ENR_IOPBEN_Msk| RCC_APB2ENR_IOPDEN_Msk;

and

RCC->AHBENR = RCC->AHBENR | 0x00000008 | 0x00000020;

When I display RCC->AHBENR, it always shows 0001C014.

I expected to see 0x0001C03C.

I found this because Ethernet never finished resetting.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

AHB != APB2, different busses

 

RCC->APB2ENR = RCC->APB2ENR | RCC_APB2ENR_IOPBEN_Msk| RCC_APB2ENR_IOPDEN_Msk;

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

5 REPLIES 5
Emre Kiremitci
Associate II

Hello. Could you try this RCC->APB2ENR|=(1<<5)|(1<<3);

Tried RCC->APB2ENR|=(1<<5)|(1<<3);

Still shows 0001C014.

AHB != APB2, different busses

 

RCC->APB2ENR = RCC->APB2ENR | RCC_APB2ENR_IOPBEN_Msk| RCC_APB2ENR_IOPDEN_Msk;

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Sure you're reading RCC->APB2ENR, and not RCC->AHBENR again? Would be odd for them both to read as 0x0001C014

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

My BAD.

I had been checking the Ethernet clocks.

Thanks for pointing out my error.

Unfortunately, I now have no idea why the Ethernet reset is not working. It times out.