It has been a while I presented that universal USB CDC component in this blog. The component has received a larger re-architecture, I wanted to support more than just USB CDC. For this, the CDC part is now present in a separate sub-component:
FSL_USB_CDC_Device Class Component
Everything related to the CDC class is now inside the FSL_USB_CDC_Device sub-component:
This means that now the CPU is set inside the CDC component.
The FSL_USB_Stack component now features added USB classes. The component comes now with the CDC class, as I’m still working on the HID and MSD components:
Sending lots of data, and fast…
Several users have reported issues with the original Freescale USB stack: if you send a lot of data in a fast way, data got corrupted. Up to the fact that a terminal application on the host might crash or block. It took me a while to get down to the root cause of this: a buffer overwrite originated by the USB interrupt. The same problem happens with the original Freescale source code. It was more likely to happen on slower microcontroller.
Good news: Today I have identified the problem and it is now fixed 🙂 At least for my self and on a student board/machine where the problem was present, it is fixed now.
Switching to the new component architecture is easy even for existing projects. Once the new components are loaded, set the used microprocessor in the FSL_USB_CDC_Device sub-component. As the CDC functions are inside a different component, make sure e.g.
CDC1_GetChar() is called instead of the earlier
USB1_GetChar(). A similar change I had to do in the FSShell component, so make sure you load this one too.
The new FSL_USB_Stack component (which includes the FSL_USB_CDC_Device) is available here. The examples I have created and published on the web will be updated over the course of the next days (well: nights).
Happy Stacking 🙂