cancel
Showing results for 
Search instead for 
Did you mean: 

my it UART doesn't work

tibaal
Visitor

Hello,
I am working on a project with a Nucleo-G431KB. I am using UART1 to receive GPS data (LEA-6S module, 9600 baud, 3.3V) on pin PB7 (RX), and I send data to a LoRa module (Ebyte E32868T20 module, 3.3V,  9600 baud too) on PB6 (TX).
I configured UART1 in asynchronous mode with interrupts enabled (USART1 global interrupt active).
In my code, I call HAL_UART_Receive_IT(&huart1, &recep, 1) at startup, and I relaunch HAL_UART_Receive_IT at the end of HAL_UART_RxCpltCallback().

The GPS sends data correctly (tested with a direct connection) and the lora module works too (tested by sending text every 3 seconds), but on the Nucleo, the UART interrupt never seems to trigger.

I give you my main.c and my .ioc file

Any idea what could block the UART RX interrupt on the G431KB?

Thanks!

1 REPLY 1
AScha.3
Chief III

Hi,

basically it should work, but :

- did you enable callback in Cube ?

- on any error uart will stop working - and then..?

You need callback on receive + error :

void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart)
{
	printf("UART7 error testvar hex %ld \n ",testvari);
	// *** ... try again
	HAL_UART_Receive_IT(&huart7,  &ESP_RX[ESP_RX_COUNT], 1);					
}
If you feel a post has answered your question, please click "Accept as Solution".