-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
ESP-IDF 4.4.5: I2C crash during flash operations (IDFGH-11007) #12192
Comments
https://github.com/espressif/esp-idf/blob/release/v4.4/components/hal/esp32/include/hal/i2c_ll.h#L565 |
i2c.txt |
|
Oh.. data->fifo_data |
compiles. I'm testing..... I2C is still working...... No crash so far..... I'll report back in a few hours. |
Unfortunately...
|
Here we go. I finally was able to create a minimum code example. I added the sdkconfig as well as it seems to be important for the crash. For example, running at 240 MHz is crucial... but I have no clue why. |
Can you reproduce the crash with my example? |
FYI, a freshly installed 4.4.6 crashes reliably, just like the previous version. |
Any news here? |
@igrr maybe you could have a look at this, too? 5.1 is affected as well... |
Oh no, this time I see your code I find that this issue has no relationship with this #10079 . That means the I2C But what I can see now is some parameter like |
Oh, yes, you have found the cause. A pre-defined I2C command sequence like (from the example)
ends up in flash. Then, in i2c_master_cmd_begin_static (in i2c.c) the pointer to this sequence is handed down to i2c_ll_write_txfifo (in i2c_ll.h). Both functions are in IRAM, but the data is not. So, the correct way to define a command sequence would be
I tried it, and it does not crash with the same error any more. In my example, the task wdt is triggered, though. I don't know, if this is normal. I think, there should be a warning. Often it is difficult to find out what the compiler does with variables (even without "const"). |
A check could be implemented, like
in i2c_master_write. However, it would be best to have this at compile time... |
4.4 is EOL, so I will close this issue. |
Answers checklist.
IDF version.
4.4.5
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.
TTGO
Power Supply used.
USB
What is the expected behavior?
#10079 and 9a6a287
were implemented in ESP-IDF 4.4.5 and I thought I2C was stable now.
What is the actual behavior?
I still get a an occasional
Steps to reproduce.
The crashes are rare and seem to happen when accessing the flash while another task is busy with I2C. The I2C driver is installed with flag ESP_INTR_FLAG_IRAM. I wasn't able to create a minimum code example, though...
Maybe someone has an idea anyway.
Debug Logs.
No response
More Information.
No response
The text was updated successfully, but these errors were encountered: