Skip to content

nRF52832 Sluggish App - I2C Timeout? #6207

Closed
@AGlass0fMilk

Description

@AGlass0fMilk

Description


Bug

Target
TARBGET_MCU_NRF52832
TARGET_NRF5

Toolchain:
GCC_ARM

I'm experiencing an issue where after some time of running, my application begins to run extremely slowly. Button presses that should take 3 seconds take 20 seconds to register.

I believe I narrowed this issue down to a few lines of code in the i2c_api.c here:

// An arbitrary value used as the timeout in loops waiting for given event
// (e.g. STOPPED), needed to avoid infinite loops.
// This value might be defined externally.
#ifndef I2C_TIMEOUT_VALUE_US
#define I2C_TIMEOUT_VALUE_US 1000000
#endif

This was updated in pull request #5187

When the issue happens, a logic analyzer shows the I2C transactions having 1 second delays between them. Since my application uses blocking I2C reads, this slows that thread down dramatically, sometimes causing watchdog resets.

Can anyone elaborate what would cause this I2C to get stuck in a timeout like this? And why is the default timeout 1 second? That seems extremely long for any real time system.

Related question:
https://os.mbed.com/questions/80258/App-Slowdown/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions