Generic STM32F103R board not showing up in device manager and serial ports

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
zmemw16
Posts: 1161
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Generic STM32F103R board not showing up in device manager and serial ports

Post by zmemw16 » Mon Mar 13, 2017 3:22 pm

i'll take the risk

the jumpers for boot0 and boot1 are 'normally' each in a line of 3 pins, the middle pin is the boot line.

'o' or gnd........bootn........... '1' or 3v3
////|...............| link

'o' or gnd........bootn........... '1' or 3v3
///////////// |...............| link

they were almost certainly set to the 0 side of those 3 pins originally
apologies if i'm teaching you how to suck eggs :D :D :D :D
stephen

blahlicus
Posts: 4
Joined: Sun Mar 12, 2017 6:23 pm

Re: Generic STM32F103R board not showing up in device manager and serial ports

Post by blahlicus » Tue Mar 14, 2017 1:17 pm

Here are some high resolution macro shots of the front and back as requested, it has an onboard RS232 to upload from, has an STLink connector, and the client USB, I tried checking continuity of the data pins of the USB and got 400ohm on one of the pins on the controller, but I don't really know what to probe for so any guidelines would be nice.

Image
Image

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

Re: Generic STM32F103R board not showing up in device manager and serial ports

Post by stevestrong » Tue Mar 14, 2017 1:34 pm

According to the datasheet, BOOT0 is solely as input available on pin 60 of the LQFP64 package. Please check if you can access it.
BOOT1 is connected to PB2.
Now you know how and which pins you should control to flash the bootloader and upload further software.

User avatar
Pito
Posts: 1122
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Generic STM32F103R board not showing up in device manager and serial ports

Post by Pito » Tue Mar 14, 2017 4:10 pm

usb part.JPG
usb part.JPG (22.37 KiB) Viewed 303 times
from that picture r21, r23, r24, Q1, r8, and r13 are related to USB, so the USB circuitry is there.
Q1 is most probably the 1.5k usb signalling switch.
Now the question is from which 103R's pin the Q1 transistor is driven - most probably from a pin which is not set in the bootloader.
Pukao Hats Cleaning Services Ltd.

zmemw16
Posts: 1161
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Generic STM32F103R board not showing up in device manager and serial ports

Post by zmemw16 » Tue Mar 14, 2017 5:06 pm

looking at the top right, the red links are boot0 & boot1
they're both 3v3, that's boot from embedded sram according to AN2606
boot1 boot0
X 0 user flash
0 1 system flash
1 1 sram

try moving boot0 to gnd or move both to gnd
if you have one, try using a stlink, well worth the £2 or so

the other red links (bottom right) appear to be set for usb, alternative is CAN on the right hand end of the bottom rows

the vet/zet variant has transistors q2, q3 associated with the serial interface, so try the board against that schematic for vct/vet
hth
stephen

victor_pv
Posts: 1270
Joined: Mon Apr 27, 2015 12:12 pm

Re: Generic STM32F103R board not showing up in device manager and serial ports

Post by victor_pv » Wed Mar 15, 2017 5:19 pm

From the pictures looks like the transistor Q1 is wired to pin 38 in the MCU (PC7), not sure if it is active High or Low.
The USB pins go PA11 and PA12, which are the right ones.
If PC7 is driven the wrong way it may be blocking USB communication. I dont remember how the pull up transistor is managed in the Maple (active high or low?), but I do believe in the code for Generic boards we don't even try to use a pin for that functions, so it is probably left as input, in which case the transistor may or may not be leaving the pull up resistor connected. Unless the resistor get's disconnected, the USB serial may not enumerate at all.
You could try in your sketch driving that pin low for a few ms, then high. And if that doesn't work try the other way, driving it low, then high. I dont remember how long the pull up resistor needs to be connected, I believe it should be in response to some host action, but in practice I think the core just keeps it connected for set amount of time, try a ms or two.

Now, as far as the software. I think like someone posted before, that you may not be following the right process.

To get the USB serial detected you need to:
1.- Upload the stm32duino bootloader. At this point the board should show as a DFU device, but NOT as serial.
2.- Upload a sketch using the stm32duino bootloader. At this point the Serial USB should show up.

User avatar
Pito
Posts: 1122
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Generic STM32F103R board not showing up in device manager and serial ports

Post by Pito » Wed Mar 15, 2017 5:43 pm

The high-side USB switch is active low (pnp or pmos Q1). The pin driving the Q1 must be set and compiled within the bootloader.
Pukao Hats Cleaning Services Ltd.

victor_pv
Posts: 1270
Joined: Mon Apr 27, 2015 12:12 pm

Re: Generic STM32F103R board not showing up in device manager and serial ports

Post by victor_pv » Thu Mar 16, 2017 3:36 am

Pito wrote:The high-side USB switch is active low (pnp or pmos Q1). The pin driving the Q1 must be set and compiled within the bootloader.
The pin needs to be set and compiled in the bootloader for the DFU enumeration, but also in the core for re-enumeration when the sketch starts and Serial-USB starts with it.

The bootloader only provides DFU. The core has another piece of code for driving the pull up, without that a re-enumeration will not happen after the bootloader is finished and the sketch starts, and the board would keep showing up as DFU. For maple boards that code drives the corresponding pin to manage the transistor. For generic boards what we do is change the usb pin mode to output pull up for a short period, then back to input mode.

But if that transistor is active low and the pin is floating, the resistor should stay disconnected, so the effect would be like not having it, and the enumeration by output-pullup should take place normally.

I wonder if the OP is compiling for Maple R3. That may cause the wrong re-enumeration code to be used.

ag123
Posts: 644
Joined: Thu Jul 21, 2016 4:24 pm

Re: Generic STM32F103R board not showing up in device manager and serial ports

Post by ag123 » Tue Mar 28, 2017 9:37 pm

i'd like to suggest this: install the maple or stm32duino bootloader as it has been successfully done

if it is a leaflabs maple style boards, i.e.
if the reset button and user buttons and leds is the same setup / connecting to the same pins as leaflabs maple
press reset and the user led should blink quickly 6 times
if this can be observed, it'd at least confirm that the bootloader is successfully installed and running properly

there is a strange feeling that either the boot loader isn't correctly installed or that some errors cause the boot loader to crash on the board, there could be various hardware / software related reasons, e.g. HSE external crystal running at a different frequency or the board is wired differently etc
for the next part i'm only familar with linux,

in linux run lsusb
http://www.stm32duino.com/viewtopic.php ... dfu#p25536
if you see 1eaf:0004 when running lsusb command this is the normal running mode (your sketch is installed and running)
if you see 1eaf:0003 when running lsusb that is maple in 'perpetual bootloader mode' ready to load the sketch
i'm not sure how to diagnose the same / tell if device 1eaf:0003 or 1eaf:0004 is connected, in windows, any suggestions?

found a useful link in windows (XP i think) , in device manager 1 could check the VID / PID of a device connected
http://xpenology.me/how-to-see-the-valu ... pid-stick/
if no device drivers are hooked up, it would most likely show as an unknown device

seeing these vid : pid would confirm that (1) the bootloader is successfully installed and running (2) usb is working as expected

then the remaining parts is to figure out / install the windows usb driver stack and the config vid/pid so that windows can detect it correctly as usb-serial or dfu device

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest