2016-06-09 08:54 PM
2016-06-10 02:16 AM
Hi piqx.sg,
I suggest you have a look at this manual: STM32 USB-FS-Device development kit, in section 9.4 and this : STM32F0x2xx USB Full Speed Device Library.Regards2016-06-12 07:58 AM
> usb audio endpoint single buffer possible?
Generally speaking, it's ''possible'', but your device could occasionally drop a frame of data stream. If you would like guarantee no data drop, double buffer should be required (in the cost of one frame delay). Usually, data drop wouldn't occur even with single buffer, while all of data streams are steadily running on a PC USB line. In this situation, the completion timing of your isoc endpoint occurs almost at the same phase in a frame (with some fluctuation cased by bit stuffing). It's because PC host controller and OS schedule isoc transactions in such way (isoc transaction starts immediately after SOF. the order of isoc transactions are fixed, if two or more isoc endpoints are registered). And then, your firmware has almost one frame interval from a completion of the isoc transaction to the next start of the transaction. However, just when other isoc endpoint (of other device) starts/stops on the same bus, the timing of your isoc transaction could move in the frame drastically. If the timing of your isoc endpoint would move forward too much, your firmware couldn't finish endpoint unload/priming until this new timing. And then, data drop could occurs at the frame. Of course, this ''accident'' doesn't occur so often. You may take this risk to keep the design in low cost. As of the ''Device'' (not OTG) USB engine of STM32, the datasheet assumes double-buffer for isoc endpoints. No description of isoc single-buffer. I haven't tried single-buffer configuration yet. But I remember, the same USB RAM location to the both of double buffers could work. Tsuneo2016-06-12 10:27 PM
Hi forumSTM32
thank you for pointing to those app notes, I have read them before.My issue is exploring possibility having 96khz 24bit playback with STM32F0 series which if using double buffering is kinda impossible given 1K limitation of USB packet memory.Hi Tsuneo,Thank you very much for your explanation.''But I remember, the same USB RAM location to the both of double buffers could work.''I tried this double buffer same USB packet memory location, it works!If only set as single buffer I have confirmed it will not work, will lose 1 frame.About endpoint : ''the order of isoc transactions are fixed''Are they always fixed? regardless stop and start of any isoc endpoints?The idea is if they always fixed I could copy the playback endpoint buffer during recording endpoint buffer is filled and vice versa. I just need to make sure I finish copying within time for transfering isoc data. Furthermore I assume the timing won't move too much as I use almost all of Full speed bandwidth with 96khz/24bits playback and 48khz/24bits recording (about 880 bytes+128 bytes for control = 1008 bytes per frame) Something like this[SOF][Isoc playback][Isoc recording][Ctrl][SOF][Isoc playback][Isoc recording][Ctrl] [copy Isoc play] [copy Isoc rec] [copy Isoc play] [copy Isoc rec]What do you think, workable?Of course if they are not fixed, and can be in any order due to start and stop, well I kinda screw up if still insist using stm32f0 series (or to be precise almost all stm32 except those high end and expensive chip that can support high speed).Thanks again and btw tsuneo just wonder if you have personal blog/website that I can follow?SG