2024-11-01 03:52 AM
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?