Page 1 of 3

Problem with Port

Posted: Thu Jan 14, 2021 10:20 am
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

Re: Problem with Port

Posted: Thu Jan 14, 2021 11:41 am
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

Re: Problem with Port

Posted: Fri Jan 15, 2021 9:39 am
by stevestrong
Or you need the appropriate drivers from STM, search for DFU driver.

Re: Problem with Port

Posted: Fri Jan 15, 2021 4:43 pm
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...

Re: Problem with Port

Posted: Fri Jan 15, 2021 7:33 pm
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.

Re: Problem with Port

Posted: Fri Jan 15, 2021 9:35 pm
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

Re: Problem with Port

Posted: Sat Jan 16, 2021 7:05 am
by wegrei
Thanks,

will try to do that.

Re: Problem with Port

Posted: Sat Jan 16, 2021 7:08 am
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?

Re: Problem with Port

Posted: Sat Jan 16, 2021 7:29 am
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 16644 times

Re: Problem with Port

Posted: Sat Jan 16, 2021 7:33 am
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 16643 times