how i recieve gsm respons in my buffer using usart1 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-10-07 2:01 AM
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;
}
}
- Labels:
-
STM32Cube MCU Packages
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-10-07 6:02 AM
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
Up vote any posts that you find helpful, it shows what's working..
