Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program/Use "Microcontroller" via direct USB connection #20

Open
codyps opened this issue Nov 11, 2010 · 8 comments
Open

Program/Use "Microcontroller" via direct USB connection #20

codyps opened this issue Nov 11, 2010 · 8 comments

Comments

@codyps
Copy link
Collaborator

codyps commented Nov 11, 2010

The firmware on the LPC2458 (master processor) in the "IFI Cortex Microcontroller" and the firmware on the OI ("Joystick" or some such, don't remember processor id) are upgradable via a direct usb connection and some windows software.

Additionally, I've been told ROBOTC can program the STM32103F (user processor) on the "Microcontroller" via the same direct usb link (avoiding the orange "programming cable"/usb to serial converter with control line pulser).

Enabling this in Linux/anything will mean determining the contents of the usb protocol.

Unfortunately, for programming the STM32103F, there is no way to get the commands for transfer with out (a) having ROBOTC and using a usb-snooper on windows or (b) having a usb-sniffer to sit bettween the "Joystick" and "Microcontroller" while programming via the orange cable.

'b' has the additional benefit of allowing determination of how to retrieve serial output over direct usb.

Info

  • idVendor: C251h "Keil Software"
  • idProduct: 1D01h

Reports as HID device.

Endpoint 81h

64 byte interrupt transfer size @ 4ms interval
2nd to last byte of packet (0x3E) is a counter which increases by 1 at
each transmission.

@codyps
Copy link
Collaborator Author

codyps commented Nov 14, 2010

"Search" (on the VEXNet update program) appears to send a usb control message with the following fields:

  • request = 09h (HID SetReport)
  • value = 0200h
  • index = 0h
  • data : 63 bytes of FFh followed by 1 byte of 28h or 40h. 40h is sent to MC, 28h to OI.

Championship 2010 Firmware:
This causes the device to alter its interrupt transfer so that the 0x3C and 0x3D bytes in that trans fer change from 00 00 to 02 04 (in the current case I'm testing, MC coms)

Firmware 2.3:
No change seen following command.

The same command is sent to both OI and MC.

@brycelelbach
Copy link

EasyC can also program through the direct USB link (EasyC for Cortex). I'm attaching USB-sniffer logs taken during the download of the default EasyC firmware onto a Cortex chip.

@brycelelbach
Copy link

Hm, can't seem to attach it on github. Message me if you're interested in the logs.

@codyps
Copy link
Collaborator Author

codyps commented Aug 28, 2011

I am. Very interested.

@brycelelbach
Copy link

This is now doable with the latest LPC firmware, at least on Windows. I haven't thrown together a Linux driver yet. First, flash the Cortex to the latest firmware, and install the VeXNET serial driver for Windows from the VeX site. Then, put the Cortex into config mode, and plug it into your machine with any usb-to-usb cable. With the new driver, the Cortex now shows up as a USB CDC device instead of a USB HID device. The VeX windows driver emulates a COM port for it, and this can be used with utilities like stm32flash. On Linux, I haven't found a driver that does the emulation properly yet, but USB CDC is much eaasier to work with than USB HID.

@codyps
Copy link
Collaborator Author

codyps commented May 29, 2012

Hey, i took a look at the "VeXNET serial driver" when it initially came out. All it does is tell windows to use the standard usbserial driver, so all that is needed on linux is to add the vid/pid to a list in the kernel.

@brycelelbach
Copy link

nods

It's a little tricker than that - I tried doing that, but the input and output lines are reversed from the Linux defaults. I still need to do some more research here.

@codyps
Copy link
Collaborator Author

codyps commented May 30, 2012

Could you clarify what you mean by "the input and output lines are reversed from the Linux defaults"?

@codyps codyps closed this as completed May 30, 2012
@codyps codyps reopened this May 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants