cancel
Showing results for 
Search instead for 
Did you mean: 

How do i need to configure STM32H743 (I have NUCLEO-H743ZI) USB to see it as Serial Port?

esukh
Associate III

What I do now:

  1. Initialize all peripheral in Default mode (this is the dialogue option)
  2. USB_OTG_FS MODE: Device Only | Activate VBUS : VBUS sensing | Activate SOF
  3. USB_DEVICE (as middleware) Class For FS IP: Communication Device Class (Virtual Port Com)
  4. Default clock configuration (no changes from as it proposed by Cube)
  5. I generate it as Makefile

And just build it and flash it. The only COM port I saw it's ST-Link (com3)

As sanity check: usb cabel connected to both usb_connectors on board (not only to ST-Link micro usb) after connecting usb to main part of the board LD8 (green) lights up.

The blinking blue led just for debugging purposes, to make sure that board was flashed.

0690X000006BtOyQAK.png

But I don't see another COM port into device manager, only the ST-link one:

0690X000006BtPSQA0.png

1 ACCEPTED SOLUTION

Accepted Solutions
Khouloud GARSI
Lead II

Hello @esukh​ ,

Please make sure to increase the heap size.Using Keil for example, the heap size is 0x200 by default which is too low for USB applications.

Khouloud.

View solution in original post

8 REPLIES 8
esukh
Associate III

attachment:

I'd probably port

STM32Cube_FW_H7_V1.3.0\Projects\STM32H743I_EVAL\Applications\USB_Device\CDC_Standalone

Use the ST-LINK VCP to output diagnostic and telemetry information to understand if the device code is functioning or interacting with the system. Perhaps confirm if you can have it appear as a DFU device if you strap BOOT(0) High and connect.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
esukh
Associate III

I did, and my device manager discover some unknown usb device, but there is no description to it.

And this is really amaze to me, why does native example doesn't work correctly (I checked that all pins on EVAL board the same as on nucleo)

Khouloud GARSI
Lead II

Hello @esukh​ ,

Please make sure to increase the heap size.Using Keil for example, the heap size is 0x200 by default which is too low for USB applications.

Khouloud.

Khouloud GARSI
Lead II

Some other points to check:

  • Please make sure to call " HAL_PWREx_EnableUSBVoltageDetector(); " after "MX_USB_DEVICE_Init" function.
  • JP4 must be closed when using USB OTG FS.

Khouloud.

esukh
Associate III

Thank you!

Khouloud GARSI
Lead II

You're always welcome!

Khouloud.

AAnt.1
Associate II

Dear @esukh​ 

did your code start to work (you start to see two COM ports: from stlink and usb CN13 ) ?

I have the same probrem - i take my Nucleo STM32H743 board, open example for STM32H743 EVAL (generated by CUBE) USB_DEVICE/CDC_STANDLONE from STM site and program my board.

It doesn't work (

In code: "Heap_Size     EQU    0x1500" "Stack_Size      EQU    0x1500"

Chip is the same and i hoped, that code for EVAL board will work on NUCLEO board.

Could you explain what i need to change for: starting to see TWO com ports and code will start to work ?

My MAIN function:

 unsigned char text[20]="Hello 2021";

 /* Enable the CPU Cache */

 CPU_CACHE_Enable();

 HAL_Init();

 /* Configure the system clock */

 SystemClock_Config();

 /* Init Device Library */

 USBD_Init(&USBD_Device, &VCP_Desc, 0);

 HAL_PWREx_EnableUSBVoltageDetector();

 /* Add Supported Class */

 USBD_RegisterClass(&USBD_Device, USBD_CDC_CLASS);

 /* Add CDC Interface Class */

 USBD_CDC_RegisterInterface(&USBD_Device, &USBD_CDC_fops);

 /* Start Device Process */

 USBD_Start(&USBD_Device);

   USBD_CDC_RegisterInterface(&USBD_Device,&USBD_CDC_fops);

// my code

   USBD_LL_Init(&USBD_Device); // Idecided that wiil help to send data via com port to PC

   USBD_LL_DevConnected(&USBD_Device); // Idecided that wiil help to send data via com port to PC

 while (1)

 {

      USBD_LL_Transmit(&USBD_Device,0,text, 20); // Idecided that wiil help to send data via com port to PC

//      USBD_CDC_SetTxBuffer(&USBD_Device, text,20);

   //   USBD_CDC_TransmitPacket(&USBD_Device);

 }

Best regards.