Luftboot

From PaparazziUAV
Revision as of 07:14, 7 February 2013 by Flixr (talk | contribs)
Jump to navigation Jump to search

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.