cancel
Showing results for 
Search instead for 
Did you mean: 

USB CDC on NUCLEO-G491RE

ArmadilloChubbz
Visitor

Hi,

Apologies in advance for my ignorance. 

I have a NUCLEO-G491RE and want to use it as a USB CDC. Unfortunately I haven't had any success getting it to work. My problem is that doesn't even appear to show as a device on the host.

I have looked at several other posts which seem similar. On the one post, they seemed to fix it with a resistor and some extra wiring, but apparently that is only for F series? I also tried increasing the stack and heap size to 2048 as suggested on another post - but still the same.

I know the cable and other USB stuff is working, because the on-board stlink shows up - and I can use a serial port through that. To make sure it wasnt some conflict with the stlink, I disabled it by adding the JP1 jumper. And still nothing showed on the host.

The code is using the generated STM HAL code and drivers and freeRTOS. It is calling the MX_USB_Device_Init();

 

 

 

void StartDefaultTask(void *argument)
{
  /* init code for USB_Device */
  MX_USB_Device_Init();
  /* USER CODE BEGIN 5 */
  /* Infinite loop */

  AppMain();

  for(;;)
  {
    osDelay(1);
  }
  /* USER CODE END 5 */
}

 

 

 

 

I believe the clocks are configured correctly, and have tried using both the crystal enabled and disabled. 

ArmadilloChubbz_0-1736263863320.pngArmadilloChubbz_1-1736263885929.png

 

Ive enabled interrupts

ArmadilloChubbz_2-1736263951093.png

 

Basic parameters

ArmadilloChubbz_3-1736263982443.png

 

Cant change anything about GPIO

ArmadilloChubbz_4-1736263996651.png

 

Configured the middleware

ArmadilloChubbz_5-1736264105614.png

 

And descriptors

ArmadilloChubbz_6-1736264127516.png

 

Theres not a whole lot running on there, and the pins look okay to me?

ArmadilloChubbz_7-1736264178760.png

 

As I understood it, as long as we call the MX_USB_Device_Init() in the main it should just show up on a ttyACMx port in Ubuntu?

 

If anyone has a clue to what I might be missing, if I have done something daft I would greatly appreciate some pointers. The code is just the standard generated from CubeMX, but I can post the full listing if it helps at all.

Thanks!

 

 

2 REPLIES 2
Mike_ST
ST Employee

Hello,

The NUCLEO-G491RE board doesn't have a USB port that is connected to the USB-DP and USB-DM pins of the STM32G491 (PA11/PA12).

The USB port on the top only gives a debug interface to program/debug the G491 and a serial port to communicate with the G491.

You can't create a CDC interface using that port.

You would like to use boards that presents two ports like the following ones to program a CDC interface over the bottom connector:

NUCLEO H533 

NUCLEO U545 

 

I guess that would do it!...

Thanks for your help