STM32Cube MCU Package for STM32F0 Series -v1.9.0
The STM32F030CC has 6 USARTs. USART1 and USART2 have separate interrupts. USART from 3 to 6 have one common interrupt. Apparently, STM32-MAT/TARGET searches for individual interrupts for each USART, because the code generated for USART1 and USART2 works correctly (via interrupts), but for USART3-USART6, STM32-MAT/TARGET generates the code as if they were working without interrupts, in polling mode (HAL_UART_Receive function). At the same time, the interrupt handler for USART3_6 is generated by the "Cube", but is not used during operation. It turns out completely incorrect work of the code.
That is, STM32-MAT/TARGET does not accept USART with common interrupts as working on interrupts. This is even seen in the Simulink USART blocks - Interrupt checkbox is unfilled for USART3 - USART6.
Here we use interrupts in Cube:
STM32-MAT/TARGET does not perceive them:
Add the following lines to the file *.ioc:
In Simulink blocks the Interrupt checkbox will be filled:
2. Save the file and change its properties to "Read only", because the code generator tries to overwrite the file with the original one and removes added lines. The code generator will curses (just click OK), but the process will be successful.