task synchronization problem

ajithcs818 wrote on Thursday, March 29, 2018:

hi,
i had 3created three tasks, one for sd card writing another for interrrupt and another for displaying purpose.
interrupt task is not running when sd card task is created .
///task creation

xTaskCreate(vvDisplayTask, (const char*) “vDisplayTask”, 128, NULL, tskIDLE_PRIORITY, NULL);
xTaskCreate(myint_task, (const char*) “int task”, 128, NULL, tskIDLE_PRIORITY, &myint_handle);
xTaskCreate(vSDTASK, (const char*) “vSDTASKsd”, 128, NULL, tskIDLE_PRIORITY, NULL);
vTaskStartScheduler()
/// my three tasks
void vSDTASK(void *p)
{

FATFS fs;
FIL fil;
FRESULT res;
FILINFO MyFileInfo;
DIR MyDirectory;
UINT BytesWritten;
UINT BytesRead;
for(;:wink:
{

if(f_mount(&fs, "",1)== FR_OK)
						   {
							 GPIO_SetBits(GPIOC, GPIO_Pin_15);
							 }
						if(f_open(&fil, "carddaa.txt", FA_OPEN_ALWAYS | FA_WRITE)== FR_OK)
							 {
							GPIO_SetBits(GPIOA, GPIO_Pin_1);
							 res = f_write(&fil, "just testing", 15, &BytesRead);
							 
							 }
					  if(f_close(&fil)==FR_OK)
							 {
								GPIO_SetBits(GPIOC, GPIO_Pin_14);
							
							 }
	
	vTaskDelay(100000/portTICK_RATE_MS);	
}




///2 Task
void myint_task( void * p )///interrupt task which is port yielding from ISR

{
while(1)
{
vTaskSuspend(NULL);
USART_PutStr(“pressed”);
count++;
}
}
void EXTI15_10_IRQHandler(void)// for interrupt task
{
BaseType_t checkIfYieldRequired;
checkIfYieldRequired=xTaskResumeFromISR(myint_handle);
portYIELD_FROM_ISR(checkIfYieldRequired);
EXTI_ClearITPendingBit(EXTI_Line12);

}

/// 3 Task
void vDisplayTask( void * p )
{
for(;:wink:
{
value=(count/4000)*60;
//count=0;

			USART_PutStr("\r\n");

USART_PutMsgAndVal(“count”,count/2,1);
vTaskDelay(4000/portTICK_RATE_MS);
}
}

interrupt task (myint_task) is not running when vSDTASK is running . what would be the problem please help me.
thanks and regard ajith.

rtel wrote on Friday, March 30, 2018:

Sorry - this one slipped under the radar.

First, we strongly advise against using xTaskResumeFromISR() in this way - see the API documentation noting the comment “considered dangerous” https://www.freertos.org/taskresumefromisr.html

You have only shown the first part of the SD card task - is it just while that part is executing tha the interrupt task stops? Is the code disabling interrupts in any way?