cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4A6 I2C3 Slave Mode - Bus Stuck Low When Connected to Raspberry Pi CM4 Master

Vaishak-hoomanely
Associate II

I am trying to configure the STM32L4A6 to act as an I2C slave on its I2C3 peripheral (PB4 - SDA, PC0 - SCL) with 7-bit addressing (address 0x42). The master is a Raspberry Pi CM4 configured on a software-defined I2C bus (i2c5, using GPIO10/11).

Both devices are connected through a TXS0102 level shifter, with proper pull-up resistors (2.2kΩ to 3.3V and 1.8V on both sides).

  • When the CM4 is scanned without the STM32 connected, the I2C bus is idle (~3.16V) and normal clock signals are observed during i2cdetect -y 5.

  • When only the STM32 board is powered but not connected to CM4, the PB4 and PC0 lines are idle at ~3.16V as expected.

  • When both CM4 and STM32 are connected together on the bus:

    • The bus voltage drops to ~960mV.

    • No clock signal is seen during i2cdetect from the CM4 side.

    • Bus appears stuck low.

STM32 firmware setup:

  • I2C3 is initialized with HAL_I2C_Init()

  • Slave address is set correctly (0x42, 7-bit)

  • HAL_I2C_EnableListen_IT() is called

  • Interrupt callbacks (HAL_I2C_AddrCallback, HAL_I2C_ListenCpltCallback) are implemented 

When both devices are connected, the I2C bus gets pulled low and no communication can occur.

There is no problem when CM4 is communicating with other I2C sensors separately, suggesting the issue lies on the STM32 side or the interface.
Thank you for any help or suggestions!

0 REPLIES 0