Skip to main content
B Zikhali
Associate III
June 30, 2017
Solved

Implementing Repeated Start on an STM32 F0 I2C Slave

  • June 30, 2017
  • 1 reply
  • 1403 views
Posted on June 30, 2017 at 15:12

I'm currently working on a driver on an STM32F0 that joins the I2C bus as a slave device. Currently there is no mention in the reference manual on how to handle a Repeated Start Condition, does anyone know how to?

I am currently handling the I2C request in the AddressCallback and am able to make it work when all the frames are terminated by a Stop Condition but when I try to detect a Repeated Start using the NACK flag

(From RM: The bit is set by software, cleared by hardware when the NACK is sent, or when a STOP condition or an Address Matched is received, or when PE=0.), the ADDR flag of the I2C is never set meaning the ISR is never called again. Clock stretching is also enabled.

#f0 #stm32f0 #stm32 #i2c
This topic has been closed for replies.
Best answer by Nesrine M_O
Posted on June 30, 2017 at 15:23

Hi

Zikhali.Bongani

,

I recommend you to have a look to I2C example under the STM32L4 firmware package it may help you to start :

STM32Cube_FW_L4_V1.8.0\Projects\STM32L496ZG-Nucleo\Examples\I2C\I2C_TwoBoards_RestartComIT

This example describes how to perform a single I2C data buffer transmission/reception between two boards in Interrupt mode and with a restart condition.

-Nesrine-

1 reply

Nesrine M_O
Nesrine M_OBest answer
Associate
June 30, 2017
Posted on June 30, 2017 at 15:23

Hi

Zikhali.Bongani

,

I recommend you to have a look to I2C example under the STM32L4 firmware package it may help you to start :

STM32Cube_FW_L4_V1.8.0\Projects\STM32L496ZG-Nucleo\Examples\I2C\I2C_TwoBoards_RestartComIT

This example describes how to perform a single I2C data buffer transmission/reception between two boards in Interrupt mode and with a restart condition.

-Nesrine-