2024-11-13 09:46 PM
SD Card (SPI1):
CS: PA5
MISO: PA6
MOSI: PA7
CK: PA1
Temperature Sensor (I2C1):
SDA: PB7
SCL: PB6
When using both SPI1 and I2C1 peripherals simultaneously with the above pin configuration, the SPI communication fails to work properly. Interestingly, when commenting out the I2C initialization, the SPI communication functions correctly.
I resolved the issue by remapping the pins as follows:
Modified Pins:
SPI1_MOSI: Changed to PB5
I2C1_SDA: Changed to PA10
I2C1_SCL: Changed to PA9
After this remapping, both peripherals work correctly together.
This pin conflict might be worth documenting in the board's errata, as the original configuration leads to unexpected behavior when using these common peripherals together.
Has anyone else encountered similar issues with this board when using SPI1 and I2C1 simultaneously?
2024-11-18 01:11 AM
STM32F1 was the first STM32 product and it has a different way to remap pins compared to other STM32 products. I don't think that the same limitation applies for both products: STM32F1 and STM32L4
Regards,
ELABI.1
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-11-18 01:33 AM
When you enable the I2C, do you only activate the clock or do you also add the pin configuration? Does it work when you change the I2C pins?
Can you please share your code with me so that I can better help you?
Regards,
ELABI.1
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.