Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: Want to emulate existing HID device. What information do I need?

  1. #1

    Want to emulate existing HID device. What information do I need?

    Hey, there is a USB HID device I want to emulate for testing. These are things I have available to me:
    • Python and C code showing how to talk to the USB device. I can make out that this is an HID device.
    • A Wireshark dump showing the communication to the device. I don't know USB very well so I am not sure what part of that dump is needed to emulate a device.


    Well, I have the code to talk to the device, but I am not quite sure what I would really need to do to emulate this on the Teensy 3.1. I am assuming there is a way to do custom HID devices with the Teensy 3.1?

    Things I know I need:
    • HID descriptor. I "think" I can pick this out of the Wireshark data.
    • The control/format for sending requests. The code I have seems to send an array of data of a fixed size for every request.
    • The format for receiving data. I think it is just an array I get back, not sure on length though.


    To complicate things I don't have the device on hand. But if I could get my device to respond to the same code that would be fine. Also, is it possible for a single device to return multiple VID and PID values to emulate multiple devices at once? I would love to keep the serial port functioning on top of the new HID interface.

  2. #2
    Apparently it looks like the device is using RAW HID. I found the Teensy 3.1 code for doing RAW HID for itself. Then after looking at the devices code it looks like it is send/response interface where is sends 64 bytes on every message. Then it expects to get 64 bytes back. That sounds like RAW HID to me. So I will give that a shot. Sounds like most of the what I "thought" I needed is already done! Woot!

  3. #3
    I am so close to figuring this out.

    However the page I linked https://www.pjrc.com/teensy/rawhid.html is not working for overriding the VID and PID. I found the usb_desc.h and was able to change it in there. However, I would like to able to select the correct HID device via the IDE.

    So if I add my own entry into the usb_desc.h can I get it to show up where it is selectable in the IDE?

    Since I am creating a RAW HID device I will just copy the existing RAW HID device and tweak the VID, PID, and strings appropriately. I will also set the #define to enable the rest of the RAW_HID code. I just need to be able to control that process.

  4. #4
    I am soooooo close to what I want.

    I have added a new entry for the raw HID device into the menu of the IDE for Teensy:
    Code:
    teensy31.menu.usb.rawhidrt.name=Raw HID (RT)
    teensy31.menu.usb.rawhidrt.build.define0=-DUSB_RAWHID -DUSB_RAWHID_OVERRIDE 
    teensy31.menu.usb.rawhidrt.fake_serial=teensy_gateway
    This "seems" to work and I even see the -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE values in the gcc compile message during compile. But it never sets the USB_RAWHID_OVERRIDE define. If I switch positions with the 2 defines then it never sees the USB_RAWHID one. I am totally baffled how it could see these in the compile strings, but not see them during compilation.

    Here are my changes to usb_desc.h:
    Code:
    #elif defined(USB_RAWHID) 
      #if !defined(USB_RAWHID_OVERRIDE)
      #define VENDOR_ID		0x16C0  
      #define PRODUCT_ID		0x0486  
      #define RAWHID_USAGE_PAGE	0xFFAB  // recommended: 0xFF00 to 0xFFFF
      #define RAWHID_USAGE		0x0200  // recommended: 0x0100 to 0xFFFF
      #define MANUFACTURER_NAME	{'T','e','e','n','s','y','d','u','i','n','o'}
      #define MANUFACTURER_NAME_LEN	11
      #define PRODUCT_NAME		{'T','e','e','n','s','y','d','u','i','n','o',' ','R','a','w','H','I','D'}
      #define PRODUCT_NAME_LEN	18
      #define EP0_SIZE		64
      #define NUM_ENDPOINTS         6
      #define NUM_USB_BUFFERS	12
      #define NUM_INTERFACE		2
      #define RAWHID_INTERFACE      0	// RawHID
      #define RAWHID_TX_ENDPOINT    3
      #define RAWHID_TX_SIZE        64
      #define RAWHID_TX_INTERVAL    1
      #define RAWHID_RX_ENDPOINT    4
      #define RAWHID_RX_SIZE        64
      #define RAWHID_RX_INTERVAL    1
      #define SEREMU_INTERFACE      1	// Serial emulation
      #define SEREMU_TX_ENDPOINT    1
      #define SEREMU_TX_SIZE        64
      #define SEREMU_TX_INTERVAL    1
      #define SEREMU_RX_ENDPOINT    2
      #define SEREMU_RX_SIZE        32
      #define SEREMU_RX_INTERVAL    2
      #define RAWHID_DESC_OFFSET	(9 + 9)
      #define SEREMU_DESC_OFFSET	(9 + 9+9+7+7 + 9)
      #define CONFIG_DESC_SIZE	(9 + 9+9+7+7 + 9+9+7+7)
      #define ENDPOINT1_CONFIG	ENDPOINT_TRANSIMIT_ONLY
      #define ENDPOINT2_CONFIG	ENDPOINT_RECEIVE_ONLY
      #define ENDPOINT3_CONFIG	ENDPOINT_TRANSIMIT_ONLY
      #define ENDPOINT4_CONFIG	ENDPOINT_RECEIVE_ONLY
      
      #else
      #define VENDOR_ID			0x16C0  
      #define PRODUCT_ID		0x048A  // testing new ID
      #define RAWHID_USAGE_PAGE	0xFFAB  // recommended: 0xFF00 to 0xFFFF
      #define RAWHID_USAGE		0x0200  // recommended: 0x0100 to 0xFFFF
      #define MANUFACTURER_NAME	{'T','e','e','n','s','y','d','u','i','n','o'}
      #define MANUFACTURER_NAME_LEN	11
      #define PRODUCT_NAME		{'T','e','e','n','s','y','d','u','i','n','o',' ','R','a','w','H','I','D'}
      #define PRODUCT_NAME_LEN	18
      #define EP0_SIZE		64
      #define NUM_ENDPOINTS         6
      #define NUM_USB_BUFFERS	12
      #define NUM_INTERFACE		2
      #define RAWHID_INTERFACE      0	// RawHID
      #define RAWHID_TX_ENDPOINT    3
      #define RAWHID_TX_SIZE        64
      #define RAWHID_TX_INTERVAL    1
      #define RAWHID_RX_ENDPOINT    4
      #define RAWHID_RX_SIZE        64
      #define RAWHID_RX_INTERVAL    1
      #define SEREMU_INTERFACE      1	// Serial emulation
      #define SEREMU_TX_ENDPOINT    1
      #define SEREMU_TX_SIZE        64
      #define SEREMU_TX_INTERVAL    1
      #define SEREMU_RX_ENDPOINT    2
      #define SEREMU_RX_SIZE        32
      #define SEREMU_RX_INTERVAL    2
      #define RAWHID_DESC_OFFSET	(9 + 9)
      #define SEREMU_DESC_OFFSET	(9 + 9+9+7+7 + 9)
      #define CONFIG_DESC_SIZE	(9 + 9+9+7+7 + 9+9+7+7)
      #define ENDPOINT1_CONFIG	ENDPOINT_TRANSIMIT_ONLY
      #define ENDPOINT2_CONFIG	ENDPOINT_RECEIVE_ONLY
      #define ENDPOINT3_CONFIG	ENDPOINT_TRANSIMIT_ONLY
      #define ENDPOINT4_CONFIG	ENDPOINT_RECEIVE_ONLY
      #endif
    I know if I change #if !defined(USB_RAWHID_OVERRIDE) to #if defined(USB_RAWHID_OVERRIDE) (no !), then it will give the device the second PID. So I know the first -D is being passed, but not the second. I just cannot see how that is possible. Unless somehow the whitespace in between is strange. I am just using notepad++ to edit the boards.txt file.

    Edit:
    Compile output:
    Code:
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\rawhid1.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\rawhid1.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991458 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\analog.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\analog.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991458 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\eeprom.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\eeprom.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991459 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\keylayouts.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\keylayouts.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991459 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\math_helper.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\math_helper.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991459 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\mk20dx128.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\mk20dx128.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991459 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\nonstd.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\nonstd.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991459 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\pins_teensy.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\pins_teensy.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991459 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\serial1.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\serial1.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991460 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\serial2.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\serial2.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991460 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\serial3.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\serial3.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991460 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\touch.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\touch.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991460 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_desc.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_desc.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991460 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_dev.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_dev.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991460 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_joystick.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_joystick.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991460 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_keyboard.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_keyboard.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991461 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_mem.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_mem.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991461 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_midi.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_midi.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991461 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_mouse.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_mouse.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991461 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_rawhid.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_rawhid.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991461 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_seremu.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_seremu.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -DTIME_T=1422991461 -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_serial.c -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_serial.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\AudioStream.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\AudioStream.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\avr_emulation.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\avr_emulation.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\DMAChannel.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\DMAChannel.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\HardwareSerial1.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\HardwareSerial1.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\HardwareSerial2.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\HardwareSerial2.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\HardwareSerial3.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\HardwareSerial3.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\IntervalTimer.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\IntervalTimer.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\IPAddress.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\IPAddress.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\main.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\main.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\new.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\new.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\Print.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\Print.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\Stream.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\Stream.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\Tone.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\Tone.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_flightsim.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_flightsim.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\usb_inst.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_inst.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\WMath.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\WMath.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\WString.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\WString.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -DLAYOUT_US_ENGLISH -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\yield.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\yield.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\analog.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\eeprom.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\keylayouts.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\math_helper.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\mk20dx128.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\nonstd.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\pins_teensy.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\serial1.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\serial2.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\serial3.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\touch.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_desc.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_dev.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_joystick.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_keyboard.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_mem.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_midi.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_mouse.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_rawhid.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_seremu.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_serial.c.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\AudioStream.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\avr_emulation.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\DMAChannel.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\HardwareSerial1.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\HardwareSerial2.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\HardwareSerial3.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\IntervalTimer.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\IPAddress.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\main.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\new.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\Print.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\Stream.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\Tone.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_flightsim.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\usb_inst.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\WMath.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\WString.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-ar rcs E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\yield.cpp.o 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-gcc -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb -TC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3\mk20dx256.ld -o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\rawhid1.cpp.elf E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\rawhid1.cpp.o E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\core.a -LE:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp -larm_cortexM4l_math -lm 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\rawhid1.cpp.elf E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\rawhid1.cpp.eep 
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-objcopy -O ihex -R .eeprom E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\rawhid1.cpp.elf E:\Users\DEMOLI~1\AppData\Local\Temp\build3450704472226743232.tmp\rawhid1.cpp.hex 
    Binary sketch size: 10,064 bytes (of a 262,144 byte maximum)
    Estimated memory use: 2,728 bytes (of a 65,536 byte maximum)
    In case someone decides to get "cute" and yell at me about posting the code:
    Code:
    void setup() {
      // put your setup code here, to run once:
    
    }
    
    void loop() {
      // put your main code here, to run repeatedly: 
      delay(10);
    }
    Last edited by Demolishun; 02-04-2015 at 01:39 AM.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,007
    Maybe instead of this

    teensy31.menu.usb.rawhidrt.build.define0=-DUSB_RAWHID -DUSB_RAWHID_OVERRIDE

    try something like this

    teensy31.menu.usb.rawhidrt.build.define0=-DUSB_RAWHID
    teensy31.menu.usb.rawhidrt.build.define1=-DUSB_RAWHID_OVERRIDE

  6. #6
    I did try before.

    Here is what it puts out when I just ran that:
    Code:
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\tools\arm-none-eabi\bin\arm-none-eabi-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mcpu=cortex-m4 -DF_CPU=96000000 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -mthumb -nostdlib -D__MK20DX256__ -DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_RAWHID -DUSB_RAWHID_OVERRIDE -IC:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3 E:\Users\DEMOLI~1\AppData\Local\Temp\build4511800646333104914.tmp\rawhid1.cpp -o E:\Users\DEMOLI~1\AppData\Local\Temp\build4511800646333104914.tmp\rawhid1.cpp.o 
    In file included from C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3/usb_keyboard.h:34:0,
                     from C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3/WProgram.h:26,
                     from C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3/Arduino.h:1,
                     from rawhid1.ino:4:
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3/keylayouts.h:5411:14: error: 'KEYCODE_TYPE' does not name a type
    C:\arduino-1.0.5-r2 1.20 rc2\hardware\teensy\cores\teensy3/keylayouts.h:5412:14: error: 'KEYCODE_TYPE' does not name a type
    It is like it is messing up other things when I do that. It does put it in the gcc string though.

  7. #7
    Hey Paul,
    I think I am starting to understand your code raw hid implementation. I think the device I am trying to emulate has multiple endpoints. So in order to see a response from the rawhid I do this:
    Code:
    import sys
    import array
    import hid
    import exceptions
    from time import sleep
    
    VID = 0x16C0
    PID = 0x0486
    
    def main():
        devices = []
        for d in hid.enumerate(VID, PID):
            devices.append(d["path"])
    
        path = devices[0]
    
        device = hid.device()
        device.open_path(path)
    
        if device is None:
            print "no device"
            return
    
        device.set_nonblocking(1)
    
        # get serial
        g = array.array('B', [0] * 64)
        g[0] = 0 # endpoint?
        g[1] = 0xa
        device.write(g)
        sleep(1)
        print ["0x%.02x" % x for x in device.read(64)]
    
        # get firmware
        g = array.array('B', [0] * 64)
        g[1] = 1
        device.write(g)
        sleep(1)
        print ["0x%.02x" % x for x in device.read(64)]
    
        g = array.array('B', [0] * 64)
        g[1] = 2
        device.write(g)
        sleep(1)
        print ["0x%.02x" % x for x in device.read(64)]
    
        sleep(1)
    
        device.close()
    
    if __name__ == '__main__':
        main()
    This is a python HID implementation. It uses Cython to get the libhid (I think). Anyway, I noticed that when the first byte is not zero in my packet the raw HID device ignore my messages. So the device I am trying to emulate has a lot of different numbers for the for the first byte. I assume that I will need to define endpoints for all of those? Is it just a matter of adjusting the config then or do I need to write code to handle that? Or can I just decide what to do with the data instead of letting the code that decoders rawhid decypher it?

    I think it would be better if my code handled all of the messages if that is possible.

  8. #8
    I ended up just creating my define cases. That was the most expedient rather than figuring out why the compiler was not getting the proper defines into the compilation.

    I also got to looking at the wireshark data and found the transmission to the device was a bit more complicated that I first thought. I did get the Teensy 3.1 raw lib to make the software think it was a device, but a broken non-fuctional one. I found another way to emulate the device purely through software by being the middle man and just running as a Python program. That was the most productive way to solve my issue. I may get back later to trying to simulate the USB device, but for now it really is not that productive. It would be simpler to be the middle man software and just use the RAW HID or even just a serial mode to duplicate the device functions if I want it to be a USB device.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •