Skip to main content
Explorer
August 22, 2025
Solved

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

  • August 22, 2025
  • 3 replies
  • 347 views

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

 

    This topic has been closed for replies.
    Best answer by STTwo-32

    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

    3 replies

    Technical Moderator
    August 22, 2025

    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

    StreamerAuthor
    Explorer
    August 22, 2025

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

    StreamerAuthor
    Explorer
    August 22, 2025

    Streamer_0-1755852689512.png

     

    StreamerAuthor
    Explorer
    August 22, 2025

    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-32Answer
    Technical Moderator
    August 22, 2025

    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

    StreamerAuthor
    Explorer
    August 22, 2025

    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