Hi I have an application that after running for awhile ends in the Dummy_Handler(). (see the attachment, please) In prvPortStartFirstTask() something seems to go wrong… (most likely it went wrong before) Any ideas how I could find the cause for this? thanks
I got another crash. A bit different, but more or less the same. (see attachment please)
First thing to note, the stack trace for interupts may not be totally accurate, as the line Signal Handler Called from fffffffd actually indicates that a change of stack usage happened, and it appears this debugger didn’t then follow the other stack frame, but just continued tracing the stack used by the ISR. Second, this sort of error tends to indicate that some corruption has occured, w,hich is frequently cause by interrupts having wrong priorities, and corrupting the FreeRTOS state. Make sure you have define an appropriate configASSERT function that freezes execution and be using a recent version of FreeRTOS that checks for this.
Ahhh stacks… 🙂 The stacks were too small… Nevertheless a question needs to be answered, how can one get runtime stack usage information? There is this post: https://www.freertos.org/FreeRTOSSupportForumArchive/November2015/freertosMeasuringStackUsageb5706bb4j.html But it doesn’t answer the question programmatically, only for a debugger session. Christmas is not far so… It would be nice to have a function to return the stack current usage and maximum usage to be collected in a monitor task running periodically. There is a pattern written to the stack before starting, 0xA5. It is not 100% (an 0xA5 could have been pushed to the stack…) but it would help. At the end one wants to find if the stack is been used by 10%, 50% or 90%.
Christmas seems to be here already: uxTaskGetStackHighWaterMark() is the function. https://www.freertos.org/uxTaskGetStackHighWaterMark.html
Also see https://www.freertos.org/uxTaskGetSystemState.html
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.