Skip to content

vbus pin configuration disagree in bootloader and px4firmware #30

@KIrill-ka

Description

@KIrill-ka

Bootloader code configures vbus pin with pulldown enabled.

#ifdef INTERFACE_USB
/* enable GPIO9 with a pulldown to sniff VBUS */
rcc_peripheral_enable_clock(&RCC_AHB1ENR, RCC_AHB1ENR_IOPAEN);
gpio_mode_setup(GPIOA, GPIO_MODE_INPUT, GPIO_PUPD_PULLDOWN, GPIO9);
#endif

According to stmf40x manual pullup/pulldowns must not be enabled for 5v pins.
6. To sustain a voltage higher than V DD +0.3, the internal pull-up and pull-down resistors must be disabled.
The documentation mentions 1k1 pulldown for VBUS (which obviously has to handle 5v), but it may be totally separate from normal GPIO pulldown.

In contrast to that, PX4Firmware doesn't enable pulldown. OTGFS vbus sensing configuration is also different. I see OTGFS_GCCFG_NOVBUSSENS bit set in px4firmware. OTG_FS_GCCFG_NOVBUSSENS is not set in libopencm3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions