Problem with Port

How to install STM32 core into the Arduino IDE, and any OS specific issues
wegrei
Posts: 11
Joined: Thu Jan 14, 2021 9:55 am
Location: Schliersee / Germany

Problem with Port

Post by wegrei »

Hi All,

I am pretty new to the microprocessor world and I am struggeling to connect my Black Pill to the Arduino IDE (Version 1.8.13).
Just a quick word what happens. I have installed everything in accordance to the instructions shown on following webpage:

https://www.sgbotic.com/index.php?dispa ... page_id=49

Almost everything is working fine so far. The system detects the right com port, I can ask for the Boardinformation, which shows board connected to Port COM4.
If I try to download the sample blink program without pressing the BOOTO and NRST buttons (press and hold BOOTO then press and release the NRST button, the release the BOOTO button), the IDE compiles the program but the upload failes. Following comment is comming up:

Error: Target device not found
Establishing connection with the device failed


If I do the same after pressing the buttons in sequence I immediatelly loose my COM4 port. Even in the Windows (10) hardware manager it shows that the STM is disabeled. After unplugging and reconnecting the hardware the Port is back again.

Made the same experience even with the Bluepill after installing the bootloader on it. With the ST-LINK2 I run into similar problems.

Anyhow I would like to stick with the blackpill as the bootloader is already preinstalled and I don not have to worry about that.

It seems to me that the problem might be driver related but not sure about that.

Does anybody has an idea?

Thanks and many greetings

Werner
by Jwolffbrandt » Sat Mar 26, 2022 1:43 am
Tie pin A10 to ground during the button presses to bootload.

Had the exact same problem and tried the same fixes. The only difference was I knew it worked when it wasn't on a bread board and it stopped working when I plugged it into an empty bread board. That made me think it was a floating pin issue. I moved a jumper around from ground to different pins and somehow it works if you ground out pin A10. (It also seems to work if you pull it to 5v). I don't know why this happens but I can replicate it over and over.
Go to full post
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: Problem with Port

Post by GonzoG »

If you reset F4x1 black pill into DFU mode (hardware USB bootloader) then it won't show as a COM port. It works in different mode. You need to select "STM32CubeProgrammer (DFU)" as upload method and have STM32CubeProgrammer installed.

There is HID bootloader for F411 black pill: https://github.com/Serasidis/STM32_HID_ ... -670308140
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Problem with Port

Post by stevestrong »

Or you need the appropriate drivers from STM, search for DFU driver.
wegrei
Posts: 11
Joined: Thu Jan 14, 2021 9:55 am
Location: Schliersee / Germany

Re: Problem with Port

Post by wegrei »

@ GonzoG
thanks for the advice. But if I am not wrong thats what I already do. I already do have the "STM32CubeProgrammer" installed and use already the "STM32CubeProgrammer (DFU)" upload method. As far as I know the BlackPill already has a hardware bootloader integrated, so I did not toutch that,

@ stevestrong
I also think it might be the driver. Tried all different ones I could find. I was also looking for the STM DFU Driver.

The funny thing is, If I plug the device in, it is getting recognized. As soon as I press the BOOTO and then the NRST it falls off, which can be seen on the device manager. After releasing the NRST and then the BOOTO button I get a windows warning that the USB device has not been recognized by Windows and therefore is not ready to use. In the device manager it gets the yellow warning mark. After un- and replugging it is there again. I guess I tried it 100 times. The funny thing is one time it worked and I could upload the blink program. The next time it refused to work again. So out of 100 trials it worked at least once (which gives me a little bit of hope). Maybe somebody knows a driver which works for sure. Would need some help to deinstall and install the right one, as I guess that there might be something in the background which screws everything up :shock: . Usually I remove the driver by deinstalling the device in the device manager. After plugging the device in it starts to install any driver automatically. I have no control over that. If I then would like to update the driver manually and point out the right directory, the system says that the best driver is already installed. Urgh.

Thanks guys so far...
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Problem with Port

Post by fpiSTM »

DFU drivers should be installed with the STM32Cube programmer.
For the CDC no need to have a dedicated drivers as it should use the default one for CDC available with windows.
Maybe an other driver conflict.
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: Problem with Port

Post by GonzoG »

wegrei wrote: Fri Jan 15, 2021 4:43 pm @ GonzoG
thanks for the advice. But if I am not wrong thats what I already do. I already do have the "STM32CubeProgrammer" installed and use already the "STM32CubeProgrammer (DFU)" upload method. As far as I know the BlackPill already has a hardware bootloader integrated, so I did not toutch that,
Ok. Resetting those boards into DFU can be tricky. First time it took me about 2 days to get any of 12 boards to work :x
I think it might be something with those buttons. I've re-done solders on them, but not sure if it was this or any of many other things I've tried and now it works almost every time.

Try resetting without releasing BOOT0 button.
After it boots into DFU mode it should show as "STM32 BOOTLOADER" in device manager
Attachments
stm32 dfu.png
stm32 dfu.png (9.09 KiB) Viewed 14495 times
wegrei
Posts: 11
Joined: Thu Jan 14, 2021 9:55 am
Location: Schliersee / Germany

Re: Problem with Port

Post by wegrei »

Thanks,

will try to do that.
wegrei
Posts: 11
Joined: Thu Jan 14, 2021 9:55 am
Location: Schliersee / Germany

Re: Problem with Port

Post by wegrei »

@ fpiSTM
will try to do that again. As I have installed the STM32 CubeProgrammer the installation of the driver started automaticly. The same result. How can I do that again without de- and reinstalling the STM32CubeProgrammer?
wegrei
Posts: 11
Joined: Thu Jan 14, 2021 9:55 am
Location: Schliersee / Germany

Re: Problem with Port

Post by wegrei »

@ GonzoG
in your picture the real STM32 BOOTLOADER shows up. I could not manage to install that. In my configuration I only get serial USB-Device (COM6). So that seems to be the standard Windows driver.
failure.JPG
failure.JPG (19.09 KiB) Viewed 14477 times
wegrei
Posts: 11
Joined: Thu Jan 14, 2021 9:55 am
Location: Schliersee / Germany

Re: Problem with Port

Post by wegrei »

After releasing the NRST button (to go into boot mode) I get this message (sorry in German):
Windows message.JPG
Windows message.JPG (22.45 KiB) Viewed 14476 times
Post Reply

Return to “Installation and OS related”