STM32 BluePill - USB SOFTWARE IDENTIFIER ISSUE and FEW QUESTIONS... - Page 1
Forum section: electronics / general

author: Axxel
author_rank: Contributor
timestamp: October 09, 2019, 01:45:36 am
content: 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/grblhttps://github.com/helimp/grbl_stm32https://github.com/djabi/grbl_stm32f103c8This last one have a good wiki there explaining how to flash the .BIN to the bluepill:https://github.com/djabi/grbl_stm32f103c8/wiki/grbl-stm32f103c8So 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 detectedI 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 FIXBut, 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:0x41020:32:39 : Device flash Size : 64KBytes20:32:39 : Device family :STM32F10xx Medium-densityQuestion 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

author: lucazader
author_rank: Regular Contributor
timestamp: October 09, 2019, 02:43:37 am
content: 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)

author: Axxel
author_rank: Contributor
timestamp: October 09, 2019, 09:31:58 pm
content: OK... Can you recommand good bootloaders references for the blue pill?

author: lucazader
author_rank: Regular Contributor
timestamp: October 10, 2019, 12:15:16 am
content: 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.

author: Axxel
author_rank: Contributor
timestamp: October 10, 2019, 03:59:00 am
content: Look at this, here you can see the STM32 is detected as a serial port, without external FTDI converter...

author: eliocor
author_rank: Unknown
timestamp: October 10, 2019, 05:51:15 am
content: MAYBE this can help you:https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/Flashing-Bootloader-for-BluePill-Boardshttps://www.rogerclark.net/improved-maple-bootloader-for-stm32/https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/Bootloaderhttps://github.com/rogerclarkmelbourne/STM32duino-bootloadersearch also for "maple mini" and "maple mini bootloader"

author: AE7OO
author_rank: Regular Contributor
timestamp: October 31, 2019, 04:30:27 pm
content: 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).

author: Macbeth
author_rank: Super Contributor
timestamp: November 05, 2019, 03:55:36 pm
content: He doesn't want to use the USB port to flash upload to the STM32, he wants to use the USB port as anactual 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. Seehttps://www.eevblog.com/forum/beginners/unexpected-idcode-flashing-bluepill-clone/msg2771382/#msg2771382I wasted days trying to get the crummySTM32 F103C8T6 991KA 93MYS 807working with USB.My new bluepill boards are a breeze.

author: iMo
author_rank: Super Contributor
timestamp: November 05, 2019, 07:07:18 pm
content: FYI - I've tried the USB upload and serial with 991EF 98 MYS 531 and it works.

author: iMo
author_rank: Super Contributor
timestamp: November 06, 2019, 09:12:38 pm
content: 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.

author: Macbeth
author_rank: Super Contributor
timestamp: November 06, 2019, 11:11:02 pm
content: There are some people who think the only reason for the micro USB is purely to upload Arduino code and have the Arduino serial monitorAs 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.

author: techman-001
author_rank: Frequent Contributor
timestamp: November 07, 2019, 12:52:27 am
content: Quote from: Axxel on October 09, 2019, 01:45:36 amSounds 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/404Sorry, 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/