History
- Version 1.1
- Version synchronized with USART driver component version
- Version 1.0
Instances
Hardware resource relating to CMSIS-Driver instance is shown in the table below:
| Driver Instance | Hardware Resource |
| Driver_USART1 | USART1 |
| Driver_USART2 | USART2 |
| Driver_USART3 | USART3 |
| Driver_USART4 | UART4 |
| Driver_USART5 | UART5 |
Limitations
STM32 HAL limitations:
- Manual control of modem lines is not supported
- Break character is handled as framing error
STM32CubeMX Setup
The CMSIS-Driver USART requires:
- Setup of USART/UART peripheral in IrDA mode
Valid settings for various evaluation boards are listed in the table below:
| Peripheral Resource | NUCLEO-G474RE |
| USART Peripheral | USART1 |
| USART Mode | IrDA |
| TX Pin | PC4 |
| RX Pin | PC5 |
For different boards, refer to the hardware schematics to reflect correct setup values.
The STM32CubeMX configuration for NUCLEO-G474RE with steps for Pinout, Clock, and System Configuration are listed below. Enter the values that are marked bold.
Pinout view
- Configure USART1 pins
- PC4: USART1_TX
- PC5: USART1_RX
Pinout & Configuration tab
- Under Connectivity open USART1:
- Section Mode
- Section Configuration
- Parameter Settings: not used
- User Constants: not used
- NVIC Settings: configured later
- DMA Settings: configured with DMA
- GPIO Settings: check used pins
- Under System Core open GPIO:
- Group By Peripherals - USART:
| Pin Name | Signal on Pin | GPIO mode | GPIO Pull-up/Pull.. | Maximum out.. | User Label |
| PC4 | USART1_TX | Alternate F.. | No pull-up and no.. | Very High | . |
| PC5 | USART1_RX | Alternate F.. | No pull-up and no.. | Very High | . |
- Under System Core open DMA:
- Section Configuration
- DMA1, DMA2
- Click on Add button and add requests as in table below:
| DMA Request | Channel | Direction | Priority |
| USART1_RX | DMA1 Channel 1 | Peripheral to Memory | Low |
| USART1_TX | DMA1 Channel 2 | Memory to Peripheral | Low |
- Under System Core open NVIC:
- Section Configuration
- NVIC
| NVIC Interrupt Table | Enabled | Preemption Priority | Sub Priority |
| DMA1 channel1 global interrupt | ON | 0 | 0 |
| DMA1 channel2 global interrupt | ON | 0 | 0 |
| USART1 global interrupt | ON | 0 | 0 |
Clock Configuration tab
- Configure USART1 Clock.
Project Manager tab
- Open Advanced Settings:
- enable Do Not Generate Function Call for MX_USART1_IRDA_Init.
- Note
- The CMSIS Driver:USART (API):USART component in the Manage Run-Time Environment dialog adds multiple C source files to the project. The interface selection in STM32CubeMX selects the actual implementation that is compiled: IrDA, SmartCard, UART, or USART.