Skip to main content
Handzic.Dirk
Associate III
May 9, 2018
Question

STM32H743 SPI1 not working

  • May 9, 2018
  • 4 replies
  • 1381 views
Posted on May 09, 2018 at 08:21

Hi,

I have designed a STM32H743II  board and now I am testing hardware functionality. I have a serial FLASH connected to SPI5 which works fine. I have a serial EEPROM connected to SPI1 where I can not see any activity on the lines at all. I am using the CubeMX generated MX_SPI1_Init() function and I have checked the SPI1 and GPIO registers to be set ok with a SWD debugger. Peripheral clocks seem to work since the register values change. There is just no activity at the I/O pins when I check with an oscilloscope. There are no shorts on these lines (checked with multimeter). Also tested using I/O toggling SCK, MOSI, MISO and it will work so nothing wrong with the pcb or I/O ports.

Any suggestions are appreciated.

Regards

Dirk

    This topic has been closed for replies.

    4 replies

    waclawek.jan
    Super User
    May 9, 2018
    Posted on May 09, 2018 at 08:50

    Re-check the SPI registers' content, or post it here.

    Try to set these pins as GPIO outputs and wiggle them manually through GPIO.

    Try the SPI on other pins on the GPIO matrix using the same SPI.

    You can do all this in the debugger, without writing a single line of code.

    JW

    Handzic.Dirk
    Associate III
    May 9, 2018
    Posted on May 09, 2018 at 09:58

    Ok, I have found the problem and the solution:

    I had selected PLL2 output P as clock source for SPI1. In HAL_RCCEx_PeriphCLKConfig() __HAL_RCC_PLL2CLKOUT_ENABLE(RCC_PLL2_DIVP); is called but using the debugger I found that DIVP2EN in RCC_PLLCFGR will NOT be set. This bit seems to be stuck at '0'!! *(__IO uint32_t *) 0x5802442C |= 0x00080000; will not set it according to the debugger register readout either.

    For now I select PLL3 output P as the clock source and SPI1 is working

    Best regards

    Dirk

    Nawres GHARBI
    Technical Moderator
    May 16, 2018
    Posted on May 16, 2018 at 17:53

    Hi

    Handzic.Dirk

    Is there any other peripheral using the PLL2 ?

    Handzic.Dirk
    Associate III
    May 16, 2018
    Posted on May 16, 2018 at 18:54

    Well, initially ADC used PLL2 too and did not work either. The only way to get it working has been to use PCLK. PLL3 does not work as clocksource either. All configurations taken directly from CubeMX generated code latest versions of everything.

    Regards

    Dirk

    Skickat från min iPhone

    16 maj 2018 kl. 18:28 skrev Nawres GHARBI <st-microelectronics@jiveon.com>:

    STMicroelectronics Community

    Re: STM32H743 SPI1 not working

    reply from Nawres GHARBI in STM32 MCUs Forum - View the full discussion

    Hi handzic.dirk

    Is there any other peripheral using the PLL2 ?

    Reply to this message by replying to this email, or go to the message on STMicroelectronics Community

    Start a new discussion in STM32 MCUs Forum by email or at STMicroelectronics Community

    Following Re: STM32H743 SPI1 not working in these streams: Inbox

    This email was sent by STMicroelectronics Community because you are a registered user.

    You may unsubscribe instantly from STMicroelectronics Community, or adjust email frequency in your email preferences

    >

    Amel NASRI
    Technical Moderator
    July 5, 2018
    Posted on July 05, 2018 at 16:46

    Hello,

    There is a bug in RCC driver already confirmed and a patch is provided in

    https://community.st.com/0D50X00009XkZJxSAN

    .

    -Amel

    To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
    Amel NASRI
    Technical Moderator
    July 26, 2018

    Hello,

    Please note that a fix is deployed in current version (1.3.0) of STM32CubeH7 and applied for RCC driver.

    -Amel

    To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.