cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F105 USB Code 43

John Arn
Associate II
Posted on June 15, 2017 at 11:05

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.

5 REPLIES 5
Khouloud GARSI
Lead II
Posted on June 15, 2017 at 17:27

Hi

,

The D+ line is pulled up to 3.3V with 1.5K resistor

-> Please remove this resistor: In the

http://www.st.com/content/ccc/resource/technical/document/reference_manual/59/b9/ba/7f/11/af/43/d5/CD00171pdf/files/CD00171pdf/jcr:content/translations/en.CD00171pdf

, 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:

  • Set the bit 'FDMOD' in 'OTG_FS_GUSBCFG' to 1. This will force the OTG_FS core to work as a USBperipheral-only. In this case, the ID line is ignored even if present on the USB connector.
  • Keep the ID pin floating and configure it as shown below:

    /* 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 '

http://www.st.com/content/ccc/resource/technical/document/user_manual/02/66/fa/ac/78/e4/4f/18/CD002124pdf/files/CD002124pdf/jcr:content/translations/en.CD002124pdf

' schematic to make sure you're respecting the required hardware connection.

Please let me know if this solves your issue.

Khouloud.

John Arn
Associate II
Posted on June 15, 2017 at 21:50

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(); ).

Posted on June 16, 2017 at 11:50

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.

  • I have previously advised you to refer to the 'STM3210C_EVAL' schematic. Is your hardware connection compliant with the one used for the EVAL board?
  • For further debug, you may share your project (or your .ioc file since you're using the CubeMX tool) and I will test whether it's operational using our boards or not.

Khouloud.

John Arn
Associate II
Posted on June 16, 2017 at 14:07

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.

Posted on June 16, 2017 at 14:14

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.