Issue with STM32F1 Blue Pill and USB

Post here first, or if you can't find a relevant section!
tawy
Posts: 5
Joined: Thu May 06, 2021 8:29 am
Answers: 1
Location: France

Issue with STM32F1 Blue Pill and USB

Post by tawy »

Hello,

I have a problem with my blue pill, i uploaded the bootloader generic_boot20_pc13.bin to the board using a ST-Link V2 and the STM32 St-Link Utility, verify everything and this step seems to be OK. after replacing the jumpers on 0, i remove the board from the programmer, connect the board on a known working micro usb cable, connect it on my main computer and the board is not recognized (VID_0000) :( i tried on another computer (a laptop) and on this one seems to be OK, even if i cant install Arduino_STM32 drivers on this laptop, the VID of the USB connected item is (sometimes) correct USB\VID_1EAF&PID_xxxx > Vendor ID, 1eaf. Vendor Name, Leaflabs OK !

I have 3 blue pills, all of them react the same way, the pullup resistor is ok (R10 = 152), connecting on DFU mode is OK

I can upload a bootloader without any issues, but connecting it on micro USB for uploading a sketch with arduino IDE is impossible :(

Does a hardware hack is possible to make the board more viable when connecting on micro USB ? is it possible to connect the board on USB without using the micro USB port ? It will be strange that all 3 of the boards have solder problems, they really seems clean and the DFU mode works :-/

i need help :(

thank you
by tawy » Fri May 21, 2021 8:54 am
I bought another pills and those one work fine. It is really a issue with the first one.
Here is a picture of the 2 items, they looks fine, even if the PCB is not the same, the components seems to be well soldered.
Image Image

The one on the left (black jumpers and floating microusb) doesnt work at all on USB. I tried USB2, USB3, USB with a cheap hub... they are randomly recognized as a USB device. I bought them on the best seller on aliexpress, "SZ Aitexm Store". I am maybe unlucky, on the 3 bought at this store none are working. with 1600+ review and 95% 5stars satisfaction i thought i can buy safely, i was wrong... 2 bought on "All goods are freeshipping Store" on aliexpress works flawlessly. after doing something like 100 upload and test with upload sketch with arduino ide, testing the new one was easy. it work like it was to be.

thank you to you for tring to help me. it was a hardware issue.
trust no one. even if 1600+ worth 95% of the positive reviews.

thank you.
Go to full post
stevestrong
Posts: 476
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Issue with STM32F1 Blue Pill and USB

Post by stevestrong »

You don't need to change BOOT0, leave the jumper all the time on 0, and flash the bootloader again.
Which PID is shown on the working laptop?
The 0003 is the PID for the DFU mode, and 0004 for CDC serial.
tawy
Posts: 5
Joined: Thu May 06, 2021 8:29 am
Answers: 1
Location: France

Re: Issue with STM32F1 Blue Pill and USB

Post by tawy »

Hello, thank you for your answer.

I succeed booting into DFU mode on my main computer, I did connect the USB cable directly to the USB port on the motherboard, on the front panel it is random :-/

this is the V/PID of the device found when on DFU : USB\VID_1EAF&PID_0003\LLM_003

Did I miss something ? I follow a lot of tutorial and all seems to be easy to follow. The steps are always the same : write the .bin with the programmer and a software (i use st-link utility, it's the only one working on my computer :-/), check/verify the integrity, remove the programmer, connect the micro usb.

on DFU, it works but when i try on with the bottom jumper on 0, it does not...
fredbox
Posts: 123
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: Issue with STM32F1 Blue Pill and USB

Post by fredbox »

I'm of the opinion that for most people, the bootloader on STM32 blue pills adds an unnecessary layer of complexity/flakiness.
Bootloaders tend to disable the SWD pins so you can't upload again with an ST-Link unless you move the jumpers or press the reset button at the right time.

For an Arduino board, the bootloader is usually necessary and well-behaved, but not so much on the blue pills.

If you need USB, enable the CDC serial port and upload your program using your ST-Link. Windows and Linux automatically detect the CDC USB port without needing a special driver. (Been a while since I tried it on Windows). I usually have both the ST-Link and the USB cable connected at the same time. Some advise to leave the 3.3V pin from the ST-Link disconnected but I've never found it to cause any problems so I leave it connected.

Both jumpers stay at position 0 while you are testing your program.
tawy
Posts: 5
Joined: Thu May 06, 2021 8:29 am
Answers: 1
Location: France

Re: Issue with STM32F1 Blue Pill and USB

Post by tawy »

those board drive me crazy !

i've just remove the "windows signature enforcement" (? i dont know how to call it in english) to install the drivers and after that, the boards does not work at all on my laptop ! the sketch upload is ok with the st-link, but the boards are not recognized anymore by my computer on USB.
before the installation of the driver, the boards are seen as USB\VID_1EAF&PID_0004, USB Serial Peripheral COM4 but after installation, they are seen as USB\VID_0000&PID_0002 :(
with Maple DFU mode, it is always OK on each computer.
a driver can do that ? or am i just unlucky...

i will order another board to test, those ones will be used without micro USB and arduino... in my situation, i did test with every jumper on every position, left on 0 0, 0 1, 1 0, 1 1, leaving the jumper before connecting on microusb on each, changing them when powered, or when disconnected, push reset everytime i can...

i have to push reset before connecting the board to st-link, if i dont do that, i cant upload the bootloader.
stevestrong
Posts: 476
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Issue with STM32F1 Blue Pill and USB

Post by stevestrong »

As I said, always leave the jumpers on default positions "0" (GND).

It is known that USB3 ports do have problems with the board, so better use USB2 only.
Flash this BIN file with STLink, or better with STM32CubeProgrammer. If you use/install the latest, it will also install the serial drivers.
After a reset you should be able to open a COM port ans see some message in the serial monitor.
ag123
Posts: 807
Joined: Thu Dec 19, 2019 5:30 am
Answers: 4

Re: Issue with STM32F1 Blue Pill and USB

Post by ag123 »

agree with fred, if you have a st-link you might as well use it.
no need to play with boot pins, no need boot loader etc
just install the sketch firmware and reset.

i used the maple (roger's) dfu boot loader only because i prefer to simply use a usb cable to upload my sketch.
but if you re struggling with the dfu boot loader say with windows drivers, you could just make do with st-link instead.
dfu, usb-serial works perfectly in linux, each time every time
the only notion is one less dongle to install a sketch

or alternatively you could use Nucleo boards, and run the 'official' stm core instead
Nucleos has a st-link on board and you have many mcu's to choose from
tawy
Posts: 5
Joined: Thu May 06, 2021 8:29 am
Answers: 1
Location: France

Re: Issue with STM32F1 Blue Pill and USB

Post by tawy »

I bought another pills and those one work fine. It is really a issue with the first one.
Here is a picture of the 2 items, they looks fine, even if the PCB is not the same, the components seems to be well soldered.
Image Image

The one on the left (black jumpers and floating microusb) doesnt work at all on USB. I tried USB2, USB3, USB with a cheap hub... they are randomly recognized as a USB device. I bought them on the best seller on aliexpress, "SZ Aitexm Store". I am maybe unlucky, on the 3 bought at this store none are working. with 1600+ review and 95% 5stars satisfaction i thought i can buy safely, i was wrong... 2 bought on "All goods are freeshipping Store" on aliexpress works flawlessly. after doing something like 100 upload and test with upload sketch with arduino ide, testing the new one was easy. it work like it was to be.

thank you to you for tring to help me. it was a hardware issue.
trust no one. even if 1600+ worth 95% of the positive reviews.

thank you.
stevestrong
Posts: 476
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Issue with STM32F1 Blue Pill and USB

Post by stevestrong »

You could eventually try to re-solder the USB pins, it may help.
tawy
Posts: 5
Joined: Thu May 06, 2021 8:29 am
Answers: 1
Location: France

Re: Issue with STM32F1 Blue Pill and USB

Post by tawy »

the usb connector is properly soldered, i did a continuity test with a multimeter and everything is ok.
Post Reply

Return to “General discussion”