cancel
Showing results for 
Search instead for 
Did you mean: 

No DFU detected, usb device not recognized code 43

HaYa6174
Associate II

I am trying to create a custom keyboard, and I was trying to flash my board with stm32f070c6t6 MCU in DFU mode using cube programmer, but I keep getting "no DFU detected" (of course while pulling BOOT0 pin high).

Also, every time I plug my device into my PC, the error message says, "Windows has stopped this device because it has reported problems (Code43). A request for the USB device descriptor failed."

 

I am new to this field, so I am running out of ideas.

 

I put 16MHz crystal and set up 48MHz for USB, I configured the device description based on this website; https://controllerstech.com/how-to-use-stm32-as-a-keyboard/

I pulled up D+ with a 1k5 resistor, I pulled down both CC1 and CC2 with 5k1 resistors. 

 

Screenshot 2025-01-16 at 3.06.15.png

  

I checked the voltage on the regulator and found it was totally fine (both 3v3 and 5v). I also checked the soldering and made sure that no pins were bridging.

I managed to flash the chip using STlink recently, but since this board is designed to be a keyboard, I expect the USB to work fine.

I am feeling so stuck, I have already spent like a total of 10 hours trying to figure it out, so it will be really helpful if someone tells me where I made a mistake.

Thanks.

26 REPLIES 26

I checked the datasheet, and I am pretty sure that those were not mixed up. (PA12: D+, PA11: D-) 

Also, pin speed is not configurable apparently.

I will try removing C18.

I removed the C18, but it did not work... no DFU target + no USB error

Edit: no USB error meant the error "USB device not recognized", sorry for my *** explanation... 

 

This is my PCB design for a USB data line... I hope this routing is ok...

Screenshot 2025-01-16 at 23.23.37.png

Routing looks ok...so far, i can see it; just at U5 : is the line D+/- here connected inside this chip ? did you check continuity ?

+

read:

AScha3_0-1737041384579.png

> no USB error

Good. So its doing nothing now...also nothing wrong. :) So try power up  with boot0 hi... and see dfu in CubeProgrammer...

 

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

According to the datasheet from ST, USBLC6-2SC6 (the U5 chip) is internally connected (at least that is what I thought). 

https://www.st.com/content/ccc/resource/technical/document/datasheet/06/1d/48/9c/6c/20/4a/b2/CD00050750.pdf/files/CD00050750.pdf/jcr:content/translations/en.CD00050750.pdf

 

I am unsure what I should do for the datasheet for the device bootloader. Should I erase my code before trying DFU mode?

 

And sorry for my poor explanation, still I am getting the same error :(

You don't need to erase, if bootloader running, you can flash, erase etc.

Just on your layout, D- close to CPU has a via, but there is also another connection to red track and to a pin. What is this?

Can you look with a scope to the signal at the CPU pins, to prove the signal looks ok?

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

Screenshot 2025-01-17 at 9.48.13.png

 Sorry for the late reply!

Here is the close-up.
the orange line on the USBD- via is just a silksceen.

Hi @HaYa6174 

  1. It's crucial to measure the exact lengths to ensure they are within the acceptable tolerance.
  2. The differential pair should have a controlled impedance: 90ohms differential. Ensure that the trace width and spacing are properly designed. Check your PCB stack-up and dielectric material.
  3. Spacing between the D+ and D- traces should be consistent throughout their length to maintain impedance.
  4. Avoid sharp bends and minimize Vias
  5. Maintain isolation from other high-speed signals and ensure good ESD design

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


Thank you for the info.

I used KiCad's differential routing tool, assuming those traces are almost the same length and maintaining close distance, and I also tried to minimize sharp corners and vias.
I also tried not to allow any other traces to cross the USB data line, and when I needed to do so, I made sure that it crossed perpendicular to the USB data line.


But, I am not sure about the 90ohm impedance rule; I knew that it existed, but I am not sure how to actually achieve that.

What should I do?

Afaik in kicad main menu is tools/... , pcb tools or so, there is a impedance calculator

(track width x distance to ground plane in pcb material -> approx. impedance )

+ no need to match this +/- 1 ohm ; just it should be in range 70...110 ohms (center of range is 90 ohms).

Because it should match the cable , as good as possible, so it should be :

>

The USB 2.0 specification stipulates an impedance between 76.5 and 103.5 Ω for the cable when measured during differential transmission.

<

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

I searched a little about this and tried to calculate using the KiCad calculator tool. Then I got Zeven: 189.26 and Zodd: 67.822.

This is mostly because I designed the board with only 2 layers, meaning that the distance between the ground plane and D+- was about 1.6mm (the board thickness)...

 

I assume those numbers aren't great, should I redesign it with 4 layers?