STM32F401 as I2C Slave Mode? Speed?
- March 31, 2026
- 2 replies
- 379 views
Hello Forum,
I want to use a Nucleo 64 STM32F401 Board to test I2C connection with an unknown master (reverse engineering).
The Bus consits of 1 Master (unknown Controller) an 1 Slave (My STM32F40). The Master sends out a Read Request at Addr. 5 and the Slave should respond with 3 Bytes. I've connected the I2C Bus to PB6/PB7 of the Nucleo Board.
On Softwareside I Initialized with bare metal Code, see attachment.
I my setup a I2C Master sends out a Adress byte with read request to address 5, but my Controller doesn't do a thing at all. I would expect at least an ACK Bit, but nothing can be monitored.

From the Signal capture the bus looks fine for me, but in which mode do I need to configure the stm32 slave? Is this standard mode or fast mode. Is the clock speed of any concern in this case (slave)? How to config the CCR and TRISE register in this case.
The Port seems to be configured correct, the IDR of GPIOB detects a "1" on PB6/PB7.
In my example I've also enabled interrupts, but no interrupt occurs, nor also a main loop check of the RXNE register shows any activity. Also swapping Pins to PB8/PB9 didn't change anything. Setup is attached.
Does someone has any hint to bring up the slave mode or to check even liveness of the I2C of the STM32 Controller?
regards, Lorenz
