Skip to main content
Visitor II
July 25, 2023
Question

Trying to generate SPI HAL in STM32Cube for NUCLEO-G431KBT

  • July 25, 2023
  • 2 replies
  • 815 views

Hi,

I'm trying to initiate an SPI interface through the MX view. When i'm saving and building the code from the .ioc file i only see INIT for GPIO and USART, none for SPI. Am i doing something wrong here? As i understand Cube should setup the HAL SPI automatically, is it something i'm missing?

See attached .ioc file

Thank you!

    This topic has been closed for replies.

    2 replies

    TDK
    July 25, 2023

    Yes, it should have an MX_SPI_Init call. Your post doesn't have an IOC file attached. Make sure you regenerate the code after adding SPI.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    KDJEM.1
    Technical Moderator
    July 31, 2023

    Hello @WilliamT and welcome to the Community :),

    Which STM32CubeMX version are you using?

    Could you please share the .ioc file?

    I made some tests with Nucleo-G431KB by using STM32CubeMX6.9.0 version and I don't found any issue.

    When the code is generated, the MX_SPI1_Init(); is called automatically.

    Thank you.

    Kaouthar

    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.