Difference between revisions of "Lpc21BootloaderUpload"
m |
m |
||
Line 1: | Line 1: | ||
== Installing the USB Bootloader == | |||
The USB bootloader only needs to be installed '''once''', when the board is first built and has never been used. [Image:Bare_TWOG_Board.jpg|thumb|right|Bare_TWOG_Board] The Bootloader is uploaded through the serial interface UART0 (Serial1) by holding pin P0.14 low during power-up on Tiny V1.x. For Tiny V2.x this pin is called BOOT. Also GPS_RESET has to be tied low during the serial programming to keep the GPS receiver quiet that shares the serial port with the download. If you have a TWOG, it is easier just to unplug the GPS module temporarily. If you did not make and soldered the Autopilot board yourself but bought it somewhere it may have already had the USB bootloader installed, please check with your supplier. In that case you can just '''skip''' the steps described here. | |||
You will need to convert the PC's RS232 Serial with voltage levels of +/-13V to 3.3V (or 5V) TTL in order to communicate directly with the Autopilot board. This can be accomplished in multiple ways. The easiest and most convenient method is to purchase or build a USB -> Serial 3.3V adapter similar to this one [http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm TTL-232R-3V3] [[Image:The_FTDI_RS232_USB_Cable.jpg|thumb|right|The FTDI RS232 USB Cable]] | |||
Some examples of suppliers: | |||
[http://www.sparkfun.com/commerce/product_info.php?products_id=199] | |||
[http://www.sparkfun.com/commerce/product_info.php?products_id=718] | |||
[http://www.pololu.com/products/pololu/0391/] | |||
[http://www.hvwtech.com/products_view.asp?CatID=166&SubCatID=183&SubSubCatID=0&ProductID=409] | |||
It is strongly advised that you use a USB-serial converter with of the [www.ftdichip.com/ FTDI brand] chip as FTDI serial chips are by default working well in Linux. As a nice bonus, the Paparazzi ground station software is configured to look for modems on FTDI ports by default, the converter can likely serve as a modem interface after it's use in Bootloader uploading. | |||
Make up a wiring harness similar to the following. | |||
<gallery> | |||
Image:Cable_Bootloader_Full.jpg|Bootloader cable | |||
Image:Cable_Bootloader_To_FTDI_USB.jpg|Bootloader cable to FTDI USB | |||
Image:Bootloader_helper_cable_to_USB_FTDI_Cable.jpg|Bootloader helper cable to USB FTDI cable | |||
</gallery> | |||
You may vary the details, however this is a working solution: | |||
Tiny V1.x (SERIAL_1):<br /> | |||
TINY RXD0 <-- PC SERIAL TX (5V or 3.3V) | |||
TINY TXD0 --> PC SERIAL RX (5V or 3.3V) | |||
TINY P0.14 --> attach to ground, or wire through a pushbutton to ground | |||
TINY GND --> PC SERIAL ADAPTER GND | |||
TINY RESET --> ''optional'' wired to ground through a pushbutton so you can reset | |||
Tiny V2.x (DOWNLOAD):<br /> | |||
TINY LPC_RXD0 <-- PC SERIAL TX (5V or 3.3V) | |||
TINY LPC_TXD0 --> PC SERIAL RX (5V or 3.3V) | |||
TINY BOOT --> attach to ground, or wire through a pushbutton to ground | |||
TINY GPS_RESET --> attach to ground, or wire through a pushbutton to ground | |||
TINY GND --> PC SERIAL ADAPTER GND | |||
TWOG V1.x (DOWNLOAD):<br /> | |||
TWOG LPC_RXD0 <-- PC SERIAL TX (5V or 3.3V) | |||
TWOG LPC_TXD0 --> PC SERIAL RX (5V or 3.3V) | |||
TWOG BOOT --> attach to ground, or wire through a pushbutton to ground | |||
TWOG GND --> PC SERIAL ADAPTER GND | |||
For TWOG make sure the GPS module is '''unplugged''' from the board. This is to prevent GPS serial data to disturb the uploading of the bootloader. | |||
[[Image:Where_To_Insert_Bootloader_Cable.jpg|thumb|right|Where to insert Bootloader cable]] | |||
Once this wiring is ready you will be ready to upload the USB Bootloader to the autopilot board from your PC. | |||
To prepare the Autopilot board to accept uploads over it's serial port you must have pin P0.14 LOW for at least 3ms while it is powering up or resetting. While it is still powered up it is ready to accept the Bootloader firmware code upload over the serial connection. | |||
<gallery> | |||
Image:Point_To_Connect_Ground.jpg|thumb|Point to_connect ground | |||
Image:Closeup_Ground_Point.jpg|Closeup ground point | |||
Image:Grounding_For_Bootloader_Closeup.jpg|closeup grounding point detail for Bootloader uploading | |||
</gallery> | |||
The next step while your board is all connected and powered up is to type the commands for uploading the bootloader firmware. | |||
<gallery> | |||
Image:Powerup_Now.jpg|Powerup now | |||
Image:TWOG_Bootloader_Overview.jpg|TWOG Bootloader overview | |||
</gallery> | |||
'''In Linux''' | |||
From your Paparazzi folder in Linux, type: | |||
$ make upload_bl PROC=GENERIC | |||
This will begin compiling your USB Bootloader and then attempt to transfer it to the Autopilot board. This will also assume you are using a USB -> Serial adapter for the connection. It uses /dev/ttyUSB0 by default. If your adapter is mapped to a different tty, you will need to modify the Makefile accordingly. | |||
[[Image:Wait_For_Bootloader_To_Upload.jpg|thumb|Wait for the bootloader to upload]] | |||
If everything is connected and dsetup correctly, after a while you will see the following messages | |||
[[Image:Shell_bootloader_upload_success.jpg|thumb|Shell Bootloader upload success]] | |||
'''In Windows''' | |||
If for some reason you need to program your autopilot board USB Bootloader in MS Windows you have to download the [http://www.standardics.nxp.com/support/documents/microcontrollers/zip/flash.isp.utility.lpc2000.zip LPC2000 Flash Utility V2.2.3] or later. You will then prepare the autopilot board and start it in ISP bootloader state as described in the previous. This small utility will ony help uploading the Bootloder firmware. You will need to copy your compiled '''bl.hex''' file from Linux to your Windows OS. This file will be then uploaded. | |||
In depth info about the boatloader can be forun in the [http://paparazzi.enac.fr/wiki/Reference/bootloader |Bootloader reference] | In depth info about the boatloader can be forun in the [http://paparazzi.enac.fr/wiki/Reference/bootloader |Bootloader reference] | ||
http://paparazzi.enac.fr/wiki/DevGuide/USBDownload | http://paparazzi.enac.fr/wiki/DevGuide/USBDownload |
Revision as of 03:45, 27 June 2010
Installing the USB Bootloader
The USB bootloader only needs to be installed once, when the board is first built and has never been used. [Image:Bare_TWOG_Board.jpg|thumb|right|Bare_TWOG_Board] The Bootloader is uploaded through the serial interface UART0 (Serial1) by holding pin P0.14 low during power-up on Tiny V1.x. For Tiny V2.x this pin is called BOOT. Also GPS_RESET has to be tied low during the serial programming to keep the GPS receiver quiet that shares the serial port with the download. If you have a TWOG, it is easier just to unplug the GPS module temporarily. If you did not make and soldered the Autopilot board yourself but bought it somewhere it may have already had the USB bootloader installed, please check with your supplier. In that case you can just skip the steps described here.
You will need to convert the PC's RS232 Serial with voltage levels of +/-13V to 3.3V (or 5V) TTL in order to communicate directly with the Autopilot board. This can be accomplished in multiple ways. The easiest and most convenient method is to purchase or build a USB -> Serial 3.3V adapter similar to this one TTL-232R-3V3
Some examples of suppliers: [1] [2] [3] [4]
It is strongly advised that you use a USB-serial converter with of the [www.ftdichip.com/ FTDI brand] chip as FTDI serial chips are by default working well in Linux. As a nice bonus, the Paparazzi ground station software is configured to look for modems on FTDI ports by default, the converter can likely serve as a modem interface after it's use in Bootloader uploading.
Make up a wiring harness similar to the following.
You may vary the details, however this is a working solution:
Tiny V1.x (SERIAL_1):
TINY RXD0 <-- PC SERIAL TX (5V or 3.3V) TINY TXD0 --> PC SERIAL RX (5V or 3.3V) TINY P0.14 --> attach to ground, or wire through a pushbutton to ground TINY GND --> PC SERIAL ADAPTER GND TINY RESET --> optional wired to ground through a pushbutton so you can reset
Tiny V2.x (DOWNLOAD):
TINY LPC_RXD0 <-- PC SERIAL TX (5V or 3.3V) TINY LPC_TXD0 --> PC SERIAL RX (5V or 3.3V) TINY BOOT --> attach to ground, or wire through a pushbutton to ground TINY GPS_RESET --> attach to ground, or wire through a pushbutton to ground TINY GND --> PC SERIAL ADAPTER GND
TWOG V1.x (DOWNLOAD):
TWOG LPC_RXD0 <-- PC SERIAL TX (5V or 3.3V) TWOG LPC_TXD0 --> PC SERIAL RX (5V or 3.3V) TWOG BOOT --> attach to ground, or wire through a pushbutton to ground TWOG GND --> PC SERIAL ADAPTER GND
For TWOG make sure the GPS module is unplugged from the board. This is to prevent GPS serial data to disturb the uploading of the bootloader.
Once this wiring is ready you will be ready to upload the USB Bootloader to the autopilot board from your PC.
To prepare the Autopilot board to accept uploads over it's serial port you must have pin P0.14 LOW for at least 3ms while it is powering up or resetting. While it is still powered up it is ready to accept the Bootloader firmware code upload over the serial connection.
The next step while your board is all connected and powered up is to type the commands for uploading the bootloader firmware.
In Linux
From your Paparazzi folder in Linux, type:
$ make upload_bl PROC=GENERIC
This will begin compiling your USB Bootloader and then attempt to transfer it to the Autopilot board. This will also assume you are using a USB -> Serial adapter for the connection. It uses /dev/ttyUSB0 by default. If your adapter is mapped to a different tty, you will need to modify the Makefile accordingly.
If everything is connected and dsetup correctly, after a while you will see the following messages
In Windows
If for some reason you need to program your autopilot board USB Bootloader in MS Windows you have to download the LPC2000 Flash Utility V2.2.3 or later. You will then prepare the autopilot board and start it in ISP bootloader state as described in the previous. This small utility will ony help uploading the Bootloder firmware. You will need to copy your compiled bl.hex file from Linux to your Windows OS. This file will be then uploaded.
In depth info about the boatloader can be forun in the |Bootloader reference