Skip to main content
Associate
December 1, 2024
Solved

undefined reference to `HAL_SPIEx_SetConfigAutonomousMode'

  • December 1, 2024
  • 1 reply
  • 784 views

I'm trying to access the external flash on a B-U585I-IOT02A.  The driver(s) I found do:

if (HAL_SPIEx_SetConfigAutonomousMode(&hspi2, &HAL_SPI_AutonomousMode_Cfg_Struct) != HAL_OK)

but the linker says that function is undefined.  Is that in a library file I haven't included (and haven't located to include it)?

-Marty

Best answer by Imen.D

Hello @Marty ,

Ensure that the HAL library source code file path is defined In project settings -> C/C++ General -> Paths and Symbols -> Source Location.

So, check your Library paths in your project settings and try to add the missing files into the src and inc folders.

Ensure that stm32u5xx_hal_spi.c is included in your project and is being compiled.

Make sure to have #define HAL_SPI_MODULE_ENABLED inside stm32u5xx_hal_conf.h file.

1 reply

Imen.DBest answer
Technical Moderator
December 1, 2024

Hello @Marty ,

Ensure that the HAL library source code file path is defined In project settings -> C/C++ General -> Paths and Symbols -> Source Location.

So, check your Library paths in your project settings and try to add the missing files into the src and inc folders.

Ensure that stm32u5xx_hal_spi.c is included in your project and is being compiled.

Make sure to have #define HAL_SPI_MODULE_ENABLED inside stm32u5xx_hal_conf.h file.

"When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"