Electronic – What exactly does OTG_FS_SOF do? Is it vital or imperative to USB host mode

stm32usb

When using the USB host mode, the STM32 has a pin named OTG_FS_SOF that ST gives very little useful information (in both Datasheet and USB tech documents) other than it has something to do with syncing when driving Audio devices.

However, I've seen various designs where no audio application was used but the SOF pin was connected anyway — pull up with 47k under most cases. Why is that? Is it very important to host mode? Must I connect it, or data wouldn't be sent and received properly? What does it do anyway?

Best Answer

The Start Of Frame signal can be used as a (slow) clock derived from the host's USB clock, which ideally should be locked to the host's general idea of time.

The focus on audio applications is because this is basically what it is useful for. If you let an audio stream run for a few hours without synchronized clocks, you are likely to have a FIFO over- or underrun, which would be audible, and deriving the ADC/DAC clocks from a host provided clock moves the responsibility to the host, allowing you to work without an elaborate resynchronization schema.

As the clock is rather slow, deriving anything faster than a few hundred kHz is going to run into stability issues on its own, so other applications don't really benefit.

What should happen with unused pins is usually specified in the datasheet or a separate pin connection guide -- if the 47k pull-up is common, it appears to be either from that document or assumed so because the last person also thought so. I'd probably cargo-cult that as well if I don't use the pin.