Jump to content


USB VCP Port Telemetry


  • Please log in to reply
15 replies to this topic

#1 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 21 February 2012 - 04:00 AM

How is the USB VCP port telemetry supposed to work?  I assumed that I would set it, and the CC board would show up as a virtual com port, and I would connect through telemetry through that.

What happens for me is:
  • Running Win7
  • Fresh clean/compile of next (both fw_coptercontrol and GCS)
  • Flash firmware
  • Boot
  • Configure USB HID Port to Disabled
  • Configure USB VCP Port to USBTelemetry
  • Apply, Save
  • Remove USB
  • Wait...
  • Plug back in USB
At this point the CC appears to crash 3 time, erase flash, and boot successfully.

I seem to remember someone saying that a new bootloader would be required for the new firmware.  Is that likely the problem?  If so, do I load the bootloader just like I do the firware?  I don't have a JTAG connector on the CC, so I don't really want to mess up the bootloader, and I don't think I've loaded a new bootloader on a CC.

If I understand what the VCP Port is, I assume that's what we want on the PipX, so I'm trying to get it working on something that I think it should work on.

#2 dankers

dankers

    Janitor

  • Administrators
  • 5129 posts
  • Country: flag of Australia Australia


Posted 21 February 2012 - 06:07 AM

This is still a work in progress, maybe PM Jose if you want to help him with it?

What we are aiming for is a composite device, CC and Revo will present a HID and a serial device. Yes this is critical for the PipX as it is likely the monitoring / configuration will be done over the HID channel and the serial will be raw data.

#3 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 21 February 2012 - 01:27 PM

Ah, okay.  I hand't thought about using a secondary USB interface to send control information to the PipX.  Of course, I don't know enough about USB to even know that you could do that, so I probably wouldn't be much help getting it working.

Using the side channel for configuration should simplify the software quite a bit.

#4 Mathieu

Mathieu

    Member

  • Members
  • PipPipPip
  • 103 posts
  • LocationVancouver, BC
  • Country: flag of Canada Canada


Posted 21 February 2012 - 09:06 PM

I probably can take a look at this because I have been playing with this for the MSD (to make CC look like a USB flash drive).
I am busy at work and some familly is hapening so I don t have much time for the project unfortunately.

Right now, I am trying to ravive a bricked CC (with serial port from jtag and BLE mode) but no success so far.

Anyway, this is another subject.

#5 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 21 February 2012 - 09:21 PM

View PostMathieu, on 21 February 2012 - 09:06 PM, said:

I probably can take a look at this because I have been playing with this for the MSD (to make CC look like a USB flash drive).

That sounds interesting.  Are you going to map the internal flash, external flash, or both?  I seem to remember that the external flash uses a dos filesystem, so I expect it's that.

#6 Mathieu

Mathieu

    Member

  • Members
  • PipPipPip
  • 103 posts
  • LocationVancouver, BC
  • Country: flag of Canada Canada


Posted 22 February 2012 - 01:34 AM

external flash.
It is more a fun project for me to do. It has not a lot of usage for CC (because of the 512bytes of external flash).
I can not keep up with the other developper's productivity unfortunately.
There is not enought hours in a day :(

I think the old pro board was using a external removable flash sd card with dos on it.
CC does not have any file system.
I try to put PetitFS on it.

All this is curently more or less pending as I have barely time for it.

I will try to look for something smaller to do on CC to make more progress.
(don't give me C++ Dave .... :P)

#7 dankers

dankers

    Janitor

  • Administrators
  • 5129 posts
  • Country: flag of Australia Australia


Posted 22 February 2012 - 03:02 AM

Yeah, I know you are not a C++ fan, however what I need to get you is one of the test OSDs, still waiting for them to come back however they have an SDCard on them that needs a file system, using the STM32 F2, we have more ram than CC.

#8 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 22 February 2012 - 03:55 AM

How about FatFs?  It looks like it works on FreeRTOS and STM32.  There's a description of an STM32 project here.

#9 Mathieu

Mathieu

    Member

  • Members
  • PipPipPip
  • 103 posts
  • LocationVancouver, BC
  • Country: flag of Canada Canada


Posted 22 February 2012 - 05:17 AM

Petit FatFs and PetitFs is exactly the same thing, same guy.
fat system compatible for embedded system.
It run on lots of platform because is hardware agnostic (i.e. you wrote your own disk IO layer) which we can link to our flash driver with some little work.
It has bare minimum and is really light.
Perfect for CC althought it is a challenge to try to get a filesystem on a 512bytes flash, there won't be a lot left for the data at the end :)

#10 peabody124

peabody124

    Crash Dummy

  • Administrators
  • 4113 posts
  • LocationHouston, TX
  • Country: flag of United States United States


Posted 22 February 2012 - 01:17 PM

Brian, IIRC from PT VCP doesn't work on windows.  However from your list of steps I think you are missing one - in the HwSettings there is also an option to configure the HID Descriptor too and you need to enable the VCP descriptor.

#11 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 22 February 2012 - 02:01 PM

Okay, so I configured the HID device for telemetry and the VCP device for ComBridge, and it didn't crash, but I don't think I got any extra device for the VCP.  I think this agrees with what you're saying, that the VCP doesn't work in Windows.

#12 peabody124

peabody124

    Crash Dummy

  • Administrators
  • 4113 posts
  • LocationHouston, TX
  • Country: flag of United States United States


Posted 22 February 2012 - 02:05 PM

Can you inspect the HID descriptor on windows?  It would be good to verify it is enumerating as a CDC device.

#13 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 22 February 2012 - 03:01 PM

I'm not sure how much information you cat get out of USB devices on windows.  I know it's not as easy as on Linux!  I'll take a look at it when I get home.  This would really simplify things on the PipX, so I would like to get it working.

#14 PT_Dreamer

PT_Dreamer

    GCS Core Developer

  • Administrators
  • 1211 posts
  • LocationCaparica, Portugal
  • Country: flag of Portugal Portugal


Posted 22 February 2012 - 03:36 PM

This is a WIP for the windows platform, also some documentation has to be written since you will probably lock yourself out of coms with the board and will need to boot in safe mode.
The PipXtreme will only need VCP to be used with non OP hardware. To use with OP hw it will use HID as-well.
Life is just a game, but atleast the graphics are awesome!

#15 Brian

Brian

    Core Developer

  • Members
  • PipPipPip
  • 567 posts
  • LocationTucson, AZ
  • Country: flag of United States United States


Posted 23 February 2012 - 01:41 AM

What does "This is a WIP for windows platform" mean?

The USB descriptor from USBView on Windows shows:

Device Descriptor:
bcdUSB:			 0x0200
bDeviceClass:		 0x00
bDeviceSubClass:	  0x00
bDeviceProtocol:	  0x00
bMaxPacketSize0:	  0x40 (64)
idVendor:		   0x20A0
idProduct:		  0x415B
bcdDevice:		  0x0402
iManufacturer:		0x01
0x0809: "openpilot.org"
iProduct:			 0x02
0x0809: "CopterControl"
iSerialNumber:		0x03
0x0809: "52FF69064882565350472487

According to the GCS I have USB HID Port configured for USBTelemetry and USB VCP Port configured for ComBridge.

#16 peabody124

peabody124

    Crash Dummy

  • Administrators
  • 4113 posts
  • LocationHouston, TX
  • Country: flag of United States United States


Posted 23 February 2012 - 06:35 AM

WIP = work in progress.  That descriptor doesn't include the parts that describe the interfaces though - such as HID and VCP, nor the endpoints.