possible bug on chibios 3 I2C code

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
trunet
Posts: 54
Joined: Fri Apr 06, 2012 7:18 pm

possible bug on chibios 3 I2C code

Post by trunet »

os/hal/ports/STM32/LLD/I2Cv1/i2c_lld.c line 800:

Code: Select all

#if defined(STM32F1XX_I2C)
  osalDbgCheck((rxbytes == 0) || ((rxbytes > 1) && (rxbuf != NULL)));
#endif


is this correct, or I can't transfer 1 byte from I2C?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: possible bug on chibios 3 I2C code

Post by Giovanni »

Hi,

It is a bug in STM32F1 devices, you cannot transfer just one byte using DMA.

Giovanni
User avatar
aGuegu
Posts: 29
Joined: Thu Dec 07, 2017 4:15 am
Has thanked: 1 time
Been thanked: 5 times

Re: possible bug on chibios 3 I2C code

Post by aGuegu »

Took me hours to debug my code ....
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: possible bug on chibios 3 I2C code

Post by Giovanni »

If you are debugging then you should enable assertions, checks and state checker, those kind of things are found immediately.

Giovanni
Post Reply