-
Notifications
You must be signed in to change notification settings - Fork 23
Wire.lastError() throwing back error 5 #24
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
Comments
I set up Debug level to ERROR and got this, in case you can use it:
Enrique |
@euquiq I made another attempt. Try this branch: stickbreaker-Busy-Glitch. It has recovered bus busy failures for me. Chuck. |
@euquiq Chuck. |
Hi Chuck! No Sweat, Thanks a lot, I hope you can nail this glitch, whenever you got time. If I can be of any help, just ask ! |
@euquiq Chuck. |
@lonerzzz @me-no-dev Just figured out how to do a hardware reset on the i2c stateMachine. Chuck. |
Hi Chuck, Again, thanks for your time and help. Just downloaded branch stickbreaker-Busy-Glitch and copied into my esp32 branch your usual files: \libraries\Wire\scr\Wire.h I got the following errors when compiling:
|
@euquiq that doesn't make any sense, I'll look! |
@euquiq i2c_err_t i2cAttachSCL(i2c_t * i2c, int8_t scl)
{
if(i2c == NULL){
return I2C_ERROR_DEV;
}
digitalWrite(scl, HIGH);
pinMode(scl, OPEN_DRAIN | PULLUP | INPUT | OUTPUT);
pinMatrixOutAttach(scl, I2C_SCL_IDX(i2c->num), false, false);
pinMatrixInAttach(scl, I2C_SCL_IDX(i2c->num), false);
return I2C_ERROR_OK;
}
i2c_err_t i2cDetachSCL(i2c_t * i2c, int8_t scl)
{
if(i2c == NULL){
return I2C_ERROR_DEV;
}
pinMatrixOutDetach(scl, false, false);
pinMatrixInDetach(I2C_SCL_IDX(i2c->num), false, false);
pinMode(scl, INPUT | PULLUP);
return I2C_ERROR_OK;
}
i2c_err_t i2cAttachSDA(i2c_t * i2c, int8_t sda)
{
if(i2c == NULL){
return I2C_ERROR_DEV;
}
digitalWrite(sda, HIGH);
pinMode(sda, OPEN_DRAIN | PULLUP | INPUT | OUTPUT );
pinMatrixOutAttach(sda, I2C_SDA_IDX(i2c->num), false, false);
pinMatrixInAttach(sda, I2C_SDA_IDX(i2c->num), false);
return I2C_ERROR_OK;
}
i2c_err_t i2cDetachSDA(i2c_t * i2c, int8_t sda)
{
if(i2c == NULL){
return I2C_ERROR_DEV;
}
pinMatrixOutDetach(sda, false, false);
pinMatrixInDetach(I2C_SDA_IDX(i2c->num), false, false);
pinMode(sda, INPUT | PULLUP);
return I2C_ERROR_OK;
} Chuck |
@euquiq Manual Spelling Error~!!!! Change them to i2cDetachSCL() and i2cDetachSDA() (remove the extra 't') Chuck. |
Works fine !! Thanks again ! You are a great contributor to the Arduino side of the ESP32 !! BTW, I've been reading your opinions / concerns about ESP32 Arduino framework development (in here #21) and I must say I am a bit appalled about the lethargic situation too. A couple of weeks ago, the ESP8266 finally got a WebServerSecure library and examples. So the esp8266 is capable of serving thru https. About a year ago, I dumped the esp8266 and jumped into the ESP32 because, among other things, I assumed it was the logical step forward for delving into HTTPS server. |
@euquiq glad to hear it is now working for you. I'll merge it into the main repo later today. I don't know why arduino-esp is being treated as the bastard stepchild. It seems to me it should be the path forward :) Chuck. |
Hi Stickbreaker !!!
How are you ? Hope you remember me, I had serious problems with ESP32 and official arduino branch regarding i2c.
Your work saved me!
And then, today, I decided to update into the latest espressif/arduino-esp32 code from github.
Then I downloaded your branched - i2c enhanced code from git, and copied over the relevant files, into the master esp32 arduino:
\libraries\Wire\scr\Wire.h
\libraries\Wire\scr\Wire.cpp
\cores\esp32\esp32 - hal - i2c.h
\cores\esp32\esp32 - hal - i2c.c
\cores\esp32\esp32 - hal - log.h
I recompiled, and to my dismay, my code is not being able to read 256 bytes from my sensor's EEPROM (which in the older commit was OK until now (I was using ge5b2c1cf).
This is my code (which was working fine):
Which now keeps in loop throwing at me:
EEPROM ERROR 5, 0 bytes
I was hoping you may have an idea on what may be going on ? I could try to revert into earlier commits, until I get a working one again, I suppose. But maybe it is an easy thing to fix from my side ?
Regards,
Enrique.
The text was updated successfully, but these errors were encountered: