Skip to main content
Visitor II
June 28, 2020
Solved

How to support I2C burst write/read?

  • June 28, 2020
  • 3 replies
  • 6657 views

I wish to configure my STM32 MCU (STM32G071RB) as an I2C slave device, and support I2C burst-write and I2C burst-read, in a similar manner to many I2C slave devices:

0693W000001reYmQAI.png

(usually the RA value is incremented after every DATA byte)

The I2C receive/transmit functions that are available in the file "stm32g0xx_hal_i2c.c" all require a predetermined buffer size.

Is there a different I2C driver available for supporting burst write/read?

If not, how would you recommend to implement this on the MCU?

    This topic has been closed for replies.
    Best answer by Yiftah

    Solved.

    Took me a while to figure it out, but I think I managed to rewrite the "stm32g0xx_hal_i2c.c" file to support the burst functions.

    3 replies

    YiftahAuthorAnswer
    Visitor II
    June 29, 2020

    Solved.

    Took me a while to figure it out, but I think I managed to rewrite the "stm32g0xx_hal_i2c.c" file to support the burst functions.

    Visitor II
    June 9, 2022

    I have the same problem with a stm32 nucleo and an bosch accelerometer. I need to do a burst write in a register but i can't do it with the HAL_I2C_Mem_Write function. Can you give me some information about your solution ?

    YiftahAuthor
    Visitor II
    June 12, 2022

    Hi JDaup.1,

    It doesn't sound like the same problem.

    Is your Nucleo configured as an I2C slave device?

    Best regards,

    Yiftah

    Visitor II
    June 13, 2022

    Hi Yiftah

    Thank you for your answer. In fact this is not exactly the same problem because my nucleo is the master and the accelerometer is the slave. I need to do a burst write in an accelerometer register in order to configure some features. How do you manage to do a burst write just by re-write some HAL functions ?

    Best regards.

    Visitor II
    June 30, 2023

    Hi JDaup.1,
    I am currently experiencing a similar problem. Have you managed to discover a solution for it?