Skip to main content
Yiftah
Associate II
Jun 28, 2020 8:13 AM UTC
Solved

How to support I2C burst write/read?

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.
Yiftah
YiftahBest answer
Associate II
Jun 29, 2020 4:13 AM UTC

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.

5 replies

Yiftah
YiftahAuthorBest answer
Associate II
Jun 29, 2020 4:13 AM UTC

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.

JDaup.1
Visitor II
Jun 9, 2022 3:35 PM UTC

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 ?

Yiftah
YiftahAuthor
Associate II
Jun 12, 2022 5:11 AM UTC

Hi JDaup.1,

It doesn't sound like the same problem.

Is your Nucleo configured as an I2C slave device?

Best regards,

Yiftah

JDaup.1
Visitor II
Jun 13, 2022 7:46 AM UTC

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
Jun 30, 2023 5:03 AM UTC

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