2025-05-03 6:38 AM - last edited on 2025-05-07 12:24 PM by Andrew Neil
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!
Solved! Go to Solution.
2025-05-09 2:40 PM
@tibaal You might be onto something.
I have the Nucleo-G071RB that I've written code for and using a GPS Click module. There were never any hiccups with the FW running correctly.
I now have this setup as shown below. I ported the code over from the G071RB to this G431KB project. I do see that the NUCLEO-G431KB does not interrupt consistently every time I plug in the USB connector. I have the FW pass data from the GPS(USART1) to the VCP(USART2). Sometimes the GPS will interrupt and the code will pass the strings to the VCP port and sometimes it doesn't interrupt.
At the same time, I could never get the VCP to receive commands after plugging in the USB connector. I have to push the reset button on the Nucleo and most of the times the VCP receives commands just fine, but then the GPS doesn't interrupt.
To get both USART1 and USART2 to interrupt consistently, I just enabled pull-up on the RX pins. So give that a try to see if you get interrupts working.
I should test if the G431RB shows the same behavior as the G431KB.
2025-05-24 10:10 AM
Thank you,
Recently, I re-checked the PB7 pin with an oscilloscope and I had a surprise. The voltage level on this pin is 500mV for high level and 0V for low levels. It's not because of pullups because the GPS works in push-pull.
When I am in debug mode or when I press the reset button, the voltage level is 3.3V but it's when I upload the program that the voltage drops. On the nucleo G431KB, PB7 is connected to PA5, so I declared this two pin as GPIO inputs and the problem was still here. So I tried to upload a blank program with nothing in it and the problem was also still there.
My theory is that the bootloader or something like this set PB7 or PA5 as output low level.
2025-05-24 11:44 AM
So set pullups ON , for PB7 + PA5 ;
>My theory is that the bootloader or something like this
...maybe, but when your program runs, the pins will be at the state you set in your init/program.
2025-05-26 7:01 AM
I FOUND WHAT WAS WRONG
it was the function BSP_Led_Init(LED_GREEN),
Without it all is good
Thank you all