Tool/software: TI-RTOS
Hello, everyone.
I am having a program in which I am using UART task and gpio interrupt as follows.
void buttonCallbackFxn(PIN_Handle handle, PIN_Id pinId) { SetPinOutput(); PIN_setOutputValue(ledPinHandle, Board_LED0, 1); CPUdelay(80000*100); PIN_close(ledPinHandle); if(init==false) { GetFlags(); } SetPinInput(); } bool GetFlags() { ui8Count=4; buffer[0]=SYNC; buffer[2]= GET_FLAGS; buffer[1]=ui8Count; buffer[3]=ui8GenerateCheckSum(buffer, ui8Count); WaitForACK=true; UART_write(uart,buffer, ui8Count); Clock_start(clkHandle); return(true); }; Void UartTaskFxn(UArg arg0, UArg arg1) { UART_Params_init(&uartParams); uartParams.writeDataMode = UART_DATA_BINARY; uartParams.readDataMode = UART_DATA_BINARY; uartParams.readTimeout = 100000; uartParams.readReturnMode = UART_RETURN_FULL; uartParams.readEcho = UART_ECHO_OFF; uartParams.baudRate = 9600; uart = UART_open(Board_UART0, &uartParams); if (uart == NULL) { System_abort("Error opening the UART"); } while (1) { if(init==true) { UART_write(uart,buffer, 4); init=false; Clock_start(clkHandle); } if((WaitForResponse==true) || (WaitForGetResponse==true)) { if(PktState==PKT_DATA) { // for(i=i;i<datalength;i++) // { UART_read(uart, buff,1); buffer[i]=buff[0]; // } // i=i+datalength; i++; // Semaphore_post(txSemaphoreHandle); } } } }
When GPIO interrupt occurs then GetFlags() function is called and when it executes the UART_write(uart,buffer, ui8Count); Then in the ROV ideal task shown to be blocked because of internal error and the whole program stops functioning. Please help me to solve the issue.