cancel
Showing results for 
Search instead for 
Did you mean: 

Why can't I activate the SPI1 clock register on stm32f302r8t6?

Streamer
Associate II

I write drive layer in MCU which is stm32f302r8t6. But I can't active to enable SPI clock register.

Can you help me with that problem?

Maybe you ask me that write in main.c as register level.

 

RCC->APB2ENR |= 0x0800;

Actually I opened SFR and tried to enable SPI clock register but I can't.  

 

Streamer_0-1755851266305.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Sorry for this mistake. the SPI1EN is available only on the STM32F302xB/C devices only (According to the RM0365:(

STTwo32_0-1755852991278.png

So, SPI1 is not available for the stm32f302r8t6 (only SPI2 and 3).

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
STTwo-32
ST Employee

Hello @Streamer 

To activate the SP1 clock register, you have to write: 

RCC->APB2ENR |= 0x1000;

since the SPI1EN is the bit number 12.

 

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I did write 0x1000. But it is not change. if you look picture you can see what I made

Streamer
Associate II

Streamer_0-1755852689512.png

 

If you look picture. SPI2 and SPI3 is enable but SPI1 isn't still enabled. maybe it has protect? or it is not true hardware

 

Streamer_1-1755852866412.png

 

STTwo-32
ST Employee

Sorry for this mistake. the SPI1EN is available only on the STM32F302xB/C devices only (According to the RM0365:(

STTwo32_0-1755852991278.png

So, SPI1 is not available for the stm32f302r8t6 (only SPI2 and 3).

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you very much. I only want you remove SFR segment. 

How will be it? What do u think with that? 

Streamer_0-1755856715360.png

Because my select is stm32f302r8t6