cancel
Showing results for 
Search instead for 
Did you mean: 

how i recieve gsm respons in my buffer using usart1 ?

Rshar.0
Associate

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) // call back function

{

  static unsigned int i = 0;

HAL_UART_Receive_IT(&huart1,(uint8_t*)&rx[i],1);

i++;

if(i==200)

{

f.g_gps_data_received_F=1;

__HAL_UART_DISABLE_IT(&huart1, UART_IT_RXNE);

i=0;

}

}

1 REPLY 1

Not a big fan of the HAL USART implementation. Waiting for 200 characters before flagging probably not going to do the job here.

You're probably going to want to use ring buffer for the input/output. And then process the responses to each of the AT command as you send them. Usually scoped with a <CR><LF>, with responses like OK, ERROR, NO CARRIER, etc

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..