Skip to content

Conversation

boomer41
Copy link
Contributor

@boomer41 boomer41 commented Feb 7, 2020

Summary of changes

When reading a data block, the returned error codes from the I2C subsystem
are different from normal single byte operations. We have to verify that
the read-function for multiple bytes does return zero, because it
returns "readBytes != expectedLength".

Additionally, sync before trying to read from the eeprom as slow devices
may not yet be ready to return data, especially with low-priced ones used
with fast controllers.

Documentation

No update needed.


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

When reading a data block, the returned error codes from the I2C subsystem
are different from normal single byte operations. We have to verify that
the read-function for multiple bytes does return zero, because it
returns "readBytes != expectedLength".

Additionally, sync before trying to read from the eeprom as slow devices
may not yet be ready to return data, especially with low-priced ones
used with fast controllers.
@ciarmcom
Copy link
Member

ciarmcom commented Feb 7, 2020

@boomer41, thank you for your changes.
@ARMmbed/mbed-os-storage @ARMmbed/mbed-os-maintainers please review.

@ciarmcom ciarmcom requested review from a team February 7, 2020 22:00
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 10, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 10, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 added the release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 label Feb 10, 2020
@0xc0170 0xc0170 merged commit 8c51f4f into ARMmbed:master Feb 10, 2020
@0xc0170 0xc0170 changed the title Fix I2CEEBlockdevice I2CEEBlockdevice: fix i2c read return value Feb 10, 2020
@mergify mergify bot removed the ready for merge label Feb 10, 2020
@boomer41 boomer41 deleted the fix-i2ceepromblockdevice branch February 10, 2020 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants