cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo-L042K6 USB HID not working from code generated by Stm32CubeIDE/MX, Any ideas?

I've started with an new project targeted for the Nucleo-F042K6 board and configured the following in the device configuration graphical tool:

1) Assign pins 11 and 12 to USB_DM and USB_DP respectively.

2) Open up middleware and enabled USB_device by double clicking it. Set the "Class For FS IP" value to "Human Interface Device Class (HID)"

3) Selected the "Clock Configuration" tab at the top of the screen and allowed automatic clock configuration when asked.

4) Saved the file and clicked yes to generate code.

On the device itself I have connected up the following to the USB cable:

+5v to +5v on the cable

PA_11 to D+ on the cable

PA_12 to D- on the cable

GND to GND on the cable

Next I build the cod and run it (it stops on the first line of main which is expected so I click resume to run the code).

I then plug in the USB cable into the computer (Windows 10) and run up the "USB Device Viewer (Found as part of the windows debug tool set).

The problem is there is no device reported. So questions:

* Has anyone else seen this?

* Has anyone out there found a solution?

* Is there some way of having this show up?

* What else have I either done wrong or I could try to diagnose this issue?

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

Ok, feel rather stupid now, I unpacked the board and started using it straight away however there is a jumper fitted to the top side of the board that shorts out PA_12 (D+) to ground which means that we will not be working.

Removed the jumper and everything works just fine. Hopes this helps anyone else who is seeing this problem.

Just out of interest, is there any reason that this jumper would be fitted from the factory?

View solution in original post

1 REPLY 1

Ok, feel rather stupid now, I unpacked the board and started using it straight away however there is a jumper fitted to the top side of the board that shorts out PA_12 (D+) to ground which means that we will not be working.

Removed the jumper and everything works just fine. Hopes this helps anyone else who is seeing this problem.

Just out of interest, is there any reason that this jumper would be fitted from the factory?