STM32F407 USB CDC
개발 환경 및 실습도구
- Software
- STM32CubeIDE 1.16.1
- Repository: STM32Cube_FW_F4_V1.28.1
- Hardware
- STM32F407VET6
- ST-Link V2
- mini-usb cable
STM32CubeMX
STM32F407VET 실습보드에는 2개의 USB 포트가 있습니다. 하나는 mini-USB 포트로 MCU의 USB_OTG_FS(Full Speed)와 연결되어 있습니다. 다른 하나는 USB A 포트로 MCU의 USB_OTG_HS(High Speed)와 연결되어 있습니다.


USB_OTG_FS를 통해 디버깅 정보를 출력하는 예제를 작성해보겠습니다.
Pinout & Configuration
System Core
- SYS
- RCC
- High Speed Clock (HSE): Crystal/Ceramic Resonator
Connectivity
-
USART1
- USART1 Mode and Configuration
- Mode: Asynchronous
- Hardware Flow Control (RS232): Disable
- Configuration
- Parameter Settings
-
Basic Parameters:
- Baud Rate: 115200 Bits/s
- Word Length: 8 Bits (including Parity)
- Parity: None
- Stop Bits: 1
-
Advanced Parameters:
- Data Direction: Receive and Transmit
- Over Sampling: 16 Samples
-
GPIO Settings

-
USB_OTG_FS
- Mode: Device_Only
- Configuration
- Parameter Settings:
- User Constants:
- NVIC Settings:
- GPIO Settings: