I2C stuck when SPI enabled
Hello, I have the following problem:
I have a I2C communication routine that takes about 2ms to be executed.
After I do the first read/write operation on a SPI peripheral, the same routine takes250ms the first time, than it stops working becaus isDeviceBusy always fails.
If I call __HAL_SPI_DISABLE(&hspi) after using SPI, the I2C routine starts working again as before (takes 2ms again and isDeviceBusy does not fail).
So, summarizing:
init_all()
i2c_routine() // Takes 2ms
spi_routine() //
i2c_routine() // Takes 250ms
i2c_routine() // Stucks�?�?�?�?�?�?�?�?�?�?
init_all()
i2c_routine() // Takes 2ms
i2c_routine() // Takes 2ms
i2c_routine() // Takes 2ms
i2c_routine() // Takes 2ms�?�?�?�?�?
init_all()
i2c_routine() // Takes 2ms
spi_routine()
__HAL_SPI_DISABLE(&hspi)
i2c_routine() // Takes 2ms
i2c_routine() // Takes 2ms�?�?�?�?�?�?�?�?
It seems to be a weird behaviour to me. I've tried a lot of things in the last 2 days, but I cannot understand the cause. May somebody more experienced tell me what's going on? Thank you!
The device isthe STM32 Nucleo for L4 series (STM32L432KCU6). I'm using STM32CubeMX and System Workbench for Stm
I also attach the pin configuration:


