STM32F103C8T6 need help with drivers

STM32duino bootloader aka Maple bootloader
petronel
Posts: 17
Joined: Mon Aug 22, 2016 12:21 pm

STM32F103C8T6 need help with drivers

Post by petronel » Mon Aug 22, 2016 12:32 pm

Hi,

I'm new to this forum and quite new to arduino.

I've brought a STM32F103C8T6 ("blue pill" with yellow headers/pins).
Plugging it to usb, it has the led blinking but the usb is not recognized. On Windows 8 i get an yellow mark on Device Manager with the error:

Code: Select all

Windows has stopped this device because it has reported problems. (Code 43)
A request for the USB device descriptor failed.
I've downloaded Arduino_STM32 package and used install_drivers.bat but still same error on Device Manager, no matter if I move the jumpers to 0 or 1.

I don't have an ST-Link v2, but I will try to get an USB to TTL .

What can I do/try next?

petronel
Posts: 17
Joined: Mon Aug 22, 2016 12:21 pm

Re: STM32F103C8T6 need help with drivers

Post by petronel » Mon Aug 22, 2016 3:37 pm

On a LUbuntu i get this from dmesg:

Code: Select all

[22329.016155] usb 6-2: new full-speed USB device number 2 using uhci_hcd
[22329.136129] usb 6-2: device descriptor read/64, error -71
[22329.360163] usb 6-2: device descriptor read/64, error -71
[22329.780160] usb 6-2: new full-speed USB device number 3 using uhci_hcd
[22329.900143] usb 6-2: device descriptor read/64, error -71
[22330.124160] usb 6-2: device descriptor read/64, error -71
[22330.340124] usb 6-2: new full-speed USB device number 4 using uhci_hcd
[22330.752130] usb 6-2: device not accepting address 4, error -71
[22330.864152] usb 6-2: new full-speed USB device number 5 using uhci_hcd
[22331.280162] usb 6-2: device not accepting address 5, error -71
[22331.280259] hub 6-0:1.0: unable to enumerate USB device on port 2

edogaldo
Posts: 284
Joined: Fri Jun 03, 2016 8:19 am

Re: STM32F103C8T6 need help with drivers

Post by edogaldo » Mon Aug 22, 2016 4:41 pm

Hi @petronel, in order to use the USB with F103 devices, among the USB drivers, you need the corresponding firmware installed.
Main option is to install the stm32duino bootloader; for blue pills I think you should use this file: https://github.com/rogerclarkmelbourne/ ... 0_pc13.bin
You can install it either via ST-link or via USBtoSerial adapter.
Once installed the bootloader, the PC should be able to recognize you blue pill as a DFU device and you can then upload your sketches.
Once uploaded a sketch, your PC will then be able also to recognize your blue pill as a COM device.
Search the forum for further details.

Best, E.

fredbox
Posts: 95
Joined: Tue Jul 07, 2015 4:44 pm

Re: STM32F103C8T6 need help with drivers

Post by fredbox » Mon Aug 22, 2016 7:02 pm

The generic boards as received are write protected and don't do anything other than blink the led.

You will need to connect a USB-Serial adapter and flash a bootloader using the STM32 demonstrator utility before the serial port will enumerate. Then you can upload with the IDE.

testato
Posts: 39
Joined: Sun Aug 14, 2016 7:44 am

Re: STM32F103C8T6 need help with drivers

Post by testato » Tue Aug 30, 2016 9:23 pm

you may also use the stm32flasher only for remove the flash protection, and after use the standard method for upload the DFU_Bootloader

petronel
Posts: 17
Joined: Mon Aug 22, 2016 12:21 pm

Re: STM32F103C8T6 need help with drivers

Post by petronel » Wed Nov 09, 2016 7:29 pm

I got an USB to Serial CH340.
using stm32flash i can write generic_boot20_pc13.bin

Code: Select all

C:\Users\Petronel\Downloads\stm32flash-0.5-win64>stm32flash.exe -w ..\generic_boot20_pc13.bin COM9
stm32flash 0.5

http://stm32flash.sourceforge.net/

Using Parser : Raw BINARY
Interface serial_w32: 57600 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (STM32F10xxx Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (size first sector: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Wrote address 0x08010000 (100.00%) Done.
I can also upload the test sketch using serial and USB-to-serial. I get the "Hello World" on Serial Monitor, but the led PC13 doesn't flash. I have a blue pill board, and next to led there is PC13.

I've read on the wiki that i should place a 1k5 resistor between PA12 and 3.3V beacause R10 is 103 (10k).

Why i don't get my device recognised by USB ? I'm missing some step ?

petronel
Posts: 17
Joined: Mon Aug 22, 2016 12:21 pm

Re: STM32F103C8T6 need help with drivers

Post by petronel » Wed Nov 09, 2016 7:30 pm

Uploading the sketch using USB-to-serial get this result:

Code: Select all

stm32flash 0.4

http://stm32flash.googlecode.com/

Using Parser : Raw BINARY
Interface serial_w32: 230400 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory

Wrote address 0x08000100 (3.40%) 
Wrote address 0x08000200 (6.80%) 
Wrote address 0x08000300 (10.20%) 
Wrote address 0x08000400 (13.60%) 
Wrote address 0x08000500 (16.99%) 
Wrote address 0x08000600 (20.39%) 
Wrote address 0x08000700 (23.79%) 
Wrote address 0x08000800 (27.19%) 
Wrote address 0x08000900 (30.59%) 
Wrote address 0x08000a00 (33.99%) 
Wrote address 0x08000b00 (37.39%) 
Wrote address 0x08000c00 (40.79%) 
Wrote address 0x08000d00 (44.18%) 
Wrote address 0x08000e00 (47.58%) 
Wrote address 0x08000f00 (50.98%) 
Wrote address 0x08001000 (54.38%) 
Wrote address 0x08001100 (57.78%) 
Wrote address 0x08001200 (61.18%) 
Wrote address 0x08001300 (64.58%) 
Wrote address 0x08001400 (67.98%) 
Wrote address 0x08001500 (71.38%) 
Wrote address 0x08001600 (74.77%) 
Wrote address 0x08001700 (78.17%) 
Wrote address 0x08001800 (81.57%) 
Wrote address 0x08001900 (84.97%) 
Wrote address 0x08001a00 (88.37%) 
Wrote address 0x08001b00 (91.77%) 
Wrote address 0x08001c00 (95.17%) 
Wrote address 0x08001d00 (98.57%) 
Wrote address 0x08001d6c (100.00%) Done.

Starting execution at address 0x08000000... done.

User avatar
RogerClark
Posts: 7443
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F103C8T6 need help with drivers

Post by RogerClark » Wed Nov 09, 2016 7:47 pm

Does the LED flash?

You will only see a libusb device . Not a Serial device after the bootloader first runs, The Serial USB code is in the sketch, the bootloader only contains a DFU device.

You also need to load the windows drivers ( assuming you are running windows) . Please read the FAQ in the Welcome / FAQ section

stevestrong
Posts: 1813
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: STM32F103C8T6 need help with drivers

Post by stevestrong » Wed Nov 09, 2016 7:53 pm

@petronel,
I think you told that the LED does not blink.
For this, please check which pin is assigned to LED in your sketch. The LED pin should be defined somewhat like:
#define LED_PIN PC13
Please use the "PC13" notation, not just numbers (13).

As long as you get "Hello world" on your serial monitor it means the serial communication works.

User avatar
RogerClark
Posts: 7443
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F103C8T6 need help with drivers

Post by RogerClark » Wed Nov 09, 2016 8:03 pm

Ok.

Lots of people think the bootloader is not working because they dont have a Serial USB device after it first installs.

I should merge a "blink and count" sketch with the bootloader, then everybody would be less confused. ;-)

Perhaps the OP has a hardware fault on the USB. As the Blue pill often has broken connections to the usb data pins.

I have 2 Blue pill boards, but neither work, now, as the USB connections broke and its hard to repair without connecting an external USB socket, or perhaps solder on a cable with a plug

Post Reply