USB disconnect pin Definition

STM32duino bootloader aka Maple bootloader
Post Reply
User avatar
Pito
Posts: 1529
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

USB disconnect pin Definition

Post by Pito » Thu Aug 31, 2017 10:29 am

I spent a whole day messing with my Bluepill (equipped with 1k5 pmos switch on PINB2) trying to solve the issue with not recognizing the Maple Serial after DFU in the latest Libmaple. Finally I dug up in board.h the

Code: Select all

#define BOARD_USB_DISC_DEV        NULL
#define BOARD_USB_DISC_BIT        NULL
and replaced with

Code: Select all

#define BOARD_USB_DISC_DEV        GPIOB
#define BOARD_USB_DISC_BIT        2
and now it works as expected (with an older repo it worked/works as I did define the pins there in past, but I forgot that needs to be done).

Q: While we may have Generic 103 boards with and/or without the hw assisted disconnect on a certain pin, would it be possible to use a switch in boards.txt such we can put it there for a specific board? Like -DUSB_DISC=PB2
In Daniel's core there is such a switch, afaik.
Pukao Hats Cleaning Services Ltd.

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

Re: USB disconnect pin Definition

Post by stevestrong » Thu Aug 31, 2017 11:38 am

The removal of the disc pin was intended: https://github.com/rogerclarkmelbourne/ ... a2f6c76051
Your board setup seems to be custom.
To use an additional switch in "boards.txt" I find no quite meaningful, because for your custom setup changing the "board.h" has the same effect.

Post Reply