Blue Pill with USB disconnect circuit added

If you made your own board, post here, unless you built a Maple or Maple mini clone etc
fredbox
Posts: 83
Joined: Tue Jul 07, 2015 4:44 pm

Blue Pill with USB disconnect circuit added

Postby fredbox » Sun Dec 06, 2015 5:54 am

I haven't had a lot of success using the generic_pc13 bootloader on the blue pill. After flashing the bootloader, it uploads the first sketch successfully, but subsequent uploads require clicking upload and playing with the reset button. Also, the serial port does not enumerate unless I temporarily connect a 1K resistor from PA12 to ground. I'm using Linux Mint 17.2.

I have no issues on the baite maple mini. It uploads consistently and the serial port enumerates.

As an experiment, I removed R10 and added a simple USB disconnect circuit to the board. I used a 2N3906 for the PNP transistor, but I suspect most anything would work ok.
bpreset_sch.png
bpreset_sch.png (1.15 KiB) Viewed 1545 times
I used PB9 to be the same as the maple mini.

Here is a picture of the three added parts.
bp_reset_wiring.jpg
bp_reset_wiring.jpg (12.12 KiB) Viewed 1545 times

I made a new generic bootloader to use the new circuit.

Code: Select all

#elif defined TARGET_GENERIC_F103_PC13_DISC

   #define HAS_MAPLE_HARDWARE  1   
   #define LED_BANK         GPIOC
   #define LED_PIN          13
   #define LED_ON_STATE      0
   
   /* USB Disc Pin Setup.   USB DISC is PB9 */
   #define USB_DISC_BANK       GPIOB
   #define USB_DISC            9

generic_boot20_pc13_disc.zip
(4.89 KiB) Downloaded 48 times

I modified STM32F1/variants/generic_stm32f103c/board/board.h to point to the disconnect pin.

Code: Select all

#define BOARD_USB_DISC_DEV        GPIOB
#define BOARD_USB_DISC_BIT        9
(This was using PB10. I would have expected this to point to PA12).

This board now works like the maple mini.
I can now get consistent uploads without having to press the reset button and the serial port enumerates correctly.

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

Re: Blue Pill with USB disconnect circuit added

Postby RogerClark » Sun Dec 06, 2015 7:13 am

@fredbox

I was initially going to do the same sort of modification on my RedPill boards, but the hack using GPIO on USB D+ works OK for me on Windows.

I was however going to use a P-Channel FET instead of a PNP transistor.

Its kinda of strange that the GPIO initially enumerates in the bootloader but not from the sketch. I presume you had the correct board the selected ? As the core has the same code to re-enumerate via GPIO as the bootloader does.

But I understand that Linux may behave differently from WIndows and OSX and also I've heard of OSX machines also not always re-enumerating. But on OSX this seems to be a timing, problem, as I recall one user had to tweak the USB reset time delay (passed in).

Part of the problem is also DFU-Util doesn't seem to have a timeout period in the OSX and Linux versions, so if the USB device is not ready at exactly the correct time, uploads fail for some people (mainly OSX users)

bianchifan
Posts: 77
Joined: Sun Oct 18, 2015 1:27 pm
Location: W'tal, Germany

Re: Blue Pill with USB disconnect circuit added

Postby bianchifan » Sun Dec 06, 2015 11:21 am

blue pill.

?? Why pill, it's rectangled?
I know "pill" as a housing for Power-LEDs in flashlights ;)

fredbox wrote: I'm using Linux Mint 17.2.
...
As an experiment, I removed R10 .

And R10 was what value?
I soldered 2k2 on top, 1k8 are nice for 1k5 result.

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

Re: Blue Pill with USB disconnect circuit added

Postby fredbox » Sun Dec 06, 2015 11:46 pm

I was however going to use a P-Channel FET instead of a PNP transistor.
I thought about that also, but the ones I have here show that they need 3.5v from gate to source, so they wouldn't be suitable for a circuit powered by 3.3V
Why pill, it's rectangled?
I believe it's a reference for these boards being somewhat difficult to use.

User avatar
Rick Kimball
Posts: 776
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Blue Pill with USB disconnect circuit added

Postby Rick Kimball » Mon Dec 07, 2015 1:15 am

fredbox wrote:I believe it's a reference for these boards being somewhat difficult to use.

Actually inspiration was drawn from the movie the Matrix:
http://matrix.wikia.com/wiki/Redpill

Find my original post comparing the red and blue boards from ebay:
http://stm32duino.com/viewtopic.php?f=28&t=117
-rick

jcw
Posts: 170
Joined: Mon Oct 26, 2015 8:16 am

Re: Blue Pill with USB disconnect circuit added

Postby jcw » Sat Dec 12, 2015 3:52 pm

Ah, I thought it was from Alice in Wonderland. Oh well, here's https://en.wikipedia.org/wiki/Red_pill_and_blue_pill on the subject :)


Return to “Custom design boards”

Who is online

Users browsing this forum: No registered users and 1 guest