Difference between revisions of "Tunnel"

From PaparazziUAV
Jump to navigation Jump to search
m (XML coloring)
 
(15 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{| align=right
|-
|<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Firmware</categorytree>
|}
The Tunnel is serial-to-serial pass-through. It connects  an autopilot serial port, e.g. from the GPS,  directly to the modem serial port or a USB-to-serial connection. This I/O in turn can go to your development PC for example. There are other uses no doubt, but this in the most common use.
The Tunnel completely replaces the normal autopilot code, leaving the USB bootloader intact). Use this for example to gain direct access to the GPS for debugging or testing. Also for configuration with [[GPS#GPS_configuration_using_U-Center|U-Center]] it will be quite useful.
You can either use a serial UART tunnel or USB tunnel:
You have to add the tunnel targets to your airframe file. The tunnel targets must be part of a firmware section of <code>name="setup"</code>. If it doesn't already exist in your airframe file, just add it.
An example on a Lisa M autopilot board
<source lang="xml">
  <firmware name="setup">
    <target name="tunnel" board="lisa_m_2.0" />
    <target name="usb_tunnel_0" board="lisa_m_2.0" />
  </firmware>
</source>
Note, that you must replace the value of <code>board</code> with your board name.
At the current state of the code only '''UART1''' goes to '''UART2''' and Vice versa and is sadly not configurable. Due to the opensource nature of PPRZ this can be made so ofcourse, you are welcomed to enhance the arch/uart_tunnel.c to add more and better functionality flexible tunnel port configuration.
Note that UART1 TX has no simple Physical connection on a Lisa/M
== 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 [[Media:Usbser.zip|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:  
Required Cables:  
<ol>
<ol>
<li>USB cable
<li>USB cable
<li>USB to 8-pin Molex Picoblade connector adapter cable
<li>USB to 8-pin Molex Picoblade Male-connector cable (optional, can use wireless link)
</ol>
</ol>
Steps:
Steps:
Line 9: Line 53:
<li>Connect 8-pin Molex Connector on the Adapter cable to "usb" on Tiny2.11
<li>Connect 8-pin Molex Connector on the Adapter cable to "usb" on Tiny2.11
<li>Power on Tiny2.11
<li>Power on Tiny2.11
<li>Enter this command in a terminal: make upload_bl PROC=GENERIC
<li>Enter this command in a terminal: make AIRCRAFT=Twinjet tunnel.upload
</ol>
</ol>
<p>Success will show this in the last lines of the terminal window</p>
<p>Success will show this in the last lines of the terminal window</p>
Line 20: Line 64:
Starting software at 0x00004000
Starting software at 0x00004000
</pre>
</pre>
[http://paparazzi.enac.fr/wiki/index.php/Tiny_v2#Programming BACK]
<p>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.</p> The required cable may included with 3rd party vendors!
 
[[Category:Firmware]] [[Category:User_Documentation]]

Latest revision as of 12:46, 22 November 2017

The Tunnel is serial-to-serial pass-through. It connects an autopilot serial port, e.g. from the GPS, directly to the modem serial port or a USB-to-serial connection. This I/O in turn can go to your development PC for example. There are other uses no doubt, but this in the most common use.

The Tunnel completely replaces the normal autopilot code, leaving the USB bootloader intact). Use this for example to gain direct access to the GPS for debugging or testing. Also for configuration with U-Center it will be quite useful.

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

You have to add the tunnel targets to your airframe file. The tunnel targets must be part of a firmware section of name="setup". If it doesn't already exist in your airframe file, just add it.

An example on a Lisa M autopilot board

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

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

At the current state of the code only UART1 goes to UART2 and Vice versa and is sadly not configurable. Due to the opensource nature of PPRZ this can be made so ofcourse, you are welcomed to enhance the arch/uart_tunnel.c to add more and better functionality flexible tunnel port configuration.

Note that UART1 TX has no simple Physical connection on a Lisa/M


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!