Minimum pin access to program via STLink

If you made your own board, post here, unless you built a Maple or Maple mini clone etc
User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Minimum pin access to program via STLink

Postby RogerClark » Mon Apr 25, 2016 9:49 pm

I am not sure why you think a custome booloader would be a problem.
Its easy to add a new target to the existing bootloader and change the USB reset pin.

If you dont use a transistor to reset the USB, its not guranteed to work on all computers.
As what we do with boards like the BluePill etc is basically a hack. But we had no choice but to use a hack / workaround, as we cant change how those boards are made.

Its up to you, but if you are designing a board which you intend to make available for other people to use, I think you should seriously consider adding a reset transistor, even though that means loosing a GPIO line.

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

Re: Minimum pin access to program via STLink

Postby RogerClark » Mon Apr 25, 2016 11:27 pm

You should take a look at this thread

viewtopic.php?t=642&start=30

Also. I'm pretty sure there is a commercial board, which already uses the STM32F103T but I'm having trouble tracking it down.

I'm pretty sure someone has posted a link to it on the forum somewhere.

michaeliv
Posts: 15
Joined: Tue Apr 12, 2016 4:55 am

Re: Minimum pin access to program via STLink

Postby michaeliv » Tue Apr 26, 2016 2:00 am

RogerClark wrote:You should take a look at this thread

viewtopic.php?t=642&start=30

Also. I'm pretty sure there is a commercial board, which already uses the STM32F103T but I'm having trouble tracking it down.

I'm pretty sure someone has posted a link to it on the forum somewhere.

Thanks for the thread, it's very similar to what I'm trying to do.
You might have been refering to this board: http://www.artekit.eu/products/devboard ... m32-dip36/ linked in this thread: viewtopic.php?t=619

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

Re: Minimum pin access to program via STLink

Postby RogerClark » Tue Apr 26, 2016 3:19 am

@michaeliv

I think there is another STM32F103T board available, its not as long.

I will try to find it

Edit. Found it

http://www.hotmcu.com/stm32f103tb-arm-c ... cPath=1_20

Note. It looks like this company has some dodgy / illegal software hosted on their site.

stevech
Posts: 442
Joined: Thu Aug 27, 2015 6:32 am

Re: Minimum pin access to program via STLink

Postby stevech » Wed Apr 27, 2016 4:36 am

RogerClark wrote:@stevech

Are you sure STLink needs to be connected to Vcc.

Yes, SWD need to SENSE target Vcc, not use it for power. I recall that ST-Link won't run without sensing Vcc present. Also J-Link.

michaeliv
Posts: 15
Joined: Tue Apr 12, 2016 4:55 am

Re: Minimum pin access to program via STLink

Postby michaeliv » Wed Apr 27, 2016 4:47 am

OK, I've decided to add a USB disconnect circuit. I'm still deciding on which one would work best.
What would be the minimum component one that would work reliably ?
I found this one with 2 resistor + PNP that is claimed to be reliable: viewtopic.php?t=780
Also, there is the Maple Mini one but that uses 2 transistors.
Suggestions for best to use ?

Also on a side note -- does anyone know why my blue pill won't enumerate if I remove R10(10K resistor from PB12 to 3V3).

Thanks!

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

Re: Minimum pin access to program via STLink

Postby RogerClark » Wed Apr 27, 2016 8:02 am

10k is very high for USB enumeration, 1.5k is more common.

I think the pullup is part of the USB spec and indicates to the host that a slave is attached.

Without it, the USB won't re-enumerate.


Also.

Re: Circuits of USB reset transistors

See also http://store.iteadstudio.com/images/pro ... e-v1_0.pdf

They use a P Channel FET and 2 resistors.

I have been meaning to test this way of resetting the USB, and I bought some P Channel FETS a while ago, but never got around to trying it.

As far as I can tell, either a single PNP (or P Channel) device is needed, or 2 NPN devices, as the purpose of the transistor is to pull USB D+ (PA12) high via 1.5k when signaled to reset the USB

Our hack method (with the 1.5k resistor permanent pulling up USB D+), relies on the GPIO being able to drive PA12 low. But this isnt really how you are supposed to reset the USB, it just happens to work most of the time ;-)

michaeliv
Posts: 15
Joined: Tue Apr 12, 2016 4:55 am

Re: Minimum pin access to program via STLink

Postby michaeliv » Wed Apr 27, 2016 3:48 pm

Thanks for the info, now I'm a bit confused however.
I did not know that a pull-up is required for enumeration.
BTW when you say re-enumerate do you mean:
- Initial device identification, when the device is connected for the 1st time
- Device re-identification after messing with the D+ line

So in order to adequately force device re-identification, you would have to have both the D+ and D- pins floating, without any pull-up, correct ?
If that's the case then why use a transistor for disconnect ? Why not have D+ connected to another GPIO through a 1.5k resistor and configure the GPIO to output 3.3v, then when you want to re-identify the device, set the GPIO to floating. How is this different than using a GPIO-controlled transistor ?

Does anyone have a link where more details about this are given ? Preferably a straightforward explication, not a 500 page USB spec :D

User avatar
martinayotte
Posts: 1163
Joined: Mon Apr 27, 2015 1:45 pm

Re: Minimum pin access to program via STLink

Postby martinayotte » Wed Apr 27, 2016 6:01 pm


michaeliv
Posts: 15
Joined: Tue Apr 12, 2016 4:55 am

Re: Minimum pin access to program via STLink

Postby michaeliv » Wed Apr 27, 2016 6:10 pm

martinayotte wrote:Here is one link : http://www.beyondlogic.org/usbnutshell/usb2.shtml

From that I gather that the host uses the 1.5k resistor to detect that a high speed device is connected.
So in theory the suggestion about connecting a 1.5k resistor from D+ pin to another GPIO which would output 3.3v should work, right ? I see no reason to use a GPIO-controlled transistor. I guess there must be something I'm missing.


Return to “Custom design boards”

Who is online

Users browsing this forum: No registered users and 1 guest