-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Query regarding crash in H7 Video initialisation on Giga with mbed built with gcc13.x #946
Comments
Hi @schnoberts1 , |
Hi,My h/w debugger is currently out of commission and I’m new to custom mbed builds (so I’m in 1990s style logging debug land) but I’ll figure out how to get some diagnostics out of the stack and post what I learn. If you have a good link for a “good mbed config for debugging” you’d save me some time :). It could well be an optimisation. There’s also been some struct layout changes and other ABI fixes though those seem to be in very specific situations. One of my structs changed layout by a byte which triggered a static_assert for size I had. It could obviously be my code and gcc7 just emitted a memory layout that accidentally mitigated against it :) AndyOn 28 Aug 2024, at 08:19, Martino Facchin ***@***.***> wrote:
Hi @schnoberts1 ,
can you paste the crash output? We never tried compiling with gcc > 10 so it might be some new optimization kicking in.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Can I ask you, how do I configure the crash help? I'm using mbed-os-to-arduino-macos. I run it with a working directory which is the root of the I have this in variants/GIGA/conf/mbed_app.json:
The mbed library compiles with crash reporting enabled (I patched mbed_error.c to check this) and so is my code(I similarly patched that). Auto reboot works but it ignores the reboot max. During mbed compile the relevant define is set to the chosen error-reboot-max. When I call
|
I get a hard fault while the code is at line 256 in dsi.cpp
if I step through the code manually it gets into Stepping through the code it only fails when I press go over something that might yield. This is with |
... so I returned to the gcc7 Arduino supplied compiler and it seemed stable, but if I restarted the device a number of times while connected via Serial and not connected to the debugger I would get occasional freezes. I suspect therefore it's something about my build that's at issue here. I'll close this issue and re-open it if I conclude otherwise. |
So the gcc7 issue was the problem with the developer profile mbed that I mentioned on another issue where mbed error functions go into infinite loops on anything other than a release build due to semaphore asserts. I fixed that and I've verified the dsi issue stops if I compile with -O0. I have the same issue on gcc8. I'm going to do another 2 days of diagnosis then abandoned this as mbed is EOL. |
I think this is an optimiser issue but it seems present from gcc8 onwards in various guises. The stack dumps are mostly in the same place but when you step through the code (in my h/w debugger at least) you end up stepping into delay() which goes into osDelay() which steps through some thread switching code which when it returns seems to crash the system. I'd be interested in knowing if you've tested the Giga display with anything over gcc7 and whether you are confident it works. If you are, feel free to post a link to the working source code. Outside of that, I guess I better walk back to gcc7. Whilst I like the better optimiser and language features, they aren't gonna get my project finished. |
@facchinm I believe I have found the issue. The dsi_init call does not return a value. This is undefined behaviour and the optimiser can do whatever it wants. So I am reasonably sure this is blowing up the stack when a modern compiler is used. At least, my app starts the gui with gcc13 |
@facchinm Incidentally, I have a fix for this here: and I have fixed aka suppressed all the warnings being generated in my projects build of ArduinoCore-mbed here: schnoberts1@b97ef31 My fork has diverged from yours so there some items in that commit where I've removed compiler warning suppression pragmas that I'd added before deciding this wasn't a good idea. As a convention: 'C' .c/h files got Where there were no relevant modifies I used I haven't raised a PR as, like I said, my repo has diverged a bit and this should be good enough for someone to cherry-pick into the main code if anyone wants to. Feel free to close this when someone has cherry picked the fix across. |
Hi,
I've building mbed and my app with gcc13.x (flags the same and with gcc7.x) I see a crash in
int dsi_init(uint8_t bus, struct edid *edid, struct display_timing *dt)
.... before I investigate, is this a path others have been down?
The text was updated successfully, but these errors were encountered: