-
Notifications
You must be signed in to change notification settings - Fork 3k
STM32: Remove i2c_read() and i2c_write() redirects to HAL_I2C_IsDeviceReady() #4717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…eReady() Some I2C devices require specific zero length read/write sequences which the HAL_I2C_IsDeviceReady() redirect interferes with. After Removing these redirects, it was confirmed that zero length reads and writes would both still work correctly for detecting presence/absence of an I2C device on a bus.
@LMESTM |
@monkiineko thx - I'll and start tests, hopefully tomorrow |
Travis failure is :
|
Closing and reopening to re-trigger travis to see if this was just a weird timing error on the machine. |
@monkiineko I'm busy with other things, but I asked @jeromecoutant to do the testing - he'll report the results |
Yes, I have ran tests this morning for each STM32 family:
|
@LMESTM @jeromecoutant |
@monkiineko I've also used a logic analyzer and have verified the behavior is as expected, on NUCLEO_F446RE (I2C_IP_VERSION_V1) and NUCLEO_L476RG (I2C_IP_VERSION_V2). So I'll approve the PR. |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild Prep failed! |
Git checkout timed out
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
Failure not related /morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
Description
Some I2C devices require specific zero length read/write sequences which
the HAL_I2C_IsDeviceReady() redirect interferes with. After Removing
these redirects, it was confirmed that zero length reads and writes
would both still work correctly for detecting presence/absence of an
I2C device on a bus.
Status
READY
Migrations
NO
Todos
Run I2C CI tests on all STM32 targets to confirm no regressions
Steps to test or reproduce
Build an STM32 based target image with an instantiated I2C bus and use an oscilloscope or I2C bus analyzer to confirm that both an I2C read without data and an I2C write without data can be generated, and the expected results returned, using code such as:
#include <mbed.h>
...
I2C testI2c(PA_10, PA_9);
printf("Write to 0x54 = %d\r\n", testI2c.write(0x54, 0, 0)); // Non-existent I2C device (expect 1 result)
printf("Write to 0xA0 = %d\r\n", testI2c.write(0xA0, 0, 0)); // EEPROM (expect 0 result)
printf("Read from 0x54 = %d\r\n", testI2c.read(0x54, 0, 0)); // Non-existent I2C device (expect 1 result)
printf("Read from 0xA0 = %d\r\n", testI2c.read(0xA0, 0, 0)); // EEPROM (expect 0 result)