diff --git a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_spi.c b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_spi.c index 6c717518292..9f40ce1ff8e 100644 --- a/boards/arm/stm32l4/nucleo-l432kc/src/stm32_spi.c +++ b/boards/arm/stm32l4/nucleo-l432kc/src/stm32_spi.c @@ -30,6 +30,7 @@ #include #include +#include #include #include "chip.h" @@ -78,6 +79,13 @@ void stm32l4_spiinitialize(void) else { spiinfo("INFO: SPI port 1 initialized\n"); +#ifdef CONFIG_SPI_DRIVER + ret = spi_register(g_spi1, 1); + if (ret < 0) + { + spierr("ERROR: FAILED to register driver of SPI port 1\n"); + } +#endif } /* Setup CS, EN & IRQ line IOs */ @@ -98,6 +106,13 @@ void stm32l4_spiinitialize(void) else { spiinfo("INFO: SPI port 2 initialized\n"); +#ifdef CONFIG_SPI_DRIVER + ret = spi_register(g_spi2, 2); + if (ret < 0) + { + spierr("ERROR: FAILED to register driver of SPI port 2\n"); + } +#endif } /* Setup CS, EN & IRQ line IOs */