2019-03-21 11:38 PM
Hi,
I'm trying to receive data through USART2 through Arduino's serial terminal. I'm not able to receive anything. When I suspend the process, it is always stopping at UART_WaitOnFlagUntilTimeout(); . I'm using "HAL_UART_Receive(&huart2, rx_data, 10, HAL_MAX_DELAY)" function to receive data through serial terminal. I've kept rx_data as a watch expression. But I'm not able to observe anything.
I'm also getting multiple errors in the "Expression" tab. The errors are:
Multiple errors reported.
1) Failed to execute MI command:
-var-create - * rx_data
Error message from debugger back end:
-var-create: unable to create variable object
NOTE: I haven't connected the usart to usb dongle. And i haven't connected flying wires from USART's Tx and Rx to ST-LINK's Tx and Rx.
My Code:
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_USART2_UART_Init();
uint8_t tx_data[10] = {1,2,3,4,5,6,7,8,9,10};
uint8_t rx_data[10];
//HAL_UART_Transmit(&huart2, tx_data, 10, HAL_MAX_DELAY);
while (1)
{
HAL_UART_Receive(&huart2, rx_data, 10, HAL_MAX_DELAY);
}
}
Please guide.