Hello,
I’m trying to implement FreeRTOS+Trace into my application. Up to know i’ve been using FreeRTOS without any issues and decided to give FreeRTOS+Trace a try.
I copied the additional libraries + ports from the FreeRTOS download and can compile everything without any issue.
However, my code no longer works properly if i include the tracing features. I simplified my code to a simple bare bone test but still cannot find the issue.
I am currently working with the STM32F4 Discovery board and am using Eclipse + GCC + OpenOCD as my IDE.
Here is a snippet of code:
~~~~~~~~~~~
void test
task(void *pvParameters)
{
portTickType lastwake
time;
lastwake_time = xTaskGetTickCount();
uint32_t i = 0;
while(1)
{
i++;
// Delay
vTaskDelayUntil(&last_wake_time,20 / portTICK_RATE_MS);
}
}
void nvic
config(void)
{
NVICInitTypeDef NVIC_InitStructure;
NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4);
}
void main(void)
{
// Setup system clocks
SystemInit();
rcc_config();
// Init Trace data structure
vTraceInitTraceData();
// Setup NVIC
nvic_config();
// Create Tasks
xTaskCreate(test_task,(signed portCHAR *)"Test ",512,NULL,1,NULL);
uint8_t flag;
// Start Tracing
flag = uiTraceStart();
// Start Scheduler
vTaskStartScheduler();
while(1)
{
// No Man's Land
}
}
~~~~~~~~~~~
When i run my code, the vTraceInitTraceData() and uiTraceStart() both seem to be called correctly (flag returns 1, and the InitTraceData properly configures the RecordData structure).
Where things get wierd is the execution of the task itself. The task is only executed once after which the program gets stuck in void vPortEnterCritical( void ) on line 413,
configASSERT( ( portNVIC
INTCTRL
REG & portVECTACTIVEMASK ) == 0 );.
I am running out of ideas on what to look. Any comments or suggestions would be most appreciated! If needed, i can also show my FreeRTOSconfig.h / trcConfig.h.
Thanks,
Alex