Init no pull in VBUS sense
Is there an existing issue for this problem?
- [x] I have searched the existing issues
What part of EdgeTX is the focus of this bug?
Transmitter firmware
Current Behavior
For the TX16S, only capacitor on the PA9, VBUS_sense pin, no pull down resistor.
So some times it could be possible PA9 couple with some other line and got something like 2.2v, which make the USB function selection pop up on the screen.
So it would be better to change the line 136 in
edgetx\radio\src\targets\common\arm\stm32\usb_driver.cpp
gpio_init(USB_GPIO_VBUS, GPIO_IN, GPIO_PIN_SPEED_LOW);
to
gpio_init(USB_GPIO_VBUS, GPIO_IN_PD, GPIO_PIN_SPEED_LOW);
Expected Behavior
no unexpected pop up of USB fuction selection
Steps To Reproduce
occasionally
Version
2.11.1
Transmitter
RadioMaster TX16S / TX16SMK2
Operating System (OS)
No response
OS Version
No response
Anything else?
No response
Based on the RadioMaster TX16S DFU button modification it seems removing the resistor connecting the BOOT0 pin to VBUS causes VBUS to float high and that requires an extra pull-down resistor. I think that means that the BOOT0 pin is acting as the pull-down for VBUS.
This part cannot be changed without caution. Will affect all radios.
Indeed, since that isn't the full reverse engineered schematic for that pin... there are two resistors that are also connected to BOOT0 and GND. i.e. when there is a voltage present on USB_VBUS, the two resistors act as a voltage divider to BOOT0, and if there is no voltage present they should be pulling PA9 down to GND.
Based on the RadioMaster TX16S DFU button modification it seems removing the resistor connecting the BOOT0 pin to VBUS causes VBUS to float high and that requires an extra pull-down resistor. I think that means that the BOOT0 pin is acting as the pull-down for VBUS.
If this is not function properly because of a hardware DIY, then I think the best way to address the problem is to revise the mod. piggy packing a resistor with C342 can be an option.
Yes sure we can always add an external pull up resistor, but just think init the pin with input pull up is a more resonable fix.