Raspberry Pi cannot detect Blue Pill (STM32)

305 views
Skip to first unread message

ERobot

unread,
Apr 26, 2021, 12:49:20 PM4/26/21
to HomeBrew Robotics Club
Hello,

I have been using my notebook computer to program blue pill (STM32) MCU with Arduino IDE, basically following this link https://www.onetransistor.eu/2020/01/stm32-bluepill-arduino-support.html, and all things have been working nicely. 

After the works, I connected blue pill (on micro USB) with Raspberry Pi (on USB) with a USB cable, and two devices have been communicating with each other without problems, at least for many months.   From Raspberry Pi terminal, when I used the command "ls /dev/tty*" and I was able to see the blue pill device, for example, it will show up "/dev/ttyUSB0" for blue pill.

I have not played the devices for some time, and suddenly, my raspberry pi can not detect the blue pill at all, and I am not able to solve the mystery for so many days.  In summary, the issue is that Raspberry cannot detect blue pill at all.    

If you have any ideas of the problem, please advise me.  Thank you.

Eric 

Michael Wimble

unread,
Apr 26, 2021, 2:01:40 PM4/26/21
to hbrob...@googlegroups.com
Two things:
The command ‘lsusb’ will list the devices connected to the usb busses. If the device doesn’t show there, there is a hardware or cable problem. 

USB devices do NOT keep the same names every time you plug a device in. It may be ttyUSB0 one time, ttyUSB1 the next, and so forth. To get the same name every time, use the ‘udev’ system to force a name, access rights, and so on. 

On Apr 26, 2021, at 9:49 AM, ERobot <eric.c...@gmail.com> wrote:

Hello,
--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/304c4945-18cd-48da-bef7-9db347d8f9f0n%40googlegroups.com.

jsam...@pobox.com

unread,
Apr 26, 2021, 2:36:03 PM4/26/21
to hbrob...@googlegroups.com
Do a dmesg command after you plug in the Blue Pill to see what it thinks about it at a low level. Also, I would expect the Blue Pill to register as a ACMx device as opposed to a USBx device.

Jeff Sampson


Marco Walther

