Dear ST staff,
I found a small bug in CubeMX 4.12.0.
Although I don't use latest CubeMX, I contribute this discussion, becasuse RereaceNote of CubeMX says the bug is still existing.
The bug is at SMARTCARD_Receive_IT() on stm32f4xx_hal_smartcard.c.
At line 5, and 6,
tmp = (uint16_t*) hsc->pRxBuffPtr;
*tmp = (uint16_t)(hsc->Instance->DR & (uint16_t)0x00FF);
But, hsc->pRxBuffPtr points 8bit variable, so neighber valiable is destroyed in this substitution.