Skip to content

twi_readFrom() does not proerly handle timeout #586

Closed
@Ztirom45

Description

@Ztirom45

My program freezes randomly. After debugging I found out this:

gdb output:

Program received signal SIGINT, Interrupt.
0x00001ad8 in twi_readFrom (address=address@entry=104 'h', 
    data=0x8009d0 <TwoWire::rxBuffer> <incomplete sequence \302>, 
    length=length@entry=1 '\001', sendStop=sendStop@entry=1 '\001')
    at /home/moritz/.platformio/packages/framework-arduino-avr/libraries/Wire/src/utility/twi.c:219
219         if((twi_timeout_us > 0ul) && ((micros() - startMicros) > twi_timeout_us)) {
(gdb) print twi_timeout_us
$1 = 0
(gdb) print startMicros
$2 = 763126656

using:
Adafruit_ADXL345_U.h: Adafruit_MPU6050.getEvent()

I am not sure how the timeout handling should work, but I don't think that it should freeze.

Activity

matthijskooijman

matthijskooijman commented on Dec 30, 2024

@matthijskooijman
Collaborator
Ztirom45

Ztirom45 commented on Dec 30, 2024

@Ztirom45
Author

Thank you for your quick reply.
No, I think Adafruit_ADXL345_U and the underlying Adafruit BusIO don't use setWireTimeout. I will ask there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      twi_readFrom() does not proerly handle timeout · Issue #586 · arduino/ArduinoCore-avr