Unknown USB device

STM32duino bootloader aka Maple bootloader
N5BOC
Posts: 2
Joined: Wed May 06, 2020 9:47 pm

Unknown USB device

Post by N5BOC »

I have installed the boot loader using an STLINK2. That part appears to be working because upon plugging my board into USB, I get the FAST blinks, followed by a perpetual slower blink. The problem appears to be with windows. I beleive it is supposed to show up in the Device Manager as a DFU device. I instead am getting it showing up as "Unknown USB Device ( Device Descriptor Request Failed ). I read somewhere last night what appeared to be the answer, and that was that Windows needed to have a stub driver installed. That was while I was laying in bed looking at my phone. Of course today I can't find that again. So if that is indeed the problem, I don't know what driver they are speaking of, nor where to get it from. But it makes sense that it shows up as unknown device because it doesn't know to link it to some kind of DFU driver.

Any help for someone new to this would be appreciated.

Regards,
David

stevestrong
Posts: 196
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 5
Location: Munich, Germany
Contact:

Re: Unknown USB device

Post by stevestrong »

Which bootloader have you installed?
Which board do you use?

N5BOC
Posts: 2
Joined: Wed May 06, 2020 9:47 pm

Re: Unknown USB device

Post by N5BOC »

I have tried several bootloaders actually. This includes the Maple bootloader and The board is one of my own designs. But I've tried to work through this using a Blue Pill as well. Same results.
The last bootloader loaded is labeled generic_boot20_pc13. I do have an LED on PC13. It does do the super fast blink on powerup and then a slightly slower flash after about 500ms. So I feel like the boot loader is in there okay and working as expected.

All bootloaders have been installed using an ST-LINK2. I started working on pulling stuff together to use an FTDI device and the UART to load the bootloader. Most of the documents I find on the Web use this as an example. No one seems to just use an ST-LINK. I don't understand why not really.

While someone that knows something is reading this, with the generic bootloader named "generic_boot20_pc13" What is the boot20 indicating? I assume where it is jumping to in flash to start execution of the program.

Man have I ever got a lot to learn here. :-)
I really appreciate any help.

stevestrong
Posts: 196
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 5
Location: Munich, Germany
Contact:

Re: Unknown USB device

Post by stevestrong »

boot20 indicates bootloader version 2.0

You have to install the drivers from here: https://github.com/rogerclarkmelbourne/ ... rivers/win
Launch the batch files with admin rights.

On the other hand, if the USB says descriptor request failed, it may indicate a hw problem.
Has your cable data lines? I often see micro USB cables with only power lines connected.

kejuqeju
Posts: 7
Joined: Sat May 09, 2020 6:55 am

Re: Unknown USB device

Post by kejuqeju »

Hello there..i am quite new with bluepill STM32F103 board.
Here what i've done
1. i bought 4 bluepill board (china), and changed the 10K resistor to 1K5 resistor
2. i bought 2 STLINK downloader
3. i have 2 USB cable
4. download Roger Clark's Arduino_STM32-master, copied and unzipped it to Documents\Arduino\hardware
5. download generic_boot20_pc13.bin
6. set the BOOT0 jumper to 0 (GND)
7. turned on the bluepill using USB cable which was connected to my laptop
8. flashed the bin file using command line stlink (i think that using STLINK, it doesnt care if the BOOT0 jumper set to 0 or to 1) and succeeded.
9. if i unplug and replug the USB cable, the LED on PC13 was blinking fast and then blinking slow, and then OFF (as expected)
10. ran install_drivers.bat in folder drivers, succeeded.
11. windows recognized the device as Maple Serial (COMxx)
12. i opened Arduino IDE, open blink LED sketch from examples
13. i changed PB (port B) to PC13
14. i set the board to Generic STM32F103 series, set upload method : serial, and set the COM Port
15. compile success,but when i uploaded the HEX, error happened :
Error probing interface "serial_w32"
stm32flash 0.4
Cannot handle device "COM11"
Failed to open port: COM11
http://stm32flash.googlecode.com/
16. i thought that this was because the bluepill is on RUNNING MODE (not bootloader MODE)
17. i unplugged the USB cable, switch BOOT0 to 1 (VCC 3.3V), and replugged the USB cable
18. after that, windows had error, USB device not recognized.
19. i was confused, i thought that : Maple serial driver is serial driver when RUNNING MODE, and MAple-DFU driver is serial driver when bootloader MODE.
20. i turned bluepill off (unplug the USB cable), set the BOOT0 jumper to 0, and then replugged the cable. Windows recognized again as Maple Serial.
21. i tried with other STLINK, bluepill, and USB cable. the result is always the same.
22. But if i tried to flash the blink code to bluepill using external USB to serial TTL (TX & RX connected to PA9 & PA10) in bootloader mode, it succeeded.
so my problem is, i failed to have the USB bootloader working, because when in bootloader MODE, windows cannot recognize the device.
what did i do wrong here?

