cancel
Showing results for 
Search instead for 
Did you mean: 

undefined reference to `HAL_SPIEx_SetConfigAutonomousMode'

Marty
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

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".
Thanks
Imen

View solution in original post

1 REPLY 1
Imen.D
ST Employee

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".
Thanks
Imen