Skip to content

Help with STM32F4 and platformIO #2787

Closed Answered by chintal
chintal asked this question in Q&A
Discussion options

You must be logged in to vote

I've worked it out.

For anyone looking in the future, tinyusb itself does not seem to do any low level initialization for the STM32F7. The ST HAL function HAL_PCD_Init() was needed to get the USB into a state in which it enumerates, which it now does for me. I have not checked if USBCDC actually works.

Note that unless you're using the whole of the STM32CubeMX generated project, you will also need the HAL_PCB_MspInit and DeInit functions with CubeMX generates in stm32f4xx_hal_msp.c or similar. These are relatively simple functions, though, and not difficult to write your own. They need to init / deinit :

  • Clock to the USB peripheral
  • GPIOs for Alternate Function
  • NVIC for the USB interrupt

A…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by chintal
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants