Skip to content

Conversation

@multiplemonomials
Copy link
Collaborator

@multiplemonomials multiplemonomials commented Apr 24, 2025

Summary of changes

This PR fixes some bugs that were causing the I2C slave test to fail when running on STM32U0:

  • Calling I2CSlave::frequency() after constructing the object would wipe out the I2C address in the registers, causing the I2C slave to not respond to any messages on the bus
  • The slave read operation would erroneously return an error (0 bytes) if the master transferred less bytes than expected by the slave, instead of returning the actual number of bytes transferred.

This PR also enables I2C on U0 now that we've tested it with the test shield.

Impact of changes

  • I2C master and slave now supported for STM32U0
  • I2C slave bugs fixes as above

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

All I2C tests pass on STM32U0 except for some known I2C master failures with the single byte API.

@multiplemonomials multiplemonomials changed the title Draft: STM32U0 fixes from test shield testing Fix I2C slave test on STM32 May 2, 2025
@multiplemonomials multiplemonomials merged commit 924e44b into master May 3, 2025
52 checks passed
@multiplemonomials multiplemonomials deleted the dev/stm32u0-testshield-testing-fixes branch May 3, 2025 21:58
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