unread,
Apr 26, 2021, 4:56:34 PM4/26/21
to hbrob...@googlegroups.com
Try a *powered* USB hub. and look at dmesg & lsusb as others have
suggested. But I have seen so many different issues as manifestation of
too little power:-( Even a different cable can push things 'over the
edge' when it's close.

-- Marco
>
> Eric
>
> --
> You received this message because you are subscribed to the Google
> Groups "HomeBrew Robotics Club" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hbrobotics+...@googlegroups.com
> <mailto:hbrobotics+...@googlegroups.com>.
> <https://groups.google.com/d/msgid/hbrobotics/304c4945-18cd-48da-bef7-9db347d8f9f0n%40googlegroups.com?utm_medium=email&utm_source=footer>.

jsam...@pobox.com

unread,
Apr 26, 2021, 6:04:55 PM4/26/21
to hbrob...@googlegroups.com
Also verify you are not using a USB charging cable as opposed to a USB data cable. (I mark my charging cables with red tape when I find one. Else it comes back to bite me.)

Although it does not address your immediate problem, you may want to look at this method instead of using the JLink or serial cable programming:
I did successfully program a Blue Pill with this bootloader and it appeared to work like a "normal" Arduino. I could upload code through the USB and do serial communication through the USB. I didn't play with it enough to determine how much support the libraries have for the Blue Pill...

Jeff Sampson



--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+unsub...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/4acb01dd-d8bd-734a-e3aa-e45de579e371%40gmail.com.

Chris Albertson

unread,
Apr 26, 2021, 7:36:53 PM4/26/21
to hbrob...@googlegroups.com
Others have said to try "lsusb" on there Pi and see if the Blue Pill is detected.     Another test is to plug the bluepill into any PC and see if it is detected. Also verify that your Pi can detect other USB devices.  One of the USB ports either the Pi or Pill might be broken.

Also the bluepill does not come with a USB boot loader you have to load one.   Is a bootloader installed?

Finally one last USB related thing:  There are many known issues see the list of them here:
Of the issues, I'd check the solder and the resister after verifying the port on the Pi is good.

Solution:   Try a Raspbery Pi "Pico".    I bought a couple of there recently and THESE are now the best device in this class I've ever seen.    Yes they cost twice as much ($4 not $2) but worth it.   They are much more powerful then a blue pill and very well documented.   Very detailed technical data is provided.   At $4 they are still cheap.





--
You received this message because you are subscribed to the Google Groups "HomeBrew Robotics Club" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hbrobotics+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hbrobotics/304c4945-18cd-48da-bef7-9db347d8f9f0n%40googlegroups.com.


--

Chris Albertson
Redondo Beach, California

Sergei Grichine

unread,
Apr 27, 2021, 8:07:28 AM4/27/21
to hbrob...@googlegroups.com
I've had similar effects with other boards, which were cured by switching to a better quality USB cable and plugging it to a different USB slot.

Best Regards, 
-- Sergei Grichine 

Chris Albertson

unread,
Apr 27, 2021, 11:58:14 AM4/27/21
to hbrob...@googlegroups.com
Yes, I forgot about the cable.  That is the first thing to suspect.   Not long ago I some how got hold of a USB "charging cable".  In these cables, there are only two conductors and the data pins are unconnected.   They look exactly like real USB cables.

ERobot

unread,
Apr 28, 2021, 12:12:09 AM4/28/21
to HomeBrew Robotics Club

1.      On my notebook, I followed this link, https://www.onetransistor.eu/2020/01/stm32-bluepill-arduino-support.html , and I was able to load that simple Arduino blink code to blue pill with a ST-LINK-V2 dongle, and I was able to see the LED was blinking.  But when I connect the blue pill to Raspberry Pi with an USB cable, RPI cannot detect the blue pill.  I tried a few blue pills, and the results are same.  For this method, I am not sure a bootloader is loaded to blue pill.

2.      Again, on the same computer, I followed another similar link, https://www.onetransistor.eu/2017/11/stm32-bluepill-arduino-ide.html.  After I load the same Arduino blink program, it shows an error message, “error resetting after download : usb_reset: could not reset device, win error: a device which does not exist was specified”.   The LED was not blinking.  But when I connect the blue pill to Raspberry Pi with the same cable, RPI detects the blue pill.  For this method, I believe a boot loader is loaded to the blue pill, but unfortunately I was not able to make the Arduino blink program working.

3.      Finally, I tried this link, https://circuitdigest.com/microcontroller-projects/getting-started-with-stm32-blue-pill-development-board-stm32f103c8-using-arduino-ide, with a FTDI programmer to load the Arduino blink program to blue pill.  The LED is blinking, but when I connect the blue pill to raspberry pi with an USB cable, the raspberry cannot detect blue pill.

With (1) and (3), I am able to load the Arduino code to blue pill, but raspberry pi cannot detect blue pill.  With (2), raspberry pi can detect the blue pill, but the Arduino code is not successfully loaded. 

It seems there is a bug for raspberry pi to connect with blue pill with an usb cable, as below link, and I have not found a solution.  http://stm32duinoforum.com/forum/viewtopic_f_22_t_4276_start_10.html

Eric 

Marco Walther

unread,
Apr 28, 2021, 2:37:14 AM4/28/21
to hbrob...@googlegroups.com
On 4/27/21 9:12 PM, ERobot wrote:
> 1. On my notebook, I followed this link,
> https://www.onetransistor.eu/2020/01/stm32-bluepill-arduino-support.html
> <https://www.onetransistor.eu/2020/01/stm32-bluepill-arduino-support.html>
> , and I was able to load that simple Arduino blink code to blue pill
> with a ST-LINK-V2 dongle, and I was able to see the LED was blinking.
> But when I connect the blue pill to Raspberry Pi with an USB cable, RPI
> cannot detect the blue pill.

Can 'your computer' detect the blue pill on USB for this case? It should
be able to see the same as the RasPi?!

-- Marco

> I tried a few blue pills, and the results
> are same.  For this method, I am not sure a bootloader is loaded to blue
> pill.
>
> 2. Again, on the same computer, I followed another similar link,
> https://www.onetransistor.eu/2017/11/stm32-bluepill-arduino-ide.html
> <https://www.onetransistor.eu/2017/11/stm32-bluepill-arduino-ide.html>.
> After I load the same Arduino blink program, it shows an error message,
> “error resetting after download : usb_reset: could not reset device, win
> error: a device which does not exist was specified”.   The LED was not
> blinking.  But when I connect the blue pill to Raspberry Pi with the
> same cable, RPI detects the blue pill.  For this method, I believe a
> boot loader is loaded to the blue pill, but unfortunately I was not able
> to make the Arduino blink program working.
>
> 3. Finally, I tried this link,
> https://circuitdigest.com/microcontroller-projects/getting-started-with-stm32-blue-pill-development-board-stm32f103c8-using-arduino-ide
> <https://circuitdigest.com/microcontroller-projects/getting-started-with-stm32-blue-pill-development-board-stm32f103c8-using-arduino-ide>,
> <https://www.onetransistor.eu/2020/01/stm32-bluepill-arduino-support.html>,
> and all things have been working nicely.
>
> After the works, I connected blue pill (on micro USB)
> with Raspberry Pi (on USB) with a USB cable, and two
> devices have been communicating with each other without
> problems, at least for many months.   From Raspberry Pi
> terminal, when I used the command "ls /dev/tty*" and I
> was able to see the blue pill device, for example, it
> will show up "/dev/ttyUSB0" for blue pill.
>
> I have not played the devices for some time, and
> suddenly, my raspberry pi can not detect the blue pill
> at all, and I am not able to solve the mystery for so
> many days.  In summary, the issue is that Raspberry
> cannot detect blue pill at all.
>
> If you have any ideas of the problem, please advise me.
> Thank you.
>
> Eric
>
> --
> You received this message because you are subscribed to
> the Google Groups "HomeBrew Robotics Club" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to hbrobotics+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hbrobotics/304c4945-18cd-48da-bef7-9db347d8f9f0n%40googlegroups.com
> <https://groups.google.com/d/msgid/hbrobotics/304c4945-18cd-48da-bef7-9db347d8f9f0n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
>
>
> --
>
> Chris Albertson
> Redondo Beach, California
>
> --
> You received this message because you are subscribed to the
> Google Groups "HomeBrew Robotics Club" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to hbrobotics+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hbrobotics/CABbxVHvdeqjJBs2BkKeSfqMEmLaj%3DpH94whO-n25DBAtFgAdww%40mail.gmail.com
> <https://groups.google.com/d/msgid/hbrobotics/CABbxVHvdeqjJBs2BkKeSfqMEmLaj%3DpH94whO-n25DBAtFgAdww%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the
> Google Groups "HomeBrew Robotics Club" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to hbrobotics+...@googlegroups.com.
>
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hbrobotics/CA%2BKVXVNP%2BtHfwiwzadW-O_-tDZRfjFUsy0RmurbxCaEXee%3DONw%40mail.gmail.com
> <https://groups.google.com/d/msgid/hbrobotics/CA%2BKVXVNP%2BtHfwiwzadW-O_-tDZRfjFUsy0RmurbxCaEXee%3DONw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
>
>
> --
>
> Chris Albertson
> Redondo Beach, California
>
> --
> You received this message because you are subscribed to the Google
> Groups "HomeBrew Robotics Club" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hbrobotics+...@googlegroups.com
> <mailto:hbrobotics+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hbrobotics/9b256a53-c6d0-4f49-852f-d83848876173n%40googlegroups.com
> <https://groups.google.com/d/msgid/hbrobotics/9b256a53-c6d0-4f49-852f-d83848876173n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Ralph Gnauck

unread,
Apr 28, 2021, 1:21:28 PM4/28/21
to HomeBrew Robotics Club
I think the Blue Pill board will only be recognized as a USB device if it has code on it that implements a USB device. It does not have any hardware USB interface - It relies on code running on the STM to enumerate as a USB Device.

The LED Blink sample may not implement any USB functions
See if there is any other example that make the blue pill act as a USB device (USB serial converter for example).

Ralph G


Sergei Grichine

unread,
Apr 28, 2021, 5:32:28 PM4/28/21
to hbrob...@googlegroups.com
One more variable to try - the OS running on Raspberry Pi (btw, is is RPi 3 or 4?). Ubuntu and Raspbian may be very different when it comes to supporting Arduino IDE/USB. And RPi 4 seems to be not the most stable/compatible beast in the zoo.


Best Regards, 
-- Sergei Grichine 
Reply all
Reply to author
Forward
0 new messages