I2C: allow static redefinition of I2C buffer size #853
Note: this is internal I2C buffer size. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
8000
Note: this is internal I2C buffer size. |
Summary
I2C: allow static redefinition of I2C buffer size.
Default buffer size is still 32, but it is now possible to redefine compilation switch: I2C_TXRX_BUFFER_SIZE
It's maximum value is 255
Now it is possible to transfer up to 255 bytes for all following cases:
Warning: a bug in STM32 cube HAL currently prevents, in Master mode, to send/receive exactly 255 bytes.
Issue is tracked internally, and fix should come in later release.
Nevertheless, if required, it is possible to patch the STM32 cube HAL:
for example, when working on NUCLEO_L476RG in file stm32l4xx_hal_i2c.c (adapt file name to the STM32 familly you are working on), replace all occurrences of
if (hi2c->XferCount < MAX_NBYTE_SIZE)
by
if (hi2c->XferCount <= MAX_NBYTE_SIZE)