Please Do This ...
1) Config your usart and enable RX interrupt (9600,1,1) on CubeMX.
2) Select "General peripheral Initalizion as a pair of '.c/.h' file per peripheral" on project settings.
3) Config your RFID_Config.h file.
4) Add RFID_CallBack() on usart interrupt routin.
5) Call RFID_Init().
6) Put RFID_Loop() in your main or a task.
Example:
#include "RFID.h" . . void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { if(huart->Instance == USART2) { RFID_CallBack(); } } . . int main() { . . RFID_Init(); . . while(1) { . . RFID_Loop(); . . }