Difference between revisions of "Luftboot"

From PaparazziUAV
Jump to navigation Jump to search
(Created page with "{| align=right |- |<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Firmware Flashing</categorytree> |} Put lu…")
 
Line 4: Line 4:
|}
|}


Put luftboot stuff here...
__TOC__
 
Luftboot is a bootloader for STM32 based boards and used for [[Lisa/M v2.0]].<br/>
The source is available in the [https://github.com/paparazzi/luftboot paparazzi/luftboot] repository on github. It is also integrated into the master branch as a submodule.
 
== Uploading the Luftboot USB Bootloader ==
If you bought your Lisa/M v2.0 (e.g. from Transition Robotics Inc.) it should already come with the bootloader installed.<br/>
If you want to (re)upload or update the bootloader, read on... otherwise see [[Lisa/M v2.0#Uploading new software]]
 
=== Required components ===
 
*Floss-JTAG debugger or Blacksphere mini JTAG
*Lisa/M board
*PC
 
=== Procedure ===
The easiest way is to checkout the master branch and use the integrated luftboot git submodule.<br/>
Otherwise clone the [https://github.com/paparazzi/luftboot Luftboot repository] directly:
<source lang=bash>git clone https://github.com/paparazzi/luftboot.git</source>
<ol>
<li>
Change directory into the ''luftboot/src'' folder, in paparazzi:
<source lang=bash>cd sw/ext/luftboot/src</source>
</li>
<li>
If you are using the submodule in the Paparazzi directory (''sw/ext/luftboot'') it should already be built, otherwise:
<source lang=bash>make clean && make</source>
</li>
<li>
Flash the Lisa/M v2.0
Attach the floss-jtag unit to the PC and connect it to the Lisa/M via the black connector.
Power the Lisa/M (easiest way is to connect to the PC via a micro-USB cable).
<source lang=bash>make flash DEV_SERIAL="LM2-ser"</source>
where "ser" stands for the serial number of your Lisa/M. So for example if you have lisa/m with the serial number 020 this would be:
<source lang=bash>make clean && make flash DEV_SERIAL="LM2-020"</source>
</li>
</ol>
 
=== Boot Sequence ===
 
* Luftboot
** Check if ADC2 is configured as output pull down indicating software bootloader request
*** '''If ADC2 output pull down:''' initialize usb and stay in bootloader mode
** Setting the ADC2 pin to input pull up
** Checking if the ADC2 pin is low
*** '''If ADC2 low:''' initialize USB and stay in bootloader mode
*** '''If ADC2 high:''' check if there is a payload at 0x8002000
**** '''If payload detected:''' set vector table pointer to be at 0x8002000 and jump to the reset handler of the payload
**** '''If payload not detected:''' initialize USB and stay in bootloader mode
 
== Luftboot USB permissions ==
 
[[Installation/Linux#Udev_rules|Copy the udev-rules file]] is needed for the upload software to get permission to use this hardware in your PC for uploading.
For short: the Python program "stm32_mem.py" needs permission to write to the the Luftboot USB device. If you do not have set this rules already you get an error message, which explanation what is wrong is quite obscure due to the way python-libusb accesses the device.


[[Category:Firmware Flashing]]
[[Category:Firmware Flashing]]

Revision as of 08:14, 7 February 2013

Luftboot is a bootloader for STM32 based boards and used for Lisa/M v2.0.
The source is available in the paparazzi/luftboot repository on github. It is also integrated into the master branch as a submodule.

Uploading the Luftboot USB Bootloader

If you bought your Lisa/M v2.0 (e.g. from Transition Robotics Inc.) it should already come with the bootloader installed.
If you want to (re)upload or update the bootloader, read on... otherwise see Lisa/M v2.0#Uploading new software

Required components

  • Floss-JTAG debugger or Blacksphere mini JTAG
  • Lisa/M board
  • PC

Procedure

The easiest way is to checkout the master branch and use the integrated luftboot git submodule.
Otherwise clone the Luftboot repository directly:

git clone https://github.com/paparazzi/luftboot.git
  1. Change directory into the luftboot/src folder, in paparazzi:
    cd sw/ext/luftboot/src
    
  2. If you are using the submodule in the Paparazzi directory (sw/ext/luftboot) it should already be built, otherwise:
    make clean && make
    
  3. Flash the Lisa/M v2.0 Attach the floss-jtag unit to the PC and connect it to the Lisa/M via the black connector. Power the Lisa/M (easiest way is to connect to the PC via a micro-USB cable).
    make flash DEV_SERIAL="LM2-ser"
    

    where "ser" stands for the serial number of your Lisa/M. So for example if you have lisa/m with the serial number 020 this would be:

    make clean && make flash DEV_SERIAL="LM2-020"
    

Boot Sequence

  • Luftboot
    • Check if ADC2 is configured as output pull down indicating software bootloader request
      • If ADC2 output pull down: initialize usb and stay in bootloader mode
    • Setting the ADC2 pin to input pull up
    • Checking if the ADC2 pin is low
      • If ADC2 low: initialize USB and stay in bootloader mode
      • If ADC2 high: check if there is a payload at 0x8002000
        • If payload detected: set vector table pointer to be at 0x8002000 and jump to the reset handler of the payload
        • If payload not detected: initialize USB and stay in bootloader mode

Luftboot USB permissions

Copy the udev-rules file is needed for the upload software to get permission to use this hardware in your PC for uploading. For short: the Python program "stm32_mem.py" needs permission to write to the the Luftboot USB device. If you do not have set this rules already you get an error message, which explanation what is wrong is quite obscure due to the way python-libusb accesses the device.