STM32Cube  Version 2.0
Create Projects for STM32F7 Series with STM32Cube HAL and STM32CubeMX
 All Files Pages
CMSIS-Driver USART Setup

The CMSIS-Driver USART requires:

  • Setup of USART/UART mode (Asynchronous, Synchronous, Single wire, IrDA or SmartCard)
  • Optional configuration of Hardware Flow Control (only in Asynchronous mode).

The example below uses correct settings for STM32F746G-Discovery:

  • USART1 Mode: Asynchronous
  • Hardware Flow Control: Disable

For different boards, refer to the hardware schematics to reflect correct setup values.

The STM32CubeMX configuration steps for Pinout, Clock, and System Configuration are listed below. Enter the values that are marked bold.

Pinout tab

  1. Configure USART1 mode
    • Peripherals USART1: Mode=Asynchronous, Hardware Flow Control=Disable
  2. Configure USART1_TX pin (is not the default pin):
    • Click in chip diagram on pin PA9 and select USART1_TX.

Clock Configuration tab

  1. Configure USART1 Clock.

Configuration tab

  1. Under Connectivity open USART1 Configuration:
    • optional DMA Settings: setup DMA transfers for Rx and Tx (DMA is optional)
      Add - Select USART1_RX: Stream=DMA2 Stream 2, DMA Request Settings: not used
      Add - Select USART1_TX: Stream=DMA2 Stream 7, DMA Request Settings: not used
    • GPIO Settings: review settings, no changes required
      Pin Name Signal on Pin GPIO mode GPIO Pull-up/Pull..Maximum out User Label
      PB7 USART1_RX Alternate Pull-up High .
      PA9 USART1_TX Alternate Pull-up High .
      - NVIC Settings: enable interrupts
      Interrupt Table Enable Preemption Priority Sub Priority
      USART1 global interrupt ON 0 0
      DMA2 stream2 global interrupt ON 0 0
      DMA2 stream7 global interrupt ON 0 0
      - Parameter Settings: not used
    • User Constants: not used
    • Click OK to close the USART1 Configuration dialog