TauLabs/TauLabs — pull request #423 by solidgoldbomb (2013-03-25 01:35:26+00:00)
Title: USB CDC/VCP Fixes (and F4 implementation)

This pull request fixes #147 and #389. It touches quite a bit of the USB code on F1, F3 and (primarily) on F4.

NOTE: windows users will probably have to delete/re-add the devices to ensure that your OS will notice that the USB descriptor has changed on F4 boards.

Here's a summary of the major changes:
* Adds support for USB CDC on F4 boards
* Fixes USB branding from PhoenixPilot -> TauLabs.org
* Fixes CDC uart state message handling on F1/F3
* Fix USB HID interface numbering for HID+CDC case on F1/F3/F4 (only matters on F4)
* Fixes board init for CDC/VCP on all boards to handle CDC interfaces
* Fixes all boards so they compile with ENABLE_DEBUG_CONSOLE=YES
* Fixes CDC port as debug console on all boards
* Changes com_aux to com_debug_console everywhere
* Makes CDC port drain when no DTE is attached so we don't block writing to the debug console when no terminal program is listening to CDC. F1/F3/F4.
* Fixes tracking of OUT transactions with data segments on EP0 (F4 only)
* Fixed handling of GET_REPORT via EP0 (F4 only) so it didn't give back stack data.
* Fixed broken handling of CDC packets with data length == max packet. Missing Zero-Length-Packet. Workaround limits data length to max packet -1 bytes. F1/F3/F4.
* Always init HID and CDC class drivers on F4 boards.

**Debug Console**

You'll have to actually write something to the debug console to make it interesting. You can try uncommenting the ````#define DEBUG_THIS_FILE```` in systemmod.c to test it.

To build with debug console enabled, do this:
````
make fw_flyingf3_clean
make fw_flyingf3 ENABLE_DEBUG_CONSOLE=YES
make fw_flyingf3_program
````

This needs to be tested fairly extensively on all host platforms and all boards. Any testing reports should include at least this:
* Host OS (version and whether you are 32/64-bit)
* git hash you tested with
* board you tested
* HW config you tested