cancel
Showing results for 
Search instead for 
Did you mean: 

How to support I2C burst write/read?

Yiftah
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Yiftah
Associate II

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.

View solution in original post

5 REPLIES 5
Yiftah
Associate II

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
Associate

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 ?

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
Associate

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.

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