Hello.
I started my adventure with STM32F4 programming.
I have purchased the XNUCLEO-F401RE plate (compatible with NUCLEO-F401RE)
and I took the course at this link
http://forbot.pl/blog/artykuly/programowanie/kurs-stm32-f4-7-komunikacja-przez-uart-id13472
Well, I did the same step by step as instructed in the course, but for me the program performs the function
HAL_UART_RxCpltCallback only once, then the main program loop still works and sending another
mark to UART has no effect.
Below is the code. The code also includes an SPI configuration because my project
it is also to use this way of communication.
In the main function, I call
HAL_UART_Receive_IT (& huart2, & Received, 1); without which receiving a character from UART does not go to callback at all.
In the main function and in HAL_UART_RxCpltCallback I assigned myself the auxiliary variables Temp and Temp2 which
I watch in STM Studio.
The effect of the code below.
The main loop works all the time.
HAL_GPIO_TogglePin (LED2_GPIO_Port, LED2_Pin); - turns on and off the LED
You can see in STM Studio how the Temp variable is being incremented.
After sending any character by UART:
In STM Studio, I can see the Temp2 value being increased by 1
Another LED lights up - HAL_GPIO_TogglePin (LED1_GPIO_Port, LED1_Pin);
Once again I see how the Temp2 value increases by 1 and is currently 2.
The Received variable receives a valid value from the UART
the end.
Sending more bytes to the UART changes nothing in the interrupt
The LED1 diode is lit continuously, the variable Temp2 is always equal to 2.
I am asking for help to a beginner.
Regards and thank you in advance.
I started my adventure with STM32F4 programming.
I have purchased the XNUCLEO-F401RE plate (compatible with NUCLEO-F401RE)
and I took the course at this link
http://forbot.pl/blog/artykuly/programowanie/kurs-stm32-f4-7-komunikacja-przez-uart-id13472
Well, I did the same step by step as instructed in the course, but for me the program performs the function
HAL_UART_RxCpltCallback only once, then the main program loop still works and sending another
mark to UART has no effect.
Below is the code. The code also includes an SPI configuration because my project
it is also to use this way of communication.
In the main function, I call
HAL_UART_Receive_IT (& huart2, & Received, 1); without which receiving a character from UART does not go to callback at all.
In the main function and in HAL_UART_RxCpltCallback I assigned myself the auxiliary variables Temp and Temp2 which
I watch in STM Studio.
The effect of the code below.
The main loop works all the time.
HAL_GPIO_TogglePin (LED2_GPIO_Port, LED2_Pin); - turns on and off the LED
You can see in STM Studio how the Temp variable is being incremented.
After sending any character by UART:
In STM Studio, I can see the Temp2 value being increased by 1
Another LED lights up - HAL_GPIO_TogglePin (LED1_GPIO_Port, LED1_Pin);
Once again I see how the Temp2 value increases by 1 and is currently 2.
The Received variable receives a valid value from the UART
the end.
Sending more bytes to the UART changes nothing in the interrupt

The LED1 diode is lit continuously, the variable Temp2 is always equal to 2.
I am asking for help to a beginner.
Regards and thank you in advance.
Code: C / C++