User Tools

Site Tools


doc:lighthouse:bootloader

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:lighthouse:bootloader [2019-03-04 17:48]
arnaud
doc:lighthouse:bootloader [2020-05-12 14:36] (current)
kimberly
Line 1: Line 1:
-====== Lighthouse deck bootloader ======+<WRAP center round important 60%> 
 +This page is deprecated and is moved to the main Bitcraze website. Please go to: 
 + 
 + [[ 
 +https://www.bitcraze.io/documentation/repository/ 
 +]]
  
-<WRAP center round important 70%> 
-**Warning**: This documentation is currently a work-in-progress working document. None of this is final. 
 </WRAP> </WRAP>
 +
 +
 +====== Lighthouse deck bootloader ======
  
 The [[projects:crazyflie2:expansionboards:lighthouse|lighthouse deck]] is based on an [[https://www.latticesemi.com/Products/FPGAandCPLD/iCE40UltraPlus|iCE40UP5K]] FPGA. The FPGA boots from an SPI flash to the bootloader, it is then able to boot to another configuration image. The bootloader gives access to the SPI memory and to a boot command to boot the user image. This allows the deck to be updated easily from the Crazyflie or from the auxiliary serial port. The [[projects:crazyflie2:expansionboards:lighthouse|lighthouse deck]] is based on an [[https://www.latticesemi.com/Products/FPGAandCPLD/iCE40UltraPlus|iCE40UP5K]] FPGA. The FPGA boots from an SPI flash to the bootloader, it is then able to boot to another configuration image. The bootloader gives access to the SPI memory and to a boot command to boot the user image. This allows the deck to be updated easily from the Crazyflie or from the auxiliary serial port.
Line 13: Line 19:
 ==== Uart protocol ==== ==== Uart protocol ====
  
-There is two UARTs on the deck, UART0 on the Crazyflie deck interface and UART1 on 2.54mm soldering pads available for external communication. The bootloader is available on both UARTs. The UARTs are setup with a baudrate of 115200.+There is two UARTs on the deck, UART0 on the Crazyflie deck interface and UART1 on 2.54mm soldering pads available for external communication. The bootloader is available on both UARTs. The UARTs are setup with a baudrate of 113200, one stop bit, no parity. 
 + 
 +<WRAP center round important> 
 +**Warning**: Version 1 of the bootloader has a bug that makes its baudrate be ~113200 instead of 115200 baud. This is a non-standard baudrate, it has been tested that using an FTDI USB-to-UART adapter setting a baudrate of 113200 works fine. 
 +</WRAP> 
  
 When using the UART, commands are sent on the RX line and answer will be sent back by the bootloader on the TX line. Since the bootloader and the Flash SPI bus are working much faster than the UART, there is no need for flow control. When using the UART, commands are sent on the RX line and answer will be sent back by the bootloader on the TX line. Since the bootloader and the Flash SPI bus are working much faster than the UART, there is no need for flow control.
Line 40: Line 51:
 ===== Bootloader protocol ===== ===== Bootloader protocol =====
  
-All numbers are expressed in little endian. +All numbers are encoded in little endian. 
  
 ==== Boot ==== ==== Boot ====
Line 112: Line 123:
 ===== Firmware versioning ===== ===== Firmware versioning =====
  
-The firmware is an iCE40 bitstream ((The bitstream format has been [[http://www.clifford.at/icestorm/format.html|documented by the icestorm project]] )). The bitstream start with the bytes 0xff 0x00 followed by a null terminated string and the 0x00 0xff. This null terminated string is a comment. In the Lighthouse deck this comment is used to store the version of the firmware as a version string. The intention is that the deck user (ie. the Crazyflie or other external board) must be able to find-out if the firmware is compatible or if it needs to be upgraded or downgraded.+The firmware is an iCE40 bitstream ((The bitstream format has been [[http://www.clifford.at/icestorm/format.html|documented by the icestorm project]] )). The bitstream start with the bytes 0xff 0x00 followed by a null terminated string and then 0x00 0xff. This null terminated string is a comment. In the Lighthouse deck this comment is used to store the version of the firmware as a version string. The intention is that the deck user (ie. the Crazyflie or other external board) must be able to find-out if the firmware is compatible or if it needs to be upgraded or downgraded.
  
-The version string format is a base 10 integer number in ascii indicating the version. For example "1". It follows the rules of the C function strtol() to be decoded so the string can start with white-space, followed by an optional "+" or "=" followed by decimal digits. The decoding stops at the first non-digit character.+The version string format is a base 10 integer number in ascii indicating the version. For example "1". It follows the rules of the C function strtol() to be decoded so the string can start with white-space, followed by an optional "+" or "-" followed by decimal digits. The decoding stops at the first non-digit character.
  
 In the context of the lighthouse firmware, versions >= 1 are released version and should be in parity (or handled) by the client connecting the board in order to boot the firmware. Versions <= 0 are development version and the intention is that the client will then boot it without further check. In the context of the lighthouse firmware, versions >= 1 are released version and should be in parity (or handled) by the client connecting the board in order to boot the firmware. Versions <= 0 are development version and the intention is that the client will then boot it without further check.
doc/lighthouse/bootloader.1551718109.txt.gz · Last modified: 2019-03-04 17:48 by arnaud