2025-08-22 1:28 AM - last edited on 2025-08-22 2:04 AM by mƎALLEm
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.
Solved! Go to Solution.
2025-08-22 1:54 AM - edited 2025-08-22 1:57 AM
Sorry for this mistake. the SPI1EN is available only on the STM32F302xB/C devices only (According to the RM0365:(
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.
2025-08-22 1:42 AM
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.
2025-08-22 1:48 AM
I did write 0x1000. But it is not change. if you look picture you can see what I made
2025-08-22 1:51 AM
2025-08-22 1:54 AM
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
2025-08-22 1:54 AM - edited 2025-08-22 1:57 AM
Sorry for this mistake. the SPI1EN is available only on the STM32F302xB/C devices only (According to the RM0365:(
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.
2025-08-22 2:58 AM
Thank you very much. I only want you remove SFR segment.
How will be it? What do u think with that?
Because my select is stm32f302r8t6