Skip to main content
sasha
Associate III
February 10, 2017
Solved

How to receive variable length I2C messages?

  • February 10, 2017
  • 1 reply
  • 1021 views
Posted on February 10, 2017 at 07:20

Hello, I'm trying to write an I2C slave using HAL which can accept variable length packet sizes.  I know this question has been asked before but haven't seen any solutions yet! 

The master can send data packets of variable length - all the HAL I2C methods seem to need a 'length' parameter. 

Has anyone found a solution to this?

#i2c #hal
This topic has been closed for replies.
Best answer by Nesrine M_O
Posted on February 10, 2017 at 10:28

Hi

Marks.Sasha

,

Could you please have a look to these examples under the STM32L4 firmware package :

  • STM32Cube_FW_L4_V1.6.0\Projects\STM32L476G_EVAL\Examples\I2C\I2C_TwoBoards_RestartAdvComIT
  • STM32Cube_FW_L4_V1.6.0\Projects\STM32L476G_EVAL\Examples\I2C\I2C_TwoBoards_RestartComIT

-Nesrine-

1 reply

Nesrine M_O
Nesrine M_OBest answer
Associate
February 10, 2017
Posted on February 10, 2017 at 10:28

Hi

Marks.Sasha

,

Could you please have a look to these examples under the STM32L4 firmware package :

  • STM32Cube_FW_L4_V1.6.0\Projects\STM32L476G_EVAL\Examples\I2C\I2C_TwoBoards_RestartAdvComIT
  • STM32Cube_FW_L4_V1.6.0\Projects\STM32L476G_EVAL\Examples\I2C\I2C_TwoBoards_RestartComIT

-Nesrine-