STM32-OTG-CDC: Difference between revisions

From Embedded Workshop
Jump to navigation Jump to search
(Created page with "Using '''STM32CubeMX''', Choose: * New Project-> Start My project from ST Board -> ACCESS TO BOARD SELECTOR -> in Commercial Part Number box, type "NUCLEO-F446RE" * Double-cli...")
 
No edit summary
Line 21: Line 21:
   
   
  UART2 will be used as a serial debug port, already connected to the STM32-F103 JTAG hardware, to function as a USB Com Port
  UART2 will be used as a serial debug port, already connected to the STM32-F103 JTAG hardware, to function as a USB Com Port
* "Clock Configuration" tab - a pop-up dialog, Clock configuration, asks "Do you want to run automatic clock issues solver "?, select "Yes"
For USB, a 48 MHz clock is required.  The automatic clock solver should adjust parameters such that the output clock, "To USB (MHz)" indicates 48 MHz.
'''Links to reference material:'''
https://www.youtube.com/watch?v=h9T0RTu9Muc&ab_channel=STMicroelectronics  - 48 minutes, poor audio
https://www.youtube.com/watch?v=7oED-m34EKk&ab_channel=MutexEmbedded-Education - 8 min, 44 seconds,

Revision as of 10:37, 18 July 2021

Using STM32CubeMX, Choose:

  • New Project-> Start My project from ST Board -> ACCESS TO BOARD SELECTOR -> in Commercial Part Number box, type "NUCLEO-F446RE"
  • Double-click the NUCLEO-F446RE board in the lower right section
  • "Initialize all peripherals with their default Mode ?" - Select "Yes"
  • "Pinout & Configuration" tab, select Connectivity -> USB_OTG_FS -> Mode -> Device_Only
At this point, USB pins get selected and configured
PA11  "USB_OTG_FS_DM"
PA12  "USB_OTG_FS_DP"
  • "Pinout & Configuration" tab, select Middeleware -> USB_DEVICE -> "Class For FS IP" -> "Communication Device Class (Virtual Port Com)"
  • "Pinout & Configuration" tab, select Connectivity -> UART2 - This should already be selected, and configured as follows:
Mode: Asynchronous
Hardware Flow Control (RS232): Disable
Basic Parameters
  Baud Rate: 115200
  Word Length: 8 Bits (including Parity)
  Parity: None
  Stop Bits: 1
Advanced Parameters
  Data Direction: Receive and Transmit
  Over Sampling: 16 Samples

UART2 will be used as a serial debug port, already connected to the STM32-F103 JTAG hardware, to function as a USB Com Port
  • "Clock Configuration" tab - a pop-up dialog, Clock configuration, asks "Do you want to run automatic clock issues solver "?, select "Yes"
For USB, a 48 MHz clock is required.  The automatic clock solver should adjust parameters such that the output clock, "To USB (MHz)" indicates 48 MHz.
Links to reference material:
https://www.youtube.com/watch?v=h9T0RTu9Muc&ab_channel=STMicroelectronics  - 48 minutes, poor audio
https://www.youtube.com/watch?v=7oED-m34EKk&ab_channel=MutexEmbedded-Education - 8 min, 44 seconds,