cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the 'HAL_UART_Receive_IT' for receiving large data like from GSM ?

NHing.1
Associate III

Hello guys,

hello @KnarfB​ ,@Community member​ 

I am struggling with this thing from past one month.

I am using Quectel M66 gsm module and stm32f030cct6 controller.

I am not able use UART interrupt for receiving large data when using gsm over uart.

how do i receive phone number when there is a call on gsm.?

Not able to store or display the data via uart on controller.

please help me out.

just give me help on code how to write that particular so that i can use it in my code.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
NHing.1
Associate III

Hello,

I found the solution for this

uint8_t GSM_RX_BUFFER[MAX], GSM_DATA, BUFFER_INDEX = 0;
 
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
	if(huart->Instance == USART2)
	{
			GSM_RX_BUFFER[BUFFER_INDEX] = GSM_DATA;
			BUFFER_INDEX++;
			HAL_UART_Receive_IT(&GSM_UART,&GSM_DATA,1);
	}
}

with the help of this i can read the uart in interrupt mode.

after executing at command call the interrupt and then reset the index and clear the buffer.

View solution in original post

5 REPLIES 5
NHing.1
Associate III

Hello guys,

@Community member​ ,@Piranha​ 

please look into this matter also

KnarfB
Principal III

Talking to a AT modem can be a tedious task. There maybe multi-line answers, spontaneous reports etc.. Don't have ready-to-use bullet-proof code for your device. In principle, you have to combine a state-based character-by-character parser with proper timeout handling. If you check github etc.. you will find code (of varying quality).

KnarfB

Thanks @KnarfB​ ,

do you have any github link for such things?

I am searching for those.

NHing.1
Associate III

Hello,

I found the solution for this

uint8_t GSM_RX_BUFFER[MAX], GSM_DATA, BUFFER_INDEX = 0;
 
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
	if(huart->Instance == USART2)
	{
			GSM_RX_BUFFER[BUFFER_INDEX] = GSM_DATA;
			BUFFER_INDEX++;
			HAL_UART_Receive_IT(&GSM_UART,&GSM_DATA,1);
	}
}

with the help of this i can read the uart in interrupt mode.

after executing at command call the interrupt and then reset the index and clear the buffer.