-
Notifications
You must be signed in to change notification settings - Fork 13
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
InstrFetchProhibited Error using DFRobot_DF2301Q library #12
Comments
I finally found a "solution" (...well not yet quite sure what I've found). It turns out that the DFRobot's DFRobot_DF2301Q-library contains a line of code that was the root-cause of my code-crash: Inside the file
If I put a comment on this line, then my code compiles without crash ! (I am using the I2C example right now - and I guess therefore none of the UART-code is used and most likely the comment-out of this Can somebody please explain why this And why did it cause a crash on the ESP32 S3 board ? |
Hello, That is, if you remove #pragma pack(1), the structure will occupy 16 * 6=96 bytes. But the problem with the current version of the code is that it doesn't end the byte alignment process. #progma pack() should be used in pairs. One #pragma pack() must be added at the end of the structure for the command to cancel the custom structure alignment, if not, it may lead to problems in the whole program, because it will affect the way other structures are aligned. It should be used like this: #pragma pack(1)
struct example
{
char a;
double b;
};
#pragma pack() I fixed this bug in my branch, but unfortunately I don't have your e-ink-display to test it with. |
@YeezB, thank you very much for the detailed explanation. I only have time to test your branch by the end of the upcoming week. I'll let you know.... |
Hello, |
It did for me. thanks man |
I am new to the DFRobot SEN0539 module and I am driving it by an ESP32S3-WROOM-1U-8N8R.
Therefore I have 8MB of RAM and 8MB of Flash available.
Everything works as expected - until the moment where I include another library into my code and try to execute its e-ink-display driver code with it.
See minimum code-example at the very bottom of this entry...
As soon as I add the above include-statement, together with the most simple e-ink-driving code, then I get a memory crash errror
InstrFetchProhibited
.Important: As I said, the DFRobot code alone works. And also, the GxEPD2 example as a standalone-code works fine. ONLY in combination, these two libraries do crash.
Here the error message (i.e. the processor keeps crashing again and again no longer being capable of booting the code properly).
The error log sais:
Now it is pretty clear that the two libraries (i.e. DFRobot_DF2301Q and GxEPD2) are spilling memory of the ESP32S3 type at choice.
When I investigate more closely, I get the above crash inside the while loop of my GxEPD2 code:
Now my questions:
InstrFetchProhibited
error from happening ?Thank you for any support on this. I am aware that I could ask this same question also in the GxEPD2 forum - since it is unclear where the error really originates... So I did : https://forum.arduino.cc/t/instrfetchprohibited-error-using-gxepd2-in-combination-with-another-library/1279812
Here the minimum code-example that reproduces the memory issue nicely:
Pleae note: As soon as I uncomment the do-while loop, then I get the error! The question is WHY ?
The text was updated successfully, but these errors were encountered: