Hello Team !
I use TMS570LS0432 Hercules Launchpad with FreeRTOS generated from HALCogen.
I tried the following
–>Create 6 Tasks (1ms, 5ms, 10ms, 20ms, 50ms, 100ms)
–>Create a high priority Interrupt Handler Task. Initially this Task is suspended using vTaskSuspend(). This task is resumed only from ISR.
–>Configure HET to give interrupt for every 1ms. ISR will be executed for every END
OFPERIOD (1ms).
–>Inside the ISR, I give vTaskResume() for handling Interrupt Handler Task
Now when I run the code in debug mode, I keep a breakpoint in points vTaskSuspend() inside task and vTaskResume() inside ISR. The execution stops at vTaskResume() inside ISR properly, but never enters to the Handler Task as expected. Repeatedly it enters only ISR routine.
*** But when the code is debugged Step-by-step then the code enters the Handler Task.
*
`#include “FreeRTOS.h”
#include “FreeRTOSConfig.h”
#include “gio.h”
#include “het.h”
#include “os
eventgroups.h”
#include “os
task.h”
//#include “ostimer.h”
#include “lib
delayhookhdr.h”
#include "sys_common.h"
xTaskHandle xTask1Handle;
xTaskHandle xTask2Handle;
xTaskHandle xTask3Handle;
xTaskHandle xTask4Handle;
xTaskHandle xTask5Handle;
xTaskHandle xTask6Handle;
xTaskHandle xISRHandle;
void vTask1(void *pvParameters)
{
for(;;)
{
vTask_PreEmp_1ms();
}
}
void vTask2(void *pvParameters)
{
for(;;)
{
vTask_PreEmp_5ms();
}
}
void vTask3(void *pvParameters)
{
for(;;)
{
vTask_PreEmp_10ms();
}
}
void vTask4(void *pvParameters)
{
for(;;)
{
vTask_PreEmp_20ms();
}
}
void vTask5(void *pvParameters)
{
for(;;)
{
vTask_PreEmp_50ms();
}
}
void vTask6(void *pvParameters)
{
for(;;)
{
vTask_PreEmp_100ms();
}
}
void vTaskISR(void *pvParameters)
{
uint32_t Count1=0;
vTaskSuspend(xISRHandle);
Count1++;
}
void main(void)
{
hetInit();
_enable_interrupt_();
/* Create Task 1 */
if (xTaskCreate(vTask1,"Task1", configMINIMAL_STACK_SIZE, NULL, 6, &xTask1Handle) != pdTRUE)
{
/* Task could not be created */
while(1);
}
if (xTaskCreate(vTask2,"Task2", configMINIMAL_STACK_SIZE, NULL, 5, &xTask2Handle) != pdTRUE)
{
/* Task could not be created */
while(1);
}
if (xTaskCreate(vTask3,"Task3", configMINIMAL_STACK_SIZE, NULL, 4, &xTask3Handle) != pdTRUE)
{
/* Task could not be created */
while(1);
}
if (xTaskCreate(vTask4,"Task4", configMINIMAL_STACK_SIZE, NULL, 3, &xTask4Handle) != pdTRUE)
{
/* Task could not be created */
while(1);
}
if (xTaskCreate(vTask5,"Task5", configMINIMAL_STACK_SIZE, NULL, 2, &xTask5Handle) != pdTRUE)
{
/* Task could not be created */
while(1);
}
if (xTaskCreate(vTask6,"Task6", configMINIMAL_STACK_SIZE, NULL, 1, &xTask6Handle) != pdTRUE)
{
/* Task could not be created */
while(1);
}
if (xTaskCreate(vTaskISR,"ISR", configMINIMAL_STACK_SIZE, NULL, 10, &xISRHandle) != pdTRUE)
{
/* Task could not be created */
while(1);
}
pwmEnableNotification(hetREG1, pwm1, pwmEND_OF_PERIOD);
pwmStart( hetRAM1, pwm1);
/* Start Scheduler */
vTaskStartScheduler();
/* Run forever */
while(1);
}
void pwmNotification(hetBASE_t * hetREG,uint32 pwm, uint32 notification)
{
static uint32_t ucLocalTickCount = 0;
ucLocalTickCount++;
vTaskResume(xISRHandle);
}
void vApplicationMallocFailedHook( void )
{
for( ;; );
}
`
Could the support team help to overcome this? Same thing happens with Event Groups and Counting Semaphores as well.