cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103CBT6 not recognized USB device

CXR
Associate II

It is not recognized as a USB device. What did I do wrong or miss?
IC: STM32F103CBT6

CXR_0-1713470218159.png

 

1. Is the distance between USB D+ and PA12 (Pin 33) and USB D- and PA11 (Pin 32) long?
The distance from USB D+ to PA12 and USB D- to PA11 is approximately 35 mm (1,384 mil) each.
The distance between R1 (0 Ω) on USB D+ and R3 (0 Ω) on USB D- is each approximately 6 mm (25 mil).

2. Are bias resistance (4.7k ~ 10k) required for USB D+ and USB D-?
USB D+ and USB D- use 5V TVS (D3, D4) and decoupling (C94, C95) is 6.8pF each.

3. Is the USB VCC connection incorrect?
5V+ is connected to J16 (excluded from the picture as it may cause crosstalk), and the external power or USB VCC is connected to 3.2V through R21 (2.7kΩ) and R22 (4.7kΩ) to PB3 (Pin 39).

Remove C68, R53, L7 and connect directly to GND or
Remove AR3, L4 and connect directly to GND or
Removing D3, D4 and C94, C95 results in it not being recognized as a USB device.

CXR_1-1713470237176.png

 

CXR_2-1713470250179.png

 

CXR_3-1713470264226.png

USBD_DFU_MEDIA Interface: @Internal Flash /0x08000000/03*016Ka,01*016Kg,01*064Kg,07*128Kg,04*016Kg,01*064Kg,07*128Kg

CXR_4-1713470275015.png

CXR_5-1713470295732.png

 

The program used the source code created in STM32CubeIDE and only modified main() in main.c.
The main() function contents are as follows:

int main(void)
{

/* USER CODE BEGIN 1 */
typedef void (*pFunction)(void);
uint32_t JumpAddress;
void (*Jump_To_Application)();
/* USER CODE END 1 */

/* MCU Configuration--------------------------------------------------------*/

/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();

/* USER CODE BEGIN Init */

/* USER CODE END Init */

/* Configure the system clock */
SystemClock_Config();

/* USER CODE BEGIN SysInit */

/* USER CODE END SysInit */

/* Initialize all configured peripherals */
MX_GPIO_Init();
/* USER CODE BEGIN 2 */

if (HAL_GPIO_ReadPin(Firmup_Pin_GPIO_Port, Firmup_Pin_Pin) != GPIO_PIN_RESET)
{
if (((*(__IO uint32_t*)USBD_DFU_APP_DEFAULT_ADD - 1) & 0x2FFFB000 ) == 0x20000000)
{
JumpAddress = *(__IO uint32_t*) (USBD_DFU_APP_DEFAULT_ADD + 4);
Jump_To_Application = (pFunction) JumpAddress;
__set_MSP(*(__IO uint32_t*) USBD_DFU_APP_DEFAULT_ADD);
Jump_To_Application();
}
}

MX_USB_DEVICE_Init();

/* USER CODE END 2 */

/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{

/* USER CODE END WHILE */

/* USER CODE BEGIN 3 */

}
/* USER CODE END 3 */
}

 

3 REPLIES 3
AScha.3
Chief II

I am tired...but what i see: 1k5 pullup is needed on F103 , but to +3,3V ! NOT to 5 V !

+

remove the useless caps C94, 95

+

the blue pill boards have R1 , 3 not 0 , but 22 ohm.  Try this.

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

Thanks for your advice, I try this.

CXR
Associate II

I changed the R1 and R2 resistances from 10 to 470Ω, but it still doesn't work.
We tested it on the 103CBT, F401X, F411, F412, H5, and H7 series with the changed configuration, but got the same results, so we suspect it is a crystal problem and plan to test it with STM32 recommended HSE, LSE Crystal.