Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stm32F070 USB #231

Open
fenugrec opened this issue Dec 14, 2021 · 0 comments
Open

stm32F070 USB #231

fenugrec opened this issue Dec 14, 2021 · 0 comments

Comments

@fenugrec
Copy link

fenugrec commented Dec 14, 2021

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));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant