cancel
Showing results for 
Search instead for 
Did you mean: 

USART STM32

Nidhi Rao
Associate II

I am able to receive only 0x0D in receive buffer, but I can see different data in Receive string.

Please can someone help me..

unsigned char i = 0, k = 0;

//HAL_GPIO_WritePin(GPIOC, GPIO_PIN_2, GPIO_PIN_SET); //Switch ON GSM LDO

__HAL_UART_ENABLE_IT(&huart1, UART_IT_TC);

__HAL_UART_ENABLE_IT(&huart1, UART_IT_RXNE);

HAL_Delay(500);

while(1)

{

HAL_UART_Receive_IT(&huart1, RxBuff, GSMLength[i][0]);

HAL_UART_Transmit_IT(&huart1, GSMInit[i], GSMLength[i][0]);

HAL_Delay(200);

}

1 REPLY 1

Should look to use TXE, and use the CALLBACKs to manage interrupt interactions, not arbitrary delays.

Manage RxBuff by it's own length, you should turn off the echo on the modem, and deal with the data returned which may have no relationship to the amount of data sent.

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