Hi.
Thanks for taking time to come in.
I will take your points sequentially and give more information.
You cannot have any serial communication inside an interrupt.. That is not allowed. No printf should be used inside an interrupt.
Fine and understood. My code uses no serial output so i take it out of the equation. In case you thought about communication to the display; it is not using serial, just bitbanging and never within an interrupt anyway.
Export your code and try to analyze the code using for example ( http://cppcheck.sourceforge.net).
You might have some MEM leakage that causes the mbed to crash.. I could find mine using the mentioned tool.
Fair enough. Installed cppcheck 1.89 and had to -force check due to too many combinations . Checked the whole project. Mbedos had its "fair share" of uninitialized variables, pointer dereference usage and oob accesses, (scary number of them, by the way...) but nothing for my code. cppCheck has already been going over my code, but it is still running on mbed. If it ends up showing things back on my code, i'll post an update.
You can debug the code and disallowing reboot (edit the configuration file .. you will find a section for that). so you know what peaces of code is causing the problem and where in your code .. but do the previous mentioned steps before debugging.
In a way, i already know what part is crashing: the constructor to HTTPRequest. What my investigations show is that there is a mutex being called during an interrupt, while in the constructor. HTTPRequest is not within my bounds, neither is any interrupt as i have none in my code. I tried getting into mbed platform code but boy, that is a huge task to start with.
With experience i've learned to get relax with any too strong feeling of "doing the right thing".
I do accept that i might have borked mem with illegal accesses/wrong memory management, and i will check that with any other suggested tool anyone throws in. I have already done all my own checks and corrected whatever eclipse told me. No error or warning, while still in -wall. That is still a good start imho.
May i trigger bad behavior in such parts just by twiddling memory? Theoretically, yes, everything can happen when you shoot around you. May i be the cause? I still doubt, seeing what the behaviour is and various code analysis tool tend to confort me in that direction.
LED was there to factually check for total crash, so we agree. When led stopped blinking i knew it was total dead and that there was a dump on the serial from the OS. When this problem is resolved, blink thread will be removed.
However, it would sometime not crash but still not return from the constructor. Would that be a silent thread crash, i don't know. Is there a reliable mean to check this?
Again, thanks for chiming in.
stm32F429: httprequest randomly freezing Hi.
I started this as a question but i think i got a better grasp at what is a question and a discussion, so while it is being reviewed (and most certainly refused as it should instead be a topic) I'll just drop it here too. Please forgive me for double post if that occurs and i am not able to delete the question. Also, i have some more information to add..
Here comes my problem...
I have a little simple program that is more or less randomly crashing (panic leds) or freeze when calling MBED-HTTP's HttpRequest constructor, and i can't figure out why. More or less randomly means that it used to run ok, then started to stop after some time, then more and more sooner, then now almost all the time at the same call.(third or fourth)
Program has no thread, i just run all in main. I have no interrupts, no timers, no nothing fancy. I tried compiling online with official compiler, offline with eclipse, same result. I tried reusing socket and letting HttpRequest opening it each request, same result. i tried getting an idea about memory usage and used this routine before calling constructor to get largest memory block and i have around free 80KB each time. (source https://os.mbed.com/questions/6800/How-to-find-the-amount-of-free-space-on-/ )
I also tried putting all my logic in a thread, started from main and adding a while(1) at the end of main() that 1hz blinked a LED to check if it was totally killed when frozen or not. It looks like in fact sometimes it crashes and panics, sometimes not in a short time enough so that i can see it happening. (minutes time span) 1Hz Led keeps on blinking while httpRequest does not return.
I believe i must be doing something illegal with the HttpRequest, but can't figure ou what. Thanks for any hint, i'm going mad and out of options.
More information: When it crashes, here is what i get on serial:
From what i read in the given URL, it seems to be an internal error, but i can not narrow it down.