Skip to main content
Nidhi Rao
Associate
October 1, 2018
Question

USART STM32

  • October 1, 2018
  • 1 reply
  • 574 views

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);

}

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    October 1, 2018

    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 VenmoUp vote any posts that you find helpful, it shows what's working..