Skip to content

stm32F070 USB #231

@fenugrec

Description

@fenugrec

Not sure if I'll have time to make a PR. Leaving this as a reminder and to share my findings.
Actually a PR is probably not even the right thing to do anyway, since there is not really a devkit or popular hardware with an F070 ?

The F070 is a bit special in not having USB clock recovery , unlike the F072.

I essentially took examples/stm32/f4/stm32f4-discovery/usb_cdcacm/cdcacm.c
and modified main.c thus :

// F070 can't do USB clock recovery , needs an external clock + PLL to derive the 48MHz ! Here using a 8M xtal
	rcc_clock_setup_in_hse_8mhz_out_48mhz();

	rcc_periph_clock_enable(RCC_USB);
	rcc_set_usbclk_source(RCC_PLL);
	rcc_periph_clock_enable(RCC_GPIOA);
//( Do not set USB pins to Alternate functions)

	usbd_dev = usbd_init(&st_usbfs_v2_usb_driver, &dev, &config,
			usb_strings, 3,
			usbd_control_buffer, sizeof(usbd_control_buffer));

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