Skip to main content
Noyb
Associate III
March 23, 2016
Question

STM32L4 SPI UART __IO divergence ?

  • March 23, 2016
  • 3 replies
  • 744 views
Posted on March 23, 2016 at 09:58

stm32l4xx_hal_spi.h

  HAL_SPI_StateTypeDef    State;          /* SPI communication state        */

  uint32_t                ErrorCode;      /* SPI Error code                 */

stm32l4xx_hal_uart.h

  __IO HAL_UART_StateTypeDef    State;       /*!< UART communication state           */

  __IO uint32_t             ErrorCode;       /*!< UART Error code                    */

Why it is __IO in UART and not in SPI ?
    This topic has been closed for replies.

    3 replies

    Amel NASRI
    Technical Moderator
    March 25, 2016
    Posted on March 25, 2016 at 15:04

    Hi Noyb,

    Your question is noted to investigate the reason behind the missing ''__IO'' for SPI.

    I will keep you informed if I get more details.

    However I would like to know if you faced any particular issue that leads you to make the update by your self? Or it is just a comment based on code comparison?

    -Mayla-

    To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
    Noyb
    NoybAuthor
    Associate III
    March 29, 2016
    Posted on March 29, 2016 at 09:40

    Hi Mayla,

    the reasons are a little bit from both :

    1- issue with the SPI I encountered here : https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32%20SPI%20DMA%20FIFO%20not%20writing%20into%20or%20corrupting%20memory

    2- while coding a little serial port framework above HAL, I read the library code to understand how the DMA synchronization was performed on SPI and USART, which lead me to compare structure definitions and find the divergence

    Amel NASRI
    Technical Moderator
    June 29, 2016
    Posted on June 29, 2016 at 14:53

    HiNoyb,

    Sorry for this delayed update. I checked in the last version of STM32CubeL4 (V1.5.0), we have the following:

    __IO HAL_SPI_StateTypeDef State; 
    /*!< SPI communication state */
    __IO uint32_t ErrorCode; 
    /*!< SPI Error code */

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