My task is this :
void Task4_task(uint32_t task_init_data) {
if (_lwevent_create(&usb_event,0) != MQX_OK) {
Error_Task_Init();
}
if (_lwevent_wait_ticks(&usb_event, 1, TRUE,0) != MQX_OK) {
_task_block();
}
MSD_Init();//inizializzo libreria USB
while(flag_usb) {//ciclo di gestione USB
MSD_Task();
WAIT_Waitus(10);
//_time_delay_ticks(10);
}
_task_restart(task_LCD, NULL, 0);
_task_restart(task_CLOCK, NULL, 0);
_task_restart(task_USB, NULL, 0);
}
i wait in the task until the event is set by an interrupt, after i activate the MSD until the usb cable is connected. After it is remove i exit from the while and i want to reset all the task (this task has the highest priority respect the others)
The problem is that when the command _task_restart(task_LCD, NULL, 0); is execute i have a PE_ISR(Cpu_Interrupt).
Thanks for the support!!