Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#4592 closed defect (fixed)

BSP/Atsam: I2C driver doesn't return errors on NACK

Reported by: Christian Mauderer Owned by: Christian Mauderer
Priority: normal Milestone:
Component: bsps Version: 6
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

Cloned from #4591:


At the moment the I2C driver of the ATSAM doesn't return an error if a message is not acknowledged by the I2C device. The expected behavior would be to return a EIO.

Change History (4)

comment:1 Changed on 02/08/22 at 09:56:41 by Christian Mauderer

Summary: BSP/Atsam: I2C driver doesn't return errors on NACK (cloned)BSP/Atsam: I2C driver doesn't return errors on NACK

comment:2 Changed on 02/08/22 at 09:57:02 by Christian Mauderer

Owner: set to Christian Mauderer
Status: newaccepted

comment:3 Changed on 02/11/22 at 07:37:31 by Christian Mauderer <christian.mauderer@…>

In [changeset:"974d24f8a8018308a1ac202286e486fda2fd8a83/rtems" 974d24f8/rtems]:

bsp/atsam/i2c: Simplify driver

Do some clean ups. Remove superfluous variables. Eliminate some overly
complex logic (information about transfer and remaining bytes has been
tracked redundantly in multiple variables).

This patch doesn't change the behavior of the driver.

Update #4592

comment:4 Changed on 02/11/22 at 07:37:34 by Christian Mauderer <christian.mauderer@…>

Resolution: fixed
Status: acceptedclosed

In [changeset:"0074c9ecf3fafcceaf8a84d60304153cec7eed68/rtems" 0074c9ec/rtems]:

bsp/atsam/i2c: Add error return and fix edge cases

The driver didn't return with an error on (for example) a NACK on the
bus. This adds the expected error return. Due to the new case that a
transfer can be interrupted on an error, there were some new edge cases.
This patch therefore also fixes these edge cases by removing the
transfer_state that more or less duplicated the interrupt states.

Fixes #4592

Note: See TracTickets for help on using tickets.