Skip to content

Conversation

@anangl
Copy link
Member

@anangl anangl commented Jul 26, 2019

Make use of the new flag introduced in nrfx v1.7.2 that suspends
transfers, in order to properly handle scattered I2C transactions,
especially to perform i2c_burst_write() in the way expected by
display drivers, i.e. as a continuous transaction on the bus,
without the repeated START between its two parts.

Fixes #15116 (although the issue mentions the TWIM peripheral, on which the hardware limitation prevents the issue from being solved, on all SoCs of nRF52 Series TWI can be used instead of TWIM).

@carlescufi carlescufi requested a review from pabigot July 26, 2019 13:24
@anangl anangl added area: I2C bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx labels Jul 26, 2019
@ioannisg
Copy link
Member

@pabigot please, take a look at this bug-fix PR

Copy link
Contributor

@pabigot pabigot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd discussed this back in the time of #11612, and the group consensus was the API is poorly defined and needs to be fixed at that level. Support for multi-element I2C transactions and the precise behavioral implication of flags like I2C_MSG_RESTART are unclear, so even if this does work for Nordic there's no reason to believe the underlying construct will function on other systems.

I don't know what nrfx does with those flags (in my work I control the peripheral directly) and don't have time to investigate or experiment so can't comment on whether the solution fixes this for Nordic. As such I can't explicitly approve it, but I have no objections to this being merged if it helps people get things done and it doesn't break any existing use.

Copy link
Member

@ioannisg ioannisg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Make use of the new flag introduced in nrfx v1.7.2 that suspends
transfers, in order to properly handle scattered I2C transactions,
especially to perform i2c_burst_write() in the way expected by
display drivers, i.e. as a continuous transaction on the bus,
without the repeated START between its two parts.

Signed-off-by: Andrzej Głąbek <[email protected]>
@anangl anangl force-pushed the nrfx_twi_i2c_burst_write branch from 9f81381 to aca8b70 Compare July 29, 2019 06:12
@ioannisg ioannisg requested a review from pizi-nordic July 29, 2019 07:38
@carlescufi carlescufi merged commit e6fe542 into zephyrproject-rtos:master Jul 29, 2019
@anangl anangl deleted the nrfx_twi_i2c_burst_write branch September 4, 2019 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: I2C bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nrfx_twim: (nRF52) driver unable to perform i2c_burst_write() correctly

5 participants