stevestrong
Posts: 196
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 5
Location: Munich, Germany
Contact:

Re: Unknown USB device

Post by stevestrong »

If you use the bootloader, then the appropriate upload method (step 14) to select in Arduino IDE is "Stm32duino bootloader", and not serial.

fredbox
Posts: 59
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: Unknown USB device

Post by fredbox »

N5BOC wrote:
Fri May 08, 2020 3:08 am
No one seems to just use an ST-LINK. I don't understand why not really.
I've used the various bootloaders and for the most part they are more trouble than they are worth. I use an ST-LINK for uploading and SerialUSB for debugging. If a project is buried inside an enclosure that makes access to the ST-LINK pins difficult, then a bootloader makes sense. Otherwise you don't need one for the common pill type boards. Upload times with the ST-LINK are only a couple of seconds for many programs. Both boot jumpers stay at 0. Once you install the bootloader, it is difficult to upload with the ST-LINK.

kejuqeju
Posts: 7
Joined: Sat May 09, 2020 6:55 am

Re: Unknown USB device

Post by kejuqeju »

stevestrong wrote:
Sat May 09, 2020 5:51 pm
If you use the bootloader, then the appropriate upload method (step 14) to select in Arduino IDE is "Stm32duino bootloader", and not serial.

i changed the upload method to stm32duino bootloader, the result was the same.
i think the problem is that windows cannot detect the device (unknown device). i use win xp, win 7, and win 10. the results all are the same.

but i found the cause of the problem just now.
i made wrong asumption, i thought that if i set the BOOT0 jumper to 1 and press reset, bluepill will enter the bootloader Mode.
it turned out that it didn't enter bootloader mode (LED PC13 blinking fast, blingking slow, and off), that's why the DFU is not working and windows cannot detect the usb device.

now my question is
1. if i set BOOT0 to 1 and press reset, to which address does the code pointer jump ?
2. at which address does generic_boot20_pc13 start?

stevestrong
Posts: 196
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 5
Location: Munich, Germany
Contact:

Re: Unknown USB device

Post by stevestrong »

There are two different bootloaders.
If you set BOOT0 to 1, then the integrated ROM bootloader will be activated, address 0x1fff0000 I think
If you leave BOOT0 on 0, then the FLASH bootloader will be active at 0x08000000, but this bootloader only stays in this state if BOOT1 is set or there is no user code at 0x08002000 or there is a magic code in backup register 10. Otherwise it will jump directly to the user code.

kejuqeju
Posts: 7
Joined: Sat May 09, 2020 6:55 am

Re: Unknown USB device

Post by kejuqeju »

stevestrong wrote:
Sun May 10, 2020 8:58 am
There are two different bootloaders.
If you set BOOT0 to 1, then the integrated ROM bootloader will be activated, address 0x1fff0000 I think
If you leave BOOT0 on 0, then the FLASH bootloader will be active at 0x08000000, but this bootloader only stays in this state if BOOT1 is set or there is no user code at 0x08002000 or there is a magic code in backup register 10. Otherwise it will jump directly to the user code.
ok thank you, i got the point. now i understand the bootloading process
so when running on BOOT0 = 0, roger's bootloader code will be executed at 0x08000000

Post Reply

Return to “USB bootloader”