2025-01-07 07:40 AM - last edited on 2025-01-07 08:26 AM by Mike_ST
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.
Ive enabled interrupts
Basic parameters
Cant change anything about GPIO
Configured the middleware
And descriptors
Theres not a whole lot running on there, and the pins look okay to me?
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!
2025-01-07 08:44 AM
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:
2025-01-08 04:33 AM
I guess that would do it!...
Thanks for your help