cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L496 No USB communication, internal pull-up not set

Addinfect
Associate

Hello community,

I am having some problems getting USB to work on a STM32L496. Maybe you can help me or have some tips for me.

I have designed a custom board that should provide access to some sensors and the CAN bus via USB as a COM interface.
The board is powered via USB.

As far as I could tell, the microcontroller was supposed to enable the internal pull-up resistor to D+, but this never happened. So no USB communication is established.

The software is generated via the .ioc file. I used the USB_DEVICE package. And tested it with and without V_USB sensing.
The settings: Device_Only, Full Speed and is configured as CDC.

What have I tried so far?
- I checked the voltages of D+ and D- with a logic analyser. Nothing...
- After powering up the microcontroller there are 2 interrupts in the HAL_PCD_IRQHandler, first the ConnectCallback and then the ResetCallback. As far as I know, the ConnectCallback occurs when the V_USB is detected. (The ConnectCallback end up in "USBD_LL_DevConnected()" which is empty, is this correct?)
- I have checked the clocks. I am using HSE with an 8MHz oscillator. The microcontroller is running at 80MHz. I tried the HSI48 and 48MHz over PLL as input for the 48MHz clock for USB, but nothing changed. Looked into the code, __HAL_RCC_USB_OTG_FS_CLK_ENABLE() is called.
- When I add an external pull-up, my computer detects something, but can't communicate with the device. 

As far as I know, there is no register for the pull-up that I can look up? This is completely handled by the hardware?

Does anyone have an idea why the pull-up is not enabled? Is Hardware damaged?
What event must be triggered, that the pull-up will be enabled?

2 REPLIES 2
gbm
Lead III

Disable VBUS sensing - it's not needed for basic app.

Reset means that the device was detected by host, so don't worry about pullup.

Make sure to increase the stack and heap size to 2x the default value.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

Thanks for the reply!

I disabled the VBUS sensing and doubled (and tripled) the stack and heap size. Nothing...

I also checked the USB communication with wireshark. No packets were send if I connect the USB cable.

I activated the NOE Pin. If i measure correctly (have at the moment only  a voltmeter, but all pins left and right are not used) the pin drives 3.3V. 
There is not much information about the NOE-Pin, but if this is correct (https://community.st.com/t5/stm32-mcus-embedded-software/usb-noe-what-is-it-for-exactly/td-p/90891), the pin should be low if the USB-PHY is active.
So my USB-PHY is not enabled...

 

I attached my .ioc settings:

Addinfect_0-1730740921788.png

Addinfect_1-1730741025148.png

Addinfect_3-1730742594524.png

 

 

Do you have any other ideas?