The USB VCP Port has a new DebugConsole setting that
routes all output destined for PIOS_COM_DEBUG to the
emulated serial port.
To enable this in your build, you'll have to build like:
- make fw_coptercontrol_clean
- make fw_coptercontrol ENABLE_DEBUG_CONSOLE=YES
You can then output formatted text to the console
like this:
#if defined(PIOS_INCLUDE_DEBUG_CONSOLE)
PIOS_COM_SendFormattedString(PIOS_COM_DEBUG,
"foo is %u\r\n",
foo);
#endif /* PIOS_INCLUDE_DEBUG_CONSOLE */
Please ensure that all of your debug output is
wrapped with these macros so that your debug
code doesn't bloat the firmware image.
Serial ports now have a new HW setting called DebugConsole
which can be used to dump internal state to a serial port
for debug.
To enable this feature, you need to:
- make fw_coptercontrol_clean
- make fw_coptercontrol ENABLE_DEBUG_CONSOLE=YES
- configure one of the serial ports as DebugConsole in the GCS
- save settings
- power-cycle your board
Things to note:
- The console is at 57600,8N1.
- This is not currently configurable via the GCS.
- You can only have a single console enabled at a time.
These compiler options place each function and each global variable
into its own ELF section in each .o file. This, combined with the
linker option --gc-sections allows the linker to evict unused functions
and variables from the final ELF file.
On CC, the firmware flash bank is only 118784 bytes in total.
This commit reduces the .text segment from 114120 to 83536 and .data
from 572 bytes to 560 bytes. That frees up a grand total of 30596 bytes
of flash and 12 bytes of RAM.
Adds a new RCTransmitter setting for the USB HID interface which
emulates a USB HID joystick. The scaled RC receiver channels
from any RCVR protocol are passed through to the various emulated
joystick controls.
The main use for this feature is to allow you to use your own RC
transmitter with any RC simulator on a PC.
This is known to work with CRRCsim but should work with any simulator
that supports joystick input.
Every board has at least one LED (HEARTBEAT). Not all
users of LEDs need to be directly aware of which LED
configuration to choose when there may be more than one
possible configuration.
Hide the details of the differences between LEDs used in the
different HW revs for CC. This will allow generic code to
run on CC and CC3D without being exposed to the details of
the different pins used for the LEDs.
Use new PIOS_USB_UTIL_AsciiToUtf8() function to compose the
USB serial number rather than repeating that code for each
board.
All boards now append "+FW" or "+BL" to their USB serial numbers
to allow the descriptors to differ between FW and BL images.
Some versions of Windows will ignore the USB device serial number
if the string is not delivered with LANGID = English US 0x0409.
This is true regardless of the configured locale of the machine.
The serial number string descriptor was incorrectly null
terminated. The standard clearly states that there should
not be a null terminator.
Use new #defines to ensure that our strings are sized
properly.
BL images now always use hid-only.
FW images can use hid-only or hid+vcp but this is selected
ONLY at compile time based on whether PIOS_INCLUDE_USB_CDC
is defined.
CC uses HID+VCP by default now.
This makes the BL and FW images distinct devices with unique
serial numbers.
Windows (and maybe Mac) remembers the device descriptors and
the associated drivers based on this serial number. Providing
unique serial numbers for the BL and FW images allows us to
provide different sets of descriptors for the BL and FW images
without confusing these OSes.
BL version number is now also bumped to reflect the new
serial number generation algorithm.
Removes hard-coding of JTAG interface config in the
<board>_program make macros.
This allows the use of STLINKv2 for F4 boards while
continuing to use the FOSS JTAG revB on F1 boards.