This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LC4357: Freertos - task resource delete execution jumps to prefetch entry with value in IFSR 0x0D

Part Number: TMS570LC4357

Hi TI experts,

We are using TMS570LC43xx and FreeRTOS.

For reinitialization, we need to delete task resources like timer and semaphores etc. before deleting task.

During debugging, it is observed after execution of xTimerDelete, code jumps at "prefetch entry" exception.

I tried to delete the used resources for that task only. 

also, tried by inserting small delay in between these functions.

Request to guide to resolve this issue.

Thanks and Regards,

anil

  • Hi Anil,

    xTimerDelete() deletes a timer that was previously created using the xTimerCreate(). The configUSE_TIMERS configuration constant must be set to 1 for xTimerDelete() to be available. By default, this constant is defined as 0 in FreeRTOSConfig.h:

  • I just did a test, I created a timer, and deleted it after it started. Everything works as expected. This is my test code:

    void vTimerCallback( TimerHandle_t xTimer )
    {

    TickType_t xTimeNow;
    /* Obtain the current tick count. */
    xTimeNow = xTaskGetTickCount();

    /* Taggle GIOB[2:1] with timer tick */
    gioToggleBit(gioPORTB, 1);
    // gioToggleBit(gioPORTB, 2);

    }

    /* USER CODE END */

    int main(void)
    {
    /* USER CODE BEGIN (3) */

    gioInit();

    /* Set high end timer GIO port hetPort pin direction to all output */
    gioSetDirection(hetPORT1, 0xFFFFFFFF);
    gioSetDirection(gioPORTB, 0xFFFF);

    /* Create then start some timers. Starting the timers before
    the RTOS scheduler has been started means the timers will start
    running immediately that the RTOS scheduler starts.
    */
    xTimers = xTimerCreate
    ( /* Just a text name, not used by the RTOS kernel. */
    "Timer",
    /* The timer period in ticks, must be greater than 0. */
    pdMS_TO_TICKS(1000), /* period/time */
    /* The timers will auto-reload themselves when they expire. */
    pdTRUE,
    /* The ID is used to store a count of the number of times the timer has expired, which is initialised to 0. */
    ( void * ) 0,
    /* Each timer calls the same callback when it expires. */
    vTimerCallback
    );

    if( xTimers == NULL )
    {
    /* The timer was not created. */
    }
    else
    {
    /* Start the timer. No block time is specified, and
    even if one was it would be ignored because the RTOS
    scheduler has not yet been started. */
    if( xTimerStart( xTimers, 0 ) != pdPASS )
    {
    /* The timer could not be set into the Active state. */
    for(;;); /* failure */
    }
    }

    #if 1
    /* Create Task 1 */
    if (xTaskCreate(vTask1,"Task1", configMINIMAL_STACK_SIZE, NULL, 1, &xTask1Handle) != pdTRUE)
    {
    /* Task could not be created */
    while(1);
    }

    /* Create Task 1 */
    if (xTaskCreate(vTask2,"Task2", configMINIMAL_STACK_SIZE, NULL, 2, &xTask1Handle) != pdTRUE)
    {
    /* Task could not be created */
    while(1);
    }
    #endif

    xTimerDelete(xTimers, 0);

    /* Start Scheduler */
    vTaskStartScheduler();

    /* Run forever */
    while(1);
    /* USER CODE END */

    return 0;
    }


    /* USER CODE BEGIN (4) */
    /* USER CODE END */