Tunnel

From PaparazziUAV
Jump to: navigation, search

This completely replaces the normal autopilot code (leaving the USB bootloader intact) with a simple serial-to-serial pass-through that essentially connects the serial port (e.g. from the GPS) directly to the modem serial port or a USB-to-serial connection that creates a USB serial port that goes to GPS port or modem port. Use this only to gain direct access to the GPS for testing/configuration with U-Center or other software.

You can either use a serial UART tunnel or USB tunnel:

You have to add the tunnel targets to your airframe file if you want to use them. The tunnel targets must be part of a firmware section of name="setup". Add this too, if it doesn't already exist in your airframe file.

 <firmware name="setup">
   <target name="tunnel" board="twog_1.0" />
   <target name="usb_tunnel_0" board="twog_1.0" />
 </firmware>

Note, that you must replace the value of board with your board name.

UART tunnel

Use this if you have a serial cable to connect. The LEDs will blink when data is transferred. Type the following command from your paparazzi folder, substituting the name of your airframe and paying attention to case sensitivity:

make AIRCRAFT=myplane tunnel.upload

Connect the USB cable and power on the autopilot to receive the code.

This can be done without the USB bootloader by appending FLASH_MODE=ISP to the command line (specifying ISP serial loading). This will require a serial cable connection (i.e. FTDI USB-to-TTL). WARNING! Installing tunnel code with the ISP method will erase any USB bootloader code. Make sure you are able to install a bootloader yourself.

USB tunnel

This can be done without a serial cable just by having USB. The LEDs will blink when data is transferred. It can connect to either serial port on the autopilot (for Tiny 2.11: uart0=gps, uart1=modem). To connect USB to the gps type the following command from your paparazzi folder, substituting the name of your airframe and paying attention to case sensitivity:

make AIRCRAFT=myplane usb_tunnel_0.upload

Connect the usb cable and power on the autopilot to receive the code. The code will switch the USB to emulate a serial port that you can access at /dev/ttyACMx. Windows user can extract the usbser.sys file from .cab file in C:\WINDOWS\Driver Cache\i386 and store it somewhere (C:\temp is a good place) along with the usbser.inf file. Windows then creates an extra COMx port that you can use in a terminal program or with ucenter. To use the USB tunnel make sure you first power the autopilot before connecting USB not to end up in the USB bootloader.

Required Cables:

  1. USB cable
  2. USB to 8-pin Molex Picoblade Male-connector cable (optional, can use wireless link)

Steps:

  1. Connect USB Cable + 8-pin Molex adapter to USB on your laptop
  2. Connect 8-pin Molex Connector on the Adapter cable to "usb" on Tiny2.11
  3. Power on Tiny2.11
  4. Enter this command in a terminal: make AIRCRAFT=Twinjet tunnel.upload

Success will show this in the last lines of the terminal window

Found USB device
BootROM code: 2.12
Part ID: 0x0402FF25 (LPC2148, 512k Flash, 32k+8k RAM)
BootLoader version: 1.3
#
Starting software at 0x00004000

Now your Tiny2.11 will tunnel UART1 from the GPS direct to the serial connector on the board. So, using the 8-pin Molex to FTDI cable adapter (or use the wireless link e.g. XBee) you can use your computer to interact with the GPS module. One example is using u-blox u-center program to configure your GPS module. Like the bootloader if you bought your Tiny2.11 assembled check with your 3rd party vendors configured your GPS. Good chance you won't need to use the tunnel or configure the GPS module.

The required cable may included with 3rd party vendors!