Skip to main content
Graduate II
November 18, 2024
Solved

SPI Syntax Error From Generated code

  • November 18, 2024
  • 1 reply
  • 650 views

I am using the Nucleo-H743ZI, with a SPI ISR I wrote originally on the STM32H7B3I-DK board. However, when I use

volatile uint8_t rxBuffer;
volatile uint8_t txBuffer;

*((__IO uint8_t *)&hspi->Instance->TXDR) = txBuffer;
//or 
 rxBuffer = *((__IO uint8_t *)&hspi->Instance->RXDR);


I get a syntax error on the Nulceo. I checked the stm32h7xx_hal.c file and they use these two lines for the default SPI handler. I have stm32h7xx_hal.h included, but still have a syntax error... wondering if anyone knows what may be going wrong. 

I'm not sure why there is no error on my STM32H7B3I-DK board, but there is on the Nucleo.

    This topic has been closed for replies.
    Best answer by EthanMankins

    I am using CubeIDE, the thing is that it doesn't show up in the Problems or console log. It just underlines yellow and has the yellow question mark... i found somewhere else in my code that required me to add "-u _scanf_float" to my G++ linker and now there is no longer an errror...

    1 reply

    Super User
    November 18, 2024

    @EthanMankins wrote:

    I get a syntax error on the Nulceo


    You mean you get a syntax error from the compiler, surely?

    Post the actual error.

    You haven't said what IDE/compiler you're using, but if it's STM32CubeIDE, copy & paste the text (not a screenshot) from the 'Console' window.

    EthanMankinsAuthorAnswer
    Graduate II
    November 18, 2024

    I am using CubeIDE, the thing is that it doesn't show up in the Problems or console log. It just underlines yellow and has the yellow question mark... i found somewhere else in my code that required me to add "-u _scanf_float" to my G++ linker and now there is no longer an errror...