Skip to main content
Associate
November 14, 2024
Question

USB device example

  • November 14, 2024
  • 4 replies
  • 6470 views

Hello everyone,

I have an stm32f303cbt6 design (see image below) connected to an hub(USB2533) and an adum for isolation, i'm trying to run a USB device CDC example by creating a new project in the Stm32CubeIDE using device tool configuration.

 

I selected :

- RTC : HSE Bypass clock source (24Mhz)

- SYS : Serial wire debug 

- USB : fs device

- Middleware : USB device CDC

 

When i build and i compil to my board, windows doesn't recognise it, can you help me with that ?

(i tried also to put the connect_usb pin to 3.3 V, i got same thing)

 

Thanks.

 

maac_0-1731928466754.png

 

 

 

4 replies

Andrew Neil
Super User
November 14, 2024

@maac wrote:

windows doesn't recognise it,


Does it not see it at all? give an error? other?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
maacAuthor
Associate
November 14, 2024

I don't have windows message.
I got this in USBTree (the hub has 3 downstream), it seems like the hub is detected but not the device (stm32).

maac_1-1731601411898.png

 

Andrew Neil
Super User
November 14, 2024

@maac wrote:

it seems like the hub is detected but not the device (stm32).


Is the device detected without the Hub ?

If you don't get any messages, and nothing appears in Device Manager, then the PC is not even seeing that anything has been plugged it.

Are you sure that you are using a good data cable - not just a charging cable?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
gbm
Lead III
November 14, 2024

Too little information give for a reasonable help, but maybe you should start by increasing the default stack and heap sizes to twice the value.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
maacAuthor
Associate
November 14, 2024

I gave informations as possible as i know, you can ask for information so i can put it.

The default configuration seems to make the USB detected at least, i don't undrestand what do you mean by increasing.

Andrew Neil
Super User
November 14, 2024

@maac wrote:

i don't understand what do you mean by increasing.


"increasing" = "making bigger/larger"

ie, Whatever size your Heap and Stack currently are, trying making them twice that size.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Technical Moderator
November 18, 2024

Hi @maac 

It seems USB root hub does not set address to your device. You need to ensure that the STM32 and the USB hub are properly powered.

  • Verify the connections between the STM32 and the USB hub. Ensure that the DP and DM lines are correctly connected and there are no short circuits.
  • Check the isolator connections to make sure it is properly isolating the USB lines without introducing signal integrity issues.
  • Ensure that the 24MHz crystal is properly connected and oscillating. Incorrect crystal connections can cause USB communication failures.

Follow the recommendations in the schematics provided in Nucleo F303 FBL_1-1731928128043.png

Provide USB traffic so that we can help you investigate further. In your case, using USBPcap in Wireshark could be helpful.

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
maacAuthor
Associate
November 18, 2024

As i said before, the current fw is a Vendor Specific device and it's running(at least it's detected by Windows and the PC software), So i don't think there is a problem in the design. I'm looking to change or get better(i don't know for the moment) that USB fw because there is no documentation about, and i'm trying to run examples first. I can't sniff the communication cause the USB is not detected as i said.

Andrew Neil
Super User
November 18, 2024

@maac wrote:

As i said before, the current fw is a Vendor Specific device and it's running.


So where has this FW come from?

Do you have the source? Do you have debug access? Do you have a contact for support?

 


@maac wrote:

 i'm trying to run examples first.


I would strongly suggest that you start by running the examples on the hardware they were intended for.

Then they should work, and you can spend time studying how they work.

If they don't work, you will be able to get support - as it's known hardware.

Once you understand how the examples work, then you'll be better equipped to find what's going wrong on your custom hardware - maybe it has other things which need to be enabled and/or configured ... ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
maacAuthor
Associate
December 13, 2024

Hello,

 

I'm back to know if you have any idea why a simple USB example can't work looking the schematics i sent knowing that there is a USB fw working on it that i want to change.

 

Thanks.

Andrew Neil
Super User
December 13, 2024

As suggested, have you got any examples working on the hardware they were intended for?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
maacAuthor
Associate
December 13, 2024

I will give a feedback when i'll try with a dev board.