Skip to content

Conversation

@multiplemonomials
Copy link
Collaborator

@multiplemonomials multiplemonomials commented May 7, 2025

Summary of changes

I am working on testing the M480 board using our CI Test Shield, which can do exhaustive tests of things like I2C, SPI, and PWM to ensure that they are implemented correctly. These tests are much more in-depth than the tests that ARM's CI shield did, and should be able to root out a great deal more issues.

First step was testing I2C, and the M480 was actually VERY close to passing all the tests -- I'm impressed, few boards I've tested have worked this well out of the box!

However, I did find two small issues in the I2C implementation that should be addressed:

  • When doing a read with the asynchronous API, the MCU sends a repeated start at the end of the transaction instead of a stop
  • When doing a slave receive, the last byte gets NACKed by the slave, which is not supposed to happen

I was able to fix these by making some tweaks to the I2C code, and now all tests pass!

Impact of changes

  • M480: I2C async reads no longer do a repeated start at the end
  • M480: I2C slave receive no longer sends a NACK when it reaches the expected byte count
  • Add ARDUINO_UNO form factor for M480 (this is required for the test shield to run)

Migration actions required

Documentation

None


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)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

Test shield I2C tests pass!

The following tests passed:
        test-testshield-i2c-basic
        test-testshield-i2c-slave-comms
        test-testshield-i2c-eeprom

100% tests passed, 0 tests failed out of 3

@multiplemonomials multiplemonomials requested a review from ccli8 May 7, 2025 15:55
@multiplemonomials multiplemonomials requested a review from ccli8 May 14, 2025 16:42
@multiplemonomials multiplemonomials merged commit 6702976 into master May 15, 2025
52 checks passed
@multiplemonomials multiplemonomials deleted the dev/nuvoton-m480-i2c-fixes branch May 15, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants