Dear Sir,
I am using the the demo code of keil for USB HID for my custom made board. I have successfully uploaded the code to the controller. But when i connect the device to PC, it doesn't recognize the device. It shows the error usb device connected is malfunctioned. I am using windows 7- 64bit. What should i do? Can you help me in this? Thanks in advance.
Regards, Deepak
> my custom made board > It shows the error usb device connected is malfunctioned.
Sound like hardware problem. Check the connections of USB D+/D- pins of the MCU to the USB connector. Aren't these connection swapped?
Anyway, what is the MCU?
Tsuneo
Dear Tsuneo,
I have checked the connections with the reference schematic of MCBSTM32. It is exactly the same. The controller I am using is STM32F103RE. The same problem is occurring in the Mass Storage device demo also.
Deepak
What is the crystal frequency? MCBSTM32 mounts 8 MHz crystal.
I am also using 8Mhz crystal.
That is to be expected if it is, in fact, a hardware fault.
Ok, the last check is switching of the pull-up resistor and bus reset detection.
1) Load the USBHID example to your MCU 2) Run uVision debugger 3) Reset the MCU on the debugger 4) Place a break point in the USB ISR, at bus reset handler,
usbhw_STM32F10x.c /* * USB Interrupt Service Routine */ void USB_LP_CAN1_RX0_IRQHandler (void) { U32 istr, num, val; istr = ISTR; /* USB Reset Request */ if (istr & ISTR_RESET) { USB_Reset(); // <--- place a break point here
4) start your firmware on the debugger
You should see - Windows detect "unknown" device - Above break point meets
If you see these responses, the pull-up resistor and bus reset detection work fine.
Even if your device passes this test, swapped D+/D- connection is still suspicious.
Thanks Tsuneo. I'll do this and will let you know the status.