Other Parts Discussed in Thread: HALCOGEN
Tool/software: TI-RTOS
Hi
I have created two task:-
one xTaskCreate(vTask1) and xTaskCreateRestricted(vTask2) for checking functionality of FREERTOS , but while the pro-game goes to vTask1 then from there its moving to prefetchEntry, why is it happening like this, and if i remove the xTaskCreateRestricted(vTask2) its working fine.is it due to one privileged and user mode, if so how can i resolve it.
I have generated the code/driver from HalcoGen, and using CCS studio(version7)
code snippet:-
#include "HL_sys_common.h"
#include "HL_system.h"
/* USER CODE BEGIN (1) */
/* Include FreeRTOS scheduler files */
#include "FreeRTOS.h"
#include "os_task.h"
/* Include HET header file - types, definitions and function declarations for system driver */
#include "HL_het.h"
#include "HL_esm.h"
extern void blink(void);
/* Stack Buffer for Task 1 */
//#pragma DATA_ALIGN(stackbuffer, configMINIMAL_STACK_SIZE*sizeof(portSTACK_TYPE))
static portSTACK_TYPE stackbuffer[configMINIMAL_STACK_SIZE] __attribute__ ((aligned (configMINIMAL_STACK_SIZE * sizeof(portSTACK_TYPE))));
/* Define Task Handles */
xTaskHandle xTask1Handle;
xTaskHandle xTask2Handle;
/* Task function */
void vTask1(void *pvParameters)
{
/* Set high end timer GIO port hetPort pin direction to all output */
//gioSetDirection(hetPORT1, 0xFFFFFFFF);
for(;;)
{
/* Toggle HET[1] with timer tick */
blink();
// gioSetBit(hetPORT1, 17, gioGetBit(hetPORT1, 17) ^ 1);
vTaskDelay(100);
}
}
void vTask2(void *pvParameters)
{
while(1)
{
blink();
//sciSend(sciREG1,14,(unsigned char *)"\r\nTask2:\r\n");
vTaskDelay(1000);
}
}
/*Task 1 Parameters*/
static const xTaskParameters xTaskParamters1={
vTask1, /* Function that implements the task */
(const signed char *)"Blinky",/* Just a text name for the task to assist debugging */
configMINIMAL_STACK_SIZE, /* Stack size */
NULL, /* Parametrs to be passed to the task function */
1, /* Task Priority. set the portPRIVILEGE_BIT (1|portPRIVILEGE_BIT) if the task should run in a privileged state*/
stackbuffer, /* Buffer to be used as the task stack */
/* xRegions - Allocate up to three separate memory regions for access by the task, with appropriate access permissions.*/
/* No region is set in this example. */
{ /* Base address Length Parameters */
{0,0,0}, /* { cReadWriteArray, 32, portMPU_REGION_READ_WRITE }, */
{0,0,0}, /* { cReadOnlyArray, 32, portMPU_REGION_READ_ONLY }, */
{0,0,0} /* { cPrivilegedOnlyAccessArray, 128, portMPU_REGION_PRIVILEGED_READ_WRITE }*/
}
};
/* USER CODE END */
/** @fn void main(void)
* @brief Application main function
*
*/
/* USER CODE BEGIN (2) */
/* USER CODE END */
void main(void)
{
/* USER CODE BEGIN (3) */
/* Create Task 1 */
if (xTaskCreateRestricted(&xTaskParamters1, &xTask1Handle) != pdTRUE)
{
/* Task could not be created */
while(1);
}
/* Create Task 2 */
if (xTaskCreate(vTask2,"Task2", configMINIMAL_STACK_SIZE, NULL, 1, &xTask2Handle) != pdTRUE)
{
/* Task could not be created */
while(1);
}
/* Start Scheduler */
vTaskStartScheduler();
/* Run forever */
while(1);
/* USER CODE END */
}
Can you please provide your feedback on this.