Author Topic: STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS...  (Read 4071 times)

0 Members and 1 Guest are viewing this topic.

Offline AxxelTopic starter

  • Contributor
  • Posts: 37
  • Country: es
Dear friends.

I bought two $3 STM32 BluePill and one ST-LINK V2 Clone on AliExpress.

After reading and studying about the STM32 technology, I started to practice...

I installed on the PC those aplications:

 - STM32 ST-LINK Utility (To flash .HEX and .BIN files)
 - STM32CubeMX (To pregenerate projects and define I/Os clock & buses)
 - STM32CubeIDE 1.0.2 (To write and compile C programs for the STM32)

My objetive is running GRBL 1.1 on the STM32 because to get fast speeds for co2 laser engraving then the Arduino UNO.

The Arduino UNO port of GRBL 1.1 to BluePill has been done several times:

https://github.com/usbcnc/grbl

https://github.com/helimp/grbl_stm32

https://github.com/djabi/grbl_stm32f103c8

This last one have a good wiki there explaining how to flash the .BIN to the bluepill:

https://github.com/djabi/grbl_stm32f103c8/wiki/grbl-stm32f103c8


So first I made a simple blinking led project with STM32CubeIDE, I had some debugging issues with the ST LINK V2 Clone but I could fix thanks to these informations there:

https://www.eevblog.com/forum/beginners/unexpected-idcode-flashing-bluepill-clone/

