Skip to content

I2C SDA line stuck low after requestFrom with more than 1 byte - No I2C Stop sequence generated #2064

@yec23

Description

@yec23

Describe the bug
I2C SDA line stuck low after requestFrom with more than 1 byte. Master seems to not generate the I2C Stop sequence.
Same result in normal or fast mode.
Working ok when requesting 1 byte
Same hardware and code run well when compiled with Roger Clark environment on Arduino IDE 1.8 Linux.

To Reproduce

  • Wire.requestFrom with two bytes or more return ok but SDA remains low. Adding stop parameter (true) has same behaviour (argument defaulted to true)
  • I2C Registers after begin() and before requestFrom() call:
    CR1: 1
    CR2: 0x24
    SR1: 0
    SR2: 0
    After requestFrom() call:
    CR1: 0xA01 => POS and STOP set
    CR2: 0x424 => ITBUFEN set
    SR1: 0x240 => ARLO and RxNE set
    SR2: 2 => BUSY set
  • Successive requestFrom then end in error.
  • Only a end() and begin() resume I2C state.

Steps to reproduce the behaviour:
see code attached
Sourcecode.txt

Screenshots
With Arduino Core STM32: no I2C STOP generated
image

With Roger Clark, I2C STOP generated
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Arduino IDE version: 2.1.0
  • STM32 core version: 2.6.0
  • Tools menu settings if not the default: USB support: CDC (generic serial supersede U(S)Art), U(S)ART support Enable (generic serial)
  • Upload method: SWD

Board (please complete the following information):

  • Name: Blue PillF103CB 128k
  • Extra hardware used if any: MPU-6050 slave

Additional context
First version of the project was implemented with Roger Clarck STM32 environment. Project is being migrated to Arduino Core STM32 before implementing new features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions