2017-06-15 02:05 AM
Hello,
I have problem with my custom board with STM32F105 MCU - I'm using STM32Cube with HAL drivers.
I would like to use USB on my board as device - CDC (I've got everything set up in STM32Cube - I'm using default values), the problem is that everytime I connect it to the USB port it doesn't recognize my MCU - Code 43 Device not recognized.
The D+ line is pulled up to 3.3V with 1.5K resistor, I've got 22 ohm resistors on D+ and D- line, ID is connected to GND, and the GND is connected to GND of the MCU.
I've tried connecting VBus pin to PA9 ( VBus - sense ) pin with no results.
And by the way the CDC drivers are fully working because I tried it with my STM32F4 Discovery board with USB OTG connector.
2017-06-15 08:27 AM
Hi
,The D+ line is pulled up to 3.3V with 1.5K resistor
-> Please remove this resistor: In the
, it's mentioned that DP/DM pull-up and pull-down resistors are already integrated and controlled by the OTG_FS core depending on the current role of the device. You may refer to section 'Full-speed OTG PHY' to have more details about this.ID is connected to GND, and the GND is connected to GND of the MCU
Please use one of those configurations:
/* Configure ID pin */ GPIO_InitStruct.Pin = GPIO_PIN_10; GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; GPIO_InitStruct.Pull = GPIO_PULLUP; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);�?�?�?�?�?
Also I advise you to refer to the '
' schematic to make sure you're respecting the required hardware connection.Please let me know if this solves your issue.
Khouloud.
2017-06-15 12:50 PM
Hi Kholoud G,
So I've desoldered the resistor, my computer doesnt recognize my board anymore.
I am a bit stuck here, should I set the mode to 'Device Only' or 'OTG/Dual_Role_Device', I've tried setting it to
'OTG/Dual_Role_Device', but the STM32CubeMX doesn't support it and the initialization function is empty ( MX_USB_OTG_FS_USB_Init(); ).
2017-06-16 04:50 AM
Hi John,
I would like to use USB on my board as device
-> Thus, you should use the 'device only' mode.
Note: The STM32CubeMX does not support the configuration of OTG/Dual_Role_Device mode. This mode should be configured manually by the user.
Khouloud.
2017-06-16 05:07 AM
I feel so stupid right now, I'm sorry for wasting your time.
It was my fault, I switched the D+ line with D- line in Eagle CAD,
I cut
and switched the traces and now it's working perfectly fine.
I greatly appreciate your help Kholoud G.
2017-06-16 07:14 AM
Hi John,
Happy that the issue is solved
If you have further questions, please do not hesitate to post them on our STM32 MCUs forum.
Khouloud.