Skip to content
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

A bug in the HAL_I2C_IsDeviceReady function in version 1.11.3 #289

Open
engycz opened this issue May 10, 2024 · 2 comments
Open

A bug in the HAL_I2C_IsDeviceReady function in version 1.11.3 #289

engycz opened this issue May 10, 2024 · 2 comments
Assignees
Labels
bug Something isn't working hal HAL-LL driver-related issue or pull-request. i2c I2C-related issue or pull-request internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system

Comments

@engycz
Copy link
Contributor

engycz commented May 10, 2024

I have found a bug in the HAL_I2C_IsDeviceReady function in version 1.11.3 fec141c.

The problem is in the function HAL_I2C_IsDeviceReady on Line 3332. There is a call to the I2C_WaitOnFlagUntilTimeout function . There is a new test for I2C_IsErrorOccurred and if so (the device is not ready and sent NACK), I2C_IsErrorOccurred waits for STOP and returns HAL_ERROR to I2C_WaitOnFlagUntilTimeout. I2C_WaitOnFlagUntilTimeout returns HAL_ERROR to HAL_I2C_IsDeviceReady and it immediately returns HAL_ERROR to the upcoming function without considering the number of Trials from the function parameter.

How To Reproduce

  1. Write a data block into the EEPROM using the HAL_I2C_Mem_Write function
  2. Call HAL_I2C_IsDeviceReady with the Trials parameter set to 1000
  3. HAL_I2C_IsDeviceReady return value is HAL_ERROR, only one busy test is performed

Version 1.11.2 - multiple attempts to test if the device is ready (not busy)
obrazek

obrazek

Version 1.11.3 - only one attempt testing if the device is ready (not busy)
obrazek

@ALABSTM ALABSTM added bug Something isn't working hal HAL-LL driver-related issue or pull-request. i2c I2C-related issue or pull-request labels May 13, 2024
@ALABSTM ALABSTM added this to To do in stm32cube-mcu-fw-dashboard via automation May 13, 2024
@KRASTM KRASTM moved this from To do to Analyzed in stm32cube-mcu-fw-dashboard May 14, 2024
@KRASTM KRASTM moved this from To do to Analyzed in stm32cube-mcu-fw-dashboard May 14, 2024
@KRASTM
Copy link

KRASTM commented May 14, 2024

Hello @engycz,

Thank you for the report.

@KRASTM KRASTM added the internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system label May 15, 2024
@KRASTM
Copy link

KRASTM commented May 15, 2024

ST Internal Reference: 181377

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hal HAL-LL driver-related issue or pull-request. i2c I2C-related issue or pull-request internal bug tracker Issue confirmed and reported into a ticket in the internal bug tracking system
Projects
Development

No branches or pull requests

3 participants