STM32CubeIDE___USB - CDC ( Communication Device Class )

2020. 3. 2. 20:32STM32F/설정

0. External Clock

외부 클럭 사용설정

 

1. Clock Configuration

USB Clock - 48MHz

2. Pinout & Configuration - Connectivity - USB

 

USB GPIO

3. Pinout & Configuration - Middleware - USB_DEVICE

 

 

 

4. Code

  

printf 를 사용하기 위해서 밑에 구문을 추가한다.

#inlcude "string.h"

#include "usbd_cdc_if.h"

 

main.c

 

 

 

 

RX Interrupt 

usbd_cdc_if.c - CDC Receive

 

 

 

 

#include <stdio.h>

#include <stdlib.h>

#include <stdarg.h>

#include <math.h>

 

'STM32F > 설정' 카테고리의 다른 글

STM32CubeIDE___타이머로 ADC 주파수설정  (0) 2020.02.06
STM32CubeIDE___Hex File Output  (0) 2020.02.04
STM32CubeIDE___ADC - DMA Control  (0) 2020.01.20
STM32CubeIDE___TIM6 ( Up Counter )  (0) 2020.01.20
STM32CubeIDE___USART RX Interrupt  (0) 2020.01.20