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

Missing TXIS flag check for sending LSB byte of memory address in AT24Cxx #2

Open
eos1d3 opened this issue Dec 21, 2021 · 1 comment

Comments

@eos1d3
Copy link

eos1d3 commented Dec 21, 2021

In both read and write functions for AT24Cxx, the LSB byte of memory address is sent without checking TXIS flag. I check STM30G1 reference manual, each byte transmission needs to ensure TXIS is set. No idea if other STM32 have small buffer to hold it.

Without the second TXIS flag, check, I tested reading and writing 44 bytes of string using STMG031, both work normally. But I think there is a potential to cause problem.

This happens only in AT24CXX with 16 bit memory address. The RTC uses 8 bit memory address and does not have this issue.

@sweesineng
Copy link
Owner

Sorry for late
reply and thanks for pointing out this. I review the HAL code again and saw there is TXIS check on both MSB and LSB address.
TXIS
Probably I cut shortcut and think it was redundant. I also tested this on STM32G030F6 and there is no issue. Anyway, I will adding back.

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

No branches or pull requests

2 participants