-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
usage of i2c diver causes StoreProhibited exception (IDFGH-13589) #14476
Comments
No it shouldn't be this case Secondly, what about slowing down scl frequency As for QMC5883 is the exclusive sensor that causes this error, interesting and I'm going to got one for further debugging. |
By the way, are you sure |
Thank you for your reply. I tried following combinations of configuration changes and always was able to reproduce the same exception/backtrace:
Tests has been done with esp-idf repository updated to v5.4-dev-2620-g6673376297 version. Addresses of QMC5883 and status register should be valid, they are taken over from library, which was able to read the sensor properly, and values matches with register map in datasheet. To be sure, I tested it using
(After sensor is switched to continuous mode by Some |
Strange, anyway, my sensor is on the way, I will try to reproduce that locally and see what is exactly happening.. |
I got a QMC5883 but regretfully didn't reproduce the same issue. But anyway, I go through the gdb log again, It seems that it really want to receive data in STOP command as you described. I don't know why this happened excactly.. still debugging. Because you can reproduce easily, may you please try add a line https://github.com/espressif/esp-idf/blob/master/components/esp_driver_i2c/i2c_master.c#L430 here |
After adding
I'am not sure if I understood question properly, but driver API is called always from single task. I use code provided in "Steps to reproduce." section for all tests. I don't know whether it is related, but compiling project with sdkconfig option I tried delete |
no more need to check. I tried several scenario like nack or timeout, no produce anyway... i will continue going through. But a suggestion for you might to decline the error report like nack or timeout in order that try not to disturb the state machine.. |
Well, I tried QMC5883 with esp32 in your code and can't reproduce issue. So... If no further update, I will close this issue. |
I plan to look at bus and try to find some anomaly occuring before crash. Would it be possible to reopen this issue, if I find more specific method to reproduce crash? Thank you for your help. |
Answers checklist.
IDF version.
v5.2.2-639-g43098fc4de, v5.3-383-g0bbd728196, v5.4-dev-2596-g6e5414b6c4
Espressif SoC revision.
ESP32-D0WDQ6 (revision v1.0)
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
Development Kit.
NodeMCU-ESP32 ESP32 DEVKITV1
Power Supply used.
USB
What is the expected behavior?
i2c_master_transmit_receive
function should return error code on i2c transaction failure.What is the actual behavior?
StoreProhibited
exception is thrown by accessing to null ptr in functioni2c_ll_read_rxfifo
.Steps to reproduce.
main/main.c
andmain/CMakeLists.txt
files.Debug Logs.
More Information.
My project crashed time by time and always with same exception/backtrace.
To exclude posibilities that problem is related to other project specific code or configuration I created new project as described in "Steps to reproduce" section, but with same behavior.
Clean installations of esp-idf and tools didn't help. (I tried versions v5.2, v5.3, master)
I tried
/examples/peripherals/i2c/i2c_tools
example too. During i2c device register reading ("i2cget" command) occurs exactly same exception.This problem araised mostly (almost exclusively) with QMC5883 sensor in comparison to other i2c devices.
It looks that
i2c_isr_receive_handler
function tries to write some data to user read/write buffer (data
member ofi2c_operation_t
) which is not assigned to i2c operation of typeI2C_LL_CMD_STOP
, but I could be wrong.I am attaching backtrace, states of lacal variables and states of same other i2c driver related objects acquired using GDB debugger:
gdb-backtrace.txt
gdb-i2c_master_bus_t-related.txt
gdb-locals.txt
The text was updated successfully, but these errors were encountered: