2024-12-12 12:07 AM
Hello,
I am trying to put the Lorawan keys (DEVEUI,APPEUI, APPKEY) from a serial terminal using uart communication for end node application. I am using uart interrupts for this. There is cubemx generated usart_if.c file which contains HAL_UART_RxCpltCallback() already. This is the code snippet:
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
/* USER CODE BEGIN HAL_UART_RxCpltCallback_1 */
/* USER CODE END HAL_UART_RxCpltCallback_1 */
if (huart->Instance == USART2)
{
if ((NULL != RxCpltCallback) && (HAL_UART_ERROR_NONE == huart->ErrorCode))
{
RxCpltCallback(&charRx, 1, 0);
}
HAL_UART_Receive_IT(huart, &charRx, 1);
}
/* USER CODE BEGIN HAL_UART_RxCpltCallback_2 */
/* USER CODE END HAL_UART_RxCpltCallback_2 */
}
How to modify this with my code so that I can receive a command from serial terminal and proceed accordingly.
Thank you.