Skip to main content
Associate II
November 7, 2023
Solved

USB CDC Port Not Shown In Device Manager(MCU STM32F!103RET6)

  • November 7, 2023
  • 4 replies
  • 11972 views

Hello Everyone,

Right now i am facing the issue on detection USB.I am attaching snap shots of the my USB configuration.

USB port not shown after powering up the board. i am doing some basic thing like on receiving via USB in RX interrupt function of USB i set one flag that will used in main function for further process.

Help Me if anyone knows the issue, i stuck here since 2 days.

STMCubeIDE Version:- 1.13.2

MCU:- STM32F103RET6

Debugger:- Jlink(4000Khz)

USB DP:- PA12

USB DM :-PA11

Internal Power Supply used which is given to MCU and other board peripheral.

 

 

 

Screenshot 2023-11-07 120759.pngScreenshot 2023-11-07 120821.pngScreenshot 2023-11-07 120821.pngScreenshot 2023-11-07 114158.png

Screenshot 2023-11-07 114440.pngScreenshot 2023-11-07 114453.pngScreenshot 2023-11-07 114503.pngScreenshot 2023-11-07 114523.pngScreenshot 2023-11-07 114543.png

This topic has been closed for replies.
Best answer by gbm

If there is a need to increase stack and heap size, make them at least 1024 bytes or more. Pullup resistor is required only with F1 series. The built-in USB bootloader is not present in F103, so some of the information you provide is false or at least incomplete.

4 replies

gbm
Lead III
November 7, 2023

Check the USB cable and the operation/frequency of quartz oscillator. Some versions of USB stack may require increased stack or heap size - set both to 2048 just in case. And, as I wrote many times in the past, calling USB Transmit from the main loop will sooner or later hang the USB stack, but it's another story - deal with it after the device is detected.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Associate II
November 7, 2023

Hi gbm,

thank you for response ,As you suggest me i check the oscillator frequency and it is 16mhz. i will let you know after changing heap and stack size to 2048.

any thing else you know about this?

Associate II
November 7, 2023

No detection despite of changing the buffer size to 2048 Bytes

gbm
Lead III
November 8, 2023

So maybe you should use The Force... I mean the debugger. Comment out your ecu-related calls, leaving only USB initialization, then check what happens.

My wild guess: continuous ADC conversion causes continuous ADC interrupts consuming all the CPU time with no time left for any other processing.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Associate II
November 9, 2023

Thanks gbm ,i tried by creating test project in which i run USB only and find the same as before. other then that i have same project with stm32f0 series there USB works fine.is there any issue with the stm32 SDK?

gbm
Lead III
November 9, 2023

Increase the stack and heap size in CubeMX project settings. The RX and TX buffer size settings in CubeMX are pure nonsense - only 64 bytes of RX buffer are ever used and the TX buffer is not used at all.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Piranha
Principal III
November 8, 2023
Associate II
November 9, 2023

can you explain me more about what your point of view because i am not able to understand properly i am slightly new to USB

Piranha
Principal III
November 9, 2023

@Smit Italiya wrote:

can you explain me more about what your point of view because i am not able to understand properly i am slightly new to USB


That is not a "point of view", but a concrete code with issues explained. If you don't understand, then you have to start with learning the basics. You are not new to USB, you are new to everything in microcontrollers. And you are not slightly new, you are an absolute beginner.

https://www.embeddedrelated.com/showarticle/453.php

AScha.3
Super User
November 9, 2023

is there a 1k5 pullup on usb DP ?  ( otherwise no enumeration starting...)

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II
November 9, 2023

as per schematic no pull up on DP pin, It is mandatory to detect USB?  

AScha.3
Super User
November 9, 2023

yes.  

 

ie.   R6 1k5

AScha3_0-1699520408357.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."