cancel
Showing results for 
Search instead for 
Did you mean: 

How to receive variable length I2C messages?

sasha
Associate III
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
1 ACCEPTED SOLUTION

Accepted Solutions
Nesrine M_O
Lead II
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-

View solution in original post

1 REPLY 1
Nesrine M_O
Lead II
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-