I am using Trace with FreeRTOS.
I am declaring a queue as a global variable, and I am using void vCreatQueue in the main after MX_xxxx_Init for init.
I have a problem with the trace when I do it this way.
Trace stuck in HardFault_Handler function. Apparently, the queue variable should be declared before the vTraceEnable(TRC_START).
This is frustrating for me because I have to change all my code and, I think this is not an efficient way to use Trace!
I’m not clear if you mean declare the queue variable or create the queue before vTraceEnable() is called - but I don’t think there is such a restriction in either case. Take a look at some of the examples in the download that integrate trace as a reference. For example:
Thank you, Richard,
The example project “WIN32-MSVS”, confirms that all queues must be declared after vTraceenable(…).
In this example, another function is called after the vTraceEnable(), in this function the Queues is instantiated and used.
indent preformatted text by 4 spaces
int main( void )
{
/* This demo uses heap_5.c, so start by defining some heap regions. heap_5
is only used for test and example reasons. Heap_4 is more appropriate. See
http://www.freertos.org/a00111.html for an explanation. */
prvInitialiseHeap();
/* Initialise the trace recorder. Use of the trace recorder is optional.
See http://www.FreeRTOS.org/trace for more information. */
**vTraceEnable( TRC_START );**
/* The mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting is described at the top
of this file. */
#if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 1 )
{
**main_blinky();**
}
#else
{
/* Start the trace recording - the recording is written to a file if
configASSERT() is called. */
printf( "\r\nTrace started.\r\nThe trace will be dumped to disk if a call to configASSERT() fails.\r\n" );
printf( "Uncomment the call to kbhit() in this file to also dump trace with a key press.\r\n" );
**uiTraceStart();**
**main_full();**
}
#endif