SOF is "start of frame". As it turns out, USB communication is based on frames and every frame begins with an SOF packet. All very well and good. Why should we care? Do we care? I don't know yet.
Being curious, I enabled the SOF interrupt and simply counted them, reporting every second how many had arrived in the past second. I learned two things:
First, you don't get any (on a USB device like the F103) unless the cable is plugged in. These things originate on the host.
Second you get 1000 of them every second, without fail. Printing a message every time you get one is annoying and unproductive.
Note that for something like a 115200 baud uart, this is entirely adequate. If we figure 10 bits per character for a uart (a rule of thumb I always use) this would be 11,520 characters per second. We could handle several of these over a single full speed link.
What I find surprising is that we don't do better than 64K bytes per second. We are told that full speed is 12 Mb/second and again, figuring 10 bits per character (which allows for various forms of overhead), this would allow for 1.2 M bytes per second, i.e. 1200 Kbytes per second. And we just learned that we will only get 64Kbytes per second for full speed.
Some additional reading allowed me to learn several thing. There is more to the story. For one thing "isochronous" USB connections can have 1023 byte packets, and 1000 of these each seconds would give 1.02 Mbyte/sec. Also I am told that "bulk" USB packets can pack 19 of these 64 byte packets into a frame, which would give us exactly 1.2 Mbyte/sec.
So, they didn't lie to us after all, there is just more to the story. Exactly how to arrange things so we get those 19 packets into a frame is unknown to me thus far. I also don't know yet if an ACM flavor serial link works in "bulk" or some other mode. But it doesn't matter given that 64 Kbytes/sec will handle our serial port anyway.
Tom's Computer Info / tom@mmto.org