[Solved] gettimeofday() is throwing an exception ...
Posted: Mon Oct 10, 2016 5:44 am
I am compiling some 3rd party C code and tracking down an exception. When I ran GDB, on the exception, I was told that I was in the stack panic stack with no obvious backtrace before that.
The actual call is:
I see the first log statement but not the second. If I comment out the gettimeofday() and just return 0, no issue and no exception. I am assuming gettimeofday() ....
Ohh ... pause here ...
I hunted deeper into the source and found:
https://github.com/espressif/esp-idf/bl ... alls.c#L91
It appears "gettimeofday" is not implemented and just aborts(). That's a little naughty. I see a comment mentioning it as a "todo". Might it be possible to issue a ESP_LOG message saying something like "<functionName>: Not yet implemented, aborting!".
The actual call is:
Code: Select all
struct timeval tv;
printf("cs_time: A\n");
if (gettimeofday(&tv, NULL /* tz */) != 0) return 0;
printf("cs_time: B\n");
Ohh ... pause here ...
I hunted deeper into the source and found:
https://github.com/espressif/esp-idf/bl ... alls.c#L91
It appears "gettimeofday" is not implemented and just aborts(). That's a little naughty. I see a comment mentioning it as a "todo". Might it be possible to issue a ESP_LOG message saying something like "<functionName>: Not yet implemented, aborting!".