After I tried to compile those GRBL STM32 firmwares with STM32CubeIDE and NO PROBLEM, it compiles, it loads BUT... NOT USB/Virutal serial port detected :(

I tried to download the HEX files but... same there... Windows error 43, USB not identificated...

I tired with the arduino USB bootloader, same...

I looked about the 10K resistor error, changed it for a 1.8K SMD, no FIX. I resolded the micro USB conector of the board, NO FIX :(

But, I found a strange firmware there:

https://jeelabs.org/2017/09/enabling-usb-on-a-blue-pill/

I download the BIN located in the part 3 of this page, pass the jumper form 1 to 0, push reset, connect the micro USB and here we go! The bluepill is DETECTED AS "STMicroelectronics Virtual COM Port"!!!

This firmware is the only .BIN I found that have the working USB.

So it isn't an HARDWARE Problem this is a firmware ISSUE...

Here goes a pic of the STM32 of my bluepill. I saw on the web there is a lot of boards with fakes STM... I'm not able to identify an original or a fake. (The pic is in attachement to have a good resolution and see well the engraved characters)

I have these informations about it:

20:32:39 : Device ID:0x410
20:32:39 : Device flash Size : 64KBytes
20:32:39 : Device family :STM32F10xx Medium-density

Question 1 the MAIN QUESTION : I think there is something I'm making BAD or I forgot into my flashing configuration... and I don't have the experience and the sufficient knowledge to find the problem.

Question 2 : Can I flash like a PIC directly a .HEX or I have to flash fisrt a bootloader or an OS with a KERNEL that allow the USB mode and flash after the hex with the firmware I want?

Question 3 : I saw you can use a FTDI USB-Serial converter to flash the  STM with another program called FLASH LOADER DEMONSTRATOR (I tried this to load the arduino USB bootloader and of course everthing OK but USB error 43 no indentifier) - Is flashing with this method is the same of flashing with STM32 ST-LINK Utility and the ST-LINK V2?

Hope you can help me and sorry I hesitate to put this topic into the "begineers category" but it's hard for me to judge...

Regards
« Last Edit: October 09, 2019, 02:28:06 am by Axxel »
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS...
« Reply #1 on: October 09, 2019, 02:43:37 am »
The stm32f103 used in the bluepull does not had the traditional USB DFU firmware loader built into it.

It needs to have a bootloader loaded onto it for you to be able to sue the USB port to load firmware.
That .BIN file that you found will be doing this part for you.

And if you want the GRBL firmware to talk over USB to your computer s a virtual com port, if this is not built into the application, then it will not enumerate on your computer as a VCP for you to talk to.

A fix for this could be some sort of usb to uart converter like you mention (FTDI serial, or others like a cp2012,  ch340, or other)
 
The following users thanked this post: Axxel

Offline AxxelTopic starter

  • Contributor
  • Posts: 37
  • Country: es
Re: STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS...
« Reply #2 on: October 09, 2019, 09:31:58 pm »
OK... Can you recommand good bootloaders references for the blue pill?
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS...
« Reply #3 on: October 10, 2019, 12:15:16 am »
Unfortunately no i dont really use the stm32 in an arduino environment.
And the rare times that i do i just program it directly using the stlink.
 

Offline AxxelTopic starter

  • Contributor
  • Posts: 37
  • Country: es
Re: STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS...
« Reply #4 on: October 10, 2019, 03:59:00 am »
Look at this, here you can see the STM32 is detected as a serial port, without external FTDI converter...

 
The following users thanked this post: coromonadalix


Offline AE7OO

  • Regular Contributor
  • *
  • Posts: 65
  • Country: us
Re: STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS...
« Reply #6 on: October 31, 2019, 04:30:27 pm »
Can I say Huh??????

You bought 2 blue pills and a ST-Link/V2 clone.

Why don't you just use the ST-Link to program the Blue Pills?

Each of those Blue Pills have a 4 pin header on end that you just connect up to the ST-Link(I plug the USB in for power).  Look at the picture below(this is from an old Blue Pill, but here they are all the same) and you can see the order of the pins.  Left to right, GND, CLK, IO, 3.3, just hook them up, make sure the ST-Link is plugged in, and the ST-Link Util should see it.

Otherwise you have to use the serial boot loader, which I find to be a major pain.
If you insist on using a USB boot loader, then look for Roger's STM32Arduino series of boot loaders, but use the ST-Link to flash it...:)

Oh, one thing I don't believe I've seen mentioned is the fact that some(most) Blue Pills have a incorrect USB resistor at R10, still.  Flip it over and R10 should be 1.5K(the marking is 152).  I always just replace it with the proper one, but there are other ways to deal with it(just google "blue pill R10" for them).
« Last Edit: October 31, 2019, 04:32:54 pm by AE7OO »
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS...
« Reply #7 on: November 05, 2019, 03:55:36 pm »
He doesn't want to use the USB port to flash upload to the STM32, he wants to use the USB port as an actual USB port!
In this case as a USB-serial device so he can communicate with the application running on the bluepill.

Unfortunately his STM32 is a fake. See https://www.eevblog.com/forum/beginners/unexpected-idcode-flashing-bluepill-clone/msg2771382/#msg2771382

I wasted days trying to get the crummy STM32 F103C8T6 991KA 93 MYS 807 working with USB.  |O My new bluepill boards are a breeze.  :)
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4766
  • Country: nr
  • It's important to try new things..
Re: STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS...
« Reply #8 on: November 05, 2019, 07:07:18 pm »
FYI - I've tried the USB upload and serial with 991EF 98 MYS 531 and it works.
 
The following users thanked this post: thm_w

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4766
  • Country: nr
  • It's important to try new things..
Re: STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS...
« Reply #9 on: November 06, 2019, 09:12:38 pm »
The replacing the 10k is not critical with BluePills. Simply leave it there. I have here several BPills with 10k and it works the same way as with 1k5.
The bootloader which works fine is the above from Roger's github (stm32duino stuff).
It is called "generic_boot20_pc13.bin" for the BluePIll.
The only issue you may encounter is the proper installation of the drivers on your PC.
There is the "Maple DFU" one for the actual upload to the BPill, the second one is "Maple Serial" for actual comm via USB.
Even Win7 (for example) sometimes reports the both drivers work fine, you may not get the DFU or Serial work when not installed properly.
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS...
« Reply #10 on: November 06, 2019, 11:11:02 pm »
There are some people who think the only reason for the micro USB is purely to upload Arduino code and have the Arduino serial monitor  :palm:

As the indomitable iron lady said back in the day, "NO, NO, NO!"

Besides, the shitty fakes don't even work with "generic_boot20_pc13.bin" anyway.
 

Offline techman-001

  • Frequent Contributor
  • **
  • !
  • Posts: 748
  • Country: au
  • Electronics technician for the last 50 years
    • Mecrisp Stellaris Unofficial UserDoc
Re: STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS...
« Reply #11 on: November 07, 2019, 12:52:27 am »
Dear friends.

I bought two $3 STM32 BluePill and one ST-LINK V2 Clone on AliExpress.


After I tried to compile those GRBL STM32 firmwares with STM32CubeIDE and NO PROBLEM, it compiles, it loads BUT... NOT USB/Virutal serial port detected :(

I tried to download the HEX files but... same there... Windows error 43, USB not identificated...

I tired with the arduino USB bootloader, same...

But, I found a strange firmware there:

https://jeelabs.org/2017/09/enabling-usb-on-a-blue-pill/

I download the BIN located in the part 3 of this page, pass the jumper form 1 to 0, push reset, connect the micro USB and here we go! The bluepill is DETECTED AS "STMicroelectronics Virtual COM Port"!!!

This firmware is the only .BIN I found that have the working USB.

I have these informations about it:

20:32:39 : Device ID:0x410
20:32:39 : Device flash Size : 64KBytes
20:32:39 : Device family :STM32F10xx Medium-density


Sounds like a fake STM32F103 with a bad  USB identifier to me.

I've made a bootable USB image that uses the same "strange" firmware you have used,  but that link is now dead.
https://jeelabs.org/2017/09/enabling-usb-on-a-blue-pill/
404
Sorry, but nothing exists here.
Find something interesting to read.
© 2019 Jean-Claude Wippler – website powered by Hugo, Er, Caddy, and Linux.

My image also includes a utility to read the Chip ID so you can perhaps compare it to others submitted so far for various Blue Pill boards and determine if it's a fake.

Please see:  https://www.eevblog.com/forum/microcontrollers/30kb-blue-pill-usb-binary-testing-image/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf