USB problem

kn4ud
Sat Nov 05, 2016 12:55 am
I an new here and have been looking in the FAQ section and doing searches for the problem I am having . Finding info but nothing that fixes the problem.
Board is a Banggood maple clone with F103C8. I have loaded all the software as described, used stlink to load the boot20 pc13 and the green light flashes very fast after loading. Used stlink to load the blink program and it loads as it should with the green light blinking at 1 hz. I plug the board into the USB and check device manager and it shows maple serial (com5) . In the Arduino it it shows the same thing. I set the IDE to use the boot loader and set the port click on Load, everything compiles fine but then comes the load problem I get this’
Maple_loader v0.1
Resetting the boot loader via DTR Pulse
Searching for DFU device [1EAF:0003]…
dfu-util – (C) 2007-2008 by OpenMoko inc.
Couldn’t find the DFU device : [1EAF:0003] This program is Free Software and has ABSOLUTELY NO WARRANTY
I have found info on this in the searches i have done but things I find I have done already. My system is Windows 8.1, Arduino is 1.6.9. The clone board does have the 10k resistor for (R10). I have gone back and loaded the drivers several times. I can use stlink and load programs without a problem . I know this has been brought up here many times by what I have found in the search but I have not found a fix also my computer has 3 USB ports and I have tried it in all of them and have tried 5 different cables . I would like to get the usb to work but it looks like I may have to stick with the stlink.

evildave_666
Sat Nov 05, 2016 1:56 am
If its a blue pill board with the 10k resistor, solder a 1.5k 1.8k resistor from A12 to Vcc like this (well, do it neater than I did).
Image

kn4ud
Sat Nov 05, 2016 2:23 am
Thanks evildave , I will give that a try.

RogerClark
Sat Nov 05, 2016 2:34 am
If it already has a 10k SMD resistor, using a 1.8k in parallel may be slightly better (but most USB’s won’t care as 1.5k is close enough)

evildave_666
Sat Nov 05, 2016 7:19 am
RogerClark wrote:If it already has a 10k SMD resistor, using a 1.8k in parallel may be slightly better (but most USB’s won’t care as 1.5k is close enough)

ahull
Sat Nov 05, 2016 9:05 am
One other point.
If you load the bootloader with the ST-Link, then load a sketch with the ST-Link, it will overwrite the boootloader with the sketch… no more bootloader.
So write the bootloader with the ST-Link then change the upload settings in the ide to stm32bootloader and then try uploading the sketch.

kn4ud
Sat Nov 05, 2016 2:47 pm
Guys would I be better to change the 10k to a 4.7k at R10, I have everything to do it with or is it still a possible problem?

I tried to load the blink sketch after using stlink to load the boot loader using the boot loader but the board was not recognized. Now when I loaded the boot loader I moved the jumper to the position I watched in the video after that I moved it back to the 0 position, then used the IDE to load the Blink sketch, by doing this was my boot loader protected?


RogerClark
Sat Nov 05, 2016 7:35 pm
Bootloader is not protected unless you specifically protect , e.g. using STMs Flash loader program.
It does not have any code to protect its self

Optimum USB pull up is 1.5k
If you dont want to remove the 10k, then 1.8k in series is optimal.

That assumes your board has a 10k smd resistor, you may want to measure it. as it could be a different value. I think some boards have been known to have 4.7k on them already, which seems to work for some people, but is not ideal

It could be your board is faulty. They are not that well made and various people have reported numerous different issues caused by bad soldering. The usb connectors are also prone to breaking away from the PCB


kn4ud
Sat Nov 05, 2016 8:07 pm
Roger, I have 2 of these boards. Both of them had bad solder joints at the USB that I had to rework. I replaced the 10k with a 4.7k but this did not fix the problem on either board. I went back to stlink and erased the chip and reloaded the generic boot20 pc13 placed the jumper back in the 0 position and get the rapid flashing green light, connected to the PC and checked the device manager. It shows

libusb-Win32 devices
maple DFU
I had see some information about using zadig but was unable to find it so I tried it out and found Maple 003 and was not sure what to do but where the driver is it showed 2 , one was libusb the other was win something so I chose to reload the libosb0(v1.2.6.0) it shows usb id 1EAF 0003.
I hate to be a bother here guys but I am learning about this and am trying to get a understanding of how to get the USB working and keep it working without over writing things that will keep it from working. I appreciate you guys help.


RogerClark
Sat Nov 05, 2016 9:40 pm
I’m a bit confused

It looks like it is working, i.e you have the DFU device and you have installed the drivers.

You won’t see a serial device until you load a sketch via the bootloader as the Serial code is inside the sketch


kn4ud
Sat Nov 05, 2016 10:03 pm
Yes it looks good up to this point. Here is where I have been loading the sketch for blink using stlink. It loads and works but then when I go back and try to load other sketches using the usb is where I have the problem.

RogerClark
Sat Nov 05, 2016 10:31 pm
As STLink dongles don’t have any form of serial passthough (unlike the STLink on the Nucleo boards which run different firmware and have USB Serial)

The STLink build config compiles the USB Serial driver into the sketch, so that users of STLInk can use the USB Serial.

(This doesn’t apply to BlackMagic Probe builds as it has USB Serial passthough and doesnt apply to building for Serial upload)

But if you build for bootloader upload, it adds USB serial as well

What possibly is happening is that your board is not resetting the USB bus after the bootloader has finished.

On the BluePill its basically a hack, (as its missing the correct hardware), we just briefly turn one of the USB pins into GPIO mode, then toggle it, which resets the USB interface.
The PC normally detects this and checks the USB device again , by which time the sketch code is running as Serial USB

But in your case it sounds like the PC is not detecting the USB reset that the sketch does when it starts


kn4ud
Sat Nov 05, 2016 11:00 pm
Roger, thanks for triggering me to wake up and think. Your previous reply made me think, BOOT LOADER, don’t matter if the IDE don’t see the com port the DFU will take care of that. So I loaded the Blink sketch, set tools to boot loader and hit load. It compiled and found the device and loaded it and it blinks fine and the com port showed up . I am sure now that the USB will work fine. I was too hung up on thinking I had to have that com port showing before I could upload to the stm103 then with what you guys replied back to me then it came to me what was going on in the boot loader.. Thanks for the help and education guys.

Rick Kimball
Sun Nov 06, 2016 1:09 am
kn4ud wrote:… I replaced the 10k with a 4.7k but this did not fix the problem on either board. …

RogerClark
Sun Nov 06, 2016 5:18 am
kn4ud wrote: I was too hung up on thinking I had to have that com port showing before I could upload to the stm103 then with what you guys replied back to me then it came to me what was going on in the boot loader.. ….

kn4ud
Sun Nov 06, 2016 1:48 pm
Rick, I was replacing R10 which comes off the 5v line . The schematic shows it being 4.7k. You can keep the R10 at 10k and jumper from the 3.3v line to D+ and get the basic same results as far as current goes. I chose to replace the R10 10K with the 4.7K to keep from soldering a resistor on top of the board . Either way you will get the basic same results.
As a test I went back and removed the 4.7k I had put in for R10 and put the 10k back in and it worked just fine so I just wasted my time doing any mod on this blue pill now that is not to say that it don’t work for others. My problem was not knowing what I was doing after the boot loader install. I will say that the blue pills I recently got from Banggood had bad solder joints on the USB , one of them the power light would not even come on the other worked for about 5 plug ins of the usb then it quit.

Roger, I am an avid Arduino user and my old way of thinking caused me problems. If I can’t see the com port highlighted I can’t upload and never thought bootloader and not really understanding what was going on in this bootloader. Thanks for waking me up.


Rick Kimball
Sun Nov 06, 2016 2:02 pm
I’m not sure why some blue pills have the pull up connected to 5v. It seems like it might fry some host / usb hub connectors with data lines that are not 5v tolerant. All the ones I have use a pullup to the 3v3 line as expected. All of them however have the 10k resistor which doesn’t work for me.

If it works for you without frying something, it seems you are lucky.

* Wonders why all those bluepill designs are so f***ed up ?

-rick


ahull
Sun Nov 06, 2016 3:56 pm
Rick Kimball wrote:* Wonders why all those bluepill designs are so f***ed up ?

kn4ud
Sun Nov 06, 2016 4:58 pm
LOL, I will agree with both of you guys on this.

emert34
Fri Nov 11, 2016 11:59 am
Hello
Is there a way to use USB as just writing Serial.print with Custom stm32F103R8 board. Is it enough to have data pins connected to USB cable and upload any of the samples. Because it did not worked on my board.
Connection is like the image attached

AlbertP
Fri Nov 25, 2016 9:37 pm
Hello, I also have the same error code in the OP. It looks I have the same blue pill board. I soldered a 1.5k resistor across A12 and 3.3 V and removed the 10k smd resistor on the back but when I try to upload from arduino using the bootloader it cant seem to find the DFU device UNLESS I hit the reset button while it’s waiting, then it finds it and uploads the sketch properly albeit with another “error resetting after download: usb_reset: could not reset device, win error: The device is not connected”. Is this normal operation? The USB connector seems fine as well and not damaged. Also, when I have a scope on A12, I see some sort of USB communication constantly. I’m not sure if that’s supposed to be there? I would appreciate any help as I’ve been searching for quite a while now to figure out how to solve this.

EDIT: FIXED
Set the COM Port in the Arduino IDE to the Maple Serial device and it works out fine now.

Of course immediately after I posted this I found the solution while reading more of the forum.


RogerClark
Fri Nov 25, 2016 9:48 pm
If the code is dropping out of DFU, it thinks it has a valid sketch to run

Are you saying that after the sketch is running you don’t get the serial device?

If you have the serial device and don’t select its port, from the menu in the IDE, the IDE has no way to reset the board


AlbertP
Fri Nov 25, 2016 9:59 pm
Sorry Roger, I just solved it as I didn’t have the COM Port selected properly. I saw the solution like a few minutes after I posted my problem. Thank you however for the quick reply.

RogerClark
Fri Nov 25, 2016 11:14 pm
No worries

emert34
Sat Nov 26, 2016 6:59 am
RogerClark wrote:No worries

RogerClark
Sat Nov 26, 2016 7:12 am
I’m not sure what you mean.

Serial USB is compiled in as part of the sketch if you select the bootloader upload option, and Serial.begin() gets called behind the scenes.

The bootloader only provides DFU for uploads then terminates, and the sketch code is run


emert34
Sat Nov 26, 2016 8:40 am
RogerClark wrote:I’m not sure what you mean.

Serial USB is compiled in as part of the sketch if you select the bootloader upload option, and Serial.begin() gets called behind the scenes.

The bootloader only provides DFU for uploads then terminates, and the sketch code is run


stancecoke
Thu Dec 01, 2016 1:10 pm
I have a problem with monitoring the traffic on the USB-serial port.
Normally i use hterm to watch and log the communication, but with one bluepill board, there is no traffic recognized (other bluepill boards work). In the (very poor) build-in Arduino Serial Monitor, the traffic is shown. Uploading sketches via bootloader works also. As a workaround i used this https://www.aggsoft.com/serial-port-monitor.htm, but now the test period of the trial version ran out :-(
I already fixed the thing with the 10k resistor at R10, but that was not solving my problem.

Any ideas?

Regards
stancecoke


stevestrong
Thu Dec 01, 2016 3:15 pm
You could use RealTerm, which is free software.
As long as you have serial data in Arduino serial monitor, you should have the same data visible in other serial terminal monitor software.
If not, then you should check the serial port parameter setting in the terminal software.

stancecoke
Thu Dec 01, 2016 4:16 pm
Hmm, thats the mystery, I tried several terminal software like hterm, the windows-internal Hyperterminal, putty, with definitifly the right settings, but only the linked “Advanced Serial Monitor” and the Arduino-internal monitor worked. :o really strange….
I found a hint in a german forum, with a similar problem but with a FTDI device. But why an other Bluepill-board works without any problem?! I’ll check it with a third board….

Regards
stancecoke


stevestrong
Thu Dec 01, 2016 6:32 pm
Be aware, that you should connect the monitor terminal to the blue pill after upload and reset, and AFTER the PC terminated the USB re-enumeration process, which can take up to 5 seconds (on Win10 machine).

testato
Thu Dec 01, 2016 8:28 pm
emert34 wrote:
What is the 1.5k Resistor for ? I use 27R serial resistors for data pins only.

stancecoke
Fri Dec 02, 2016 3:48 pm
Hm, now I tried RealTerm and that works :-) in both cases, R10 = 1.5k and R10 = 10k.
I still don’t understand why hterm doesn’t work, but OK, I don’t have to understand everything…

Regards
stancecoke


caniggia
Tue Dec 06, 2016 3:24 pm
Hmm, thats the mystery, I tried several terminal software like hterm, the windows-internal Hyperterminal, putty, with definitifly the right settings, but only the linked “Advanced Serial Monitor” and the Arduino-internal monitor worked. :o really strange….
I found a hint in a german forum, with a similar problem but with a FTDI device. But why an other Bluepill-board works without any problem?! I’ll check it with a third board….

I had the same problem.

This terminals/monitors did work for me:
* Serial Monitor (Arduino IDE)
* Tera Term
* Putty
* FreeSerialProtocolAnalyzer (note: this is sniffer, first you have to open COM with some communication app)

This terminals/monitors didn’t work:
* YAT terminal
* Termite terminal
* Hterm
* Hercules SETUP utility

The problem is in “Flow Controll”.
You have to:
* YAT
“Terminal” >> “Settings..” >> “Flow Controll” to “Manual hardware (RFR/CTS)” and in main terminal window low-right corner set “DTR”.
or
“Terminal” >> “Settings..” >> “Flow Controll” to “Manual Combined (RFR/CTS + XOn/XOff)” and in main terminal window low-right corner set “DTR”.
* Termite
“Settings” >> “Flow Controll” to “DTR/DSR” or “RTS/CTS”
* Hterm
“Input control” pane >> set “DTR”
* Hercules SETUP utility
“Modem lines” pane >> set “DTR”

This are the terminals/monitors i have installed.
For any other, search for “Flow Controll” and “DTR”

Regards
can


stancecoke
Thu Dec 08, 2016 9:53 am
* Hterm
“Input control” pane >> set “DTR”

That fixes the problem :) Thank you!

Regards
stancecoke


Leave a Reply

Your email address will not be published. Required fields are marked *