Factory Firmware Test

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
Posts: 4
Joined: Mon Aug 17, 2020 2:35 pm

Factory Firmware Test

Post by zooeyday »

I received two new Lighthouse Decks earlier this week.

Each test was conducted using one base station V1 or V2.
The first issue was that when the base station was turned on and the Lighthouse Deck was booted using the factory firmware,
the sync was not found as shown below.

$ ./tools/print_frame.py /dev/ttyUSB0
Waiting for sync

When the power of the base station is turned off in this state, sync is found after a while,
and when the power of the base station is turned on again, the following output is displayed.

Using Basestation V2

Sensor: 2 TS:4c3a96 Width:8c90 Chan: None offset:208250 BeamWord:d17500

Sensor: 3 TS:96dd4f Width:3100 Chan: 1(0) offset:1742548 BeamWord:00365

Sensor: 2 TS:cc0003 Width: 36d Chan:16(0) offset:14684160 BeamWord:855a96

Sensor: 3 TS:03343a Width:1a9b Chan: 5(0) offset: 806 BeamWord:9b26bb

Sensor: 0 TS:7a9b32 Width:2fc8 Chan: 1(0) offset:2579099 BeamWord:aa0003

Sensor: 0 TS:765000 Width: 3 Chan: 6(0) offset:10843029 BeamWord:3413a

Sensor: 1 TS:00036c Width:631a Chan: None offset:7208963 BeamWord:7aa57f


Using Basestation V1

Sensor: 0 TS:900002 Width: 2c0 Chan: 1(0) offset:1493760 BeamWord:ca204a

Sensor: 3 TS:02b460 Width:404a Chan: 4(1) offset: 751 BeamWord:4a202c

Sensor: 0 TS:604d82 Width:8274 Chan: 1(0) offset:14090317 BeamWord:730011

Sensor: 0 TS:827000 Width: 11 Chan: None offset:5079669 BeamWord:11dd40

Sensor: 1 TS:0002b5 Width:e520 Chan:10(1) offset:5373969 BeamWord:0506f

Sensor: 1 TS:e26050 Width:506f Chan: 1(0) offset:200256 BeamWord:735700

Sensor: 1 TS:0c0020 Width:4053 Chan: None offset: 3065 BeamWord:539d0d


What is the version of LH Deck's factory firmware I received?
Is the output as above normal?

I built the latest lighthouse-fpga software (V5) and updated it using the UART bootloader.
It took a very long time to find the nextpnr seed, but the build was successful.
In this state, even if the LH Deck was booted while the base station was turned on,
the following output could be seen without difficulty in finding the sync as above.

Using Basestation V2

Sensor: 0 TS:df76de Width: 193 Chan: None offset: 0 BeamWord:11696
Sensor: 2 TS:df7d12 Width: 1a5 Chan: 1(1) offset: 76267 BeamWord:040b7
Sensor: 3 TS:df7e8a Width: 19a Chan: 1(1) offset: 0 BeamWord:0497b

Sensor: 0 TS:e6c7e7 Width: 19e Chan: None offset: 0 BeamWord:191c7
Sensor: 2 TS:e6ce18 Width: 1a9 Chan: 1(0) offset: 76265 BeamWord:090d7
Sensor: 3 TS:e6cf9c Width: 195 Chan: 1(0) offset: 0 BeamWord:019d7


Using Basestation V1

Sensor: 0 TS:2b5859 Width: 1c0 Chan: None offset: 0 BeamWord:18356
Sensor: 3 TS:2b5c6a Width: 1b2 Chan: 1(0) offset: 40834 BeamWord:01a43
Sensor: 2 TS:2b5e2f Width: 1c9 Chan: 1(0) offset: 0 BeamWord:046f2

Sensor: 0 TS:32a964 Width: 1c3 Chan: None offset: 0 BeamWord:18356
Sensor: 3 TS:32ad79 Width: 1b0 Chan: 1(0) offset: 40835 BeamWord:03487
Sensor: 2 TS:32af3a Width: 1d4 Chan: 1(0) offset: 0 BeamWord:08de4


I don't know why sensor #1 is not visible.
Why is the New Line print pattern different from the factory firmware?
This phenomenon was the same on the two new LH Decks I received.
I want to make sure that the factory firmware I received is the same as the latest version of GitHub.
If the factory firmware is also the latest version, can the firmware that I successfully build
and the factory firmware work differently depending on the nextpnr seed value?
Posts: 2302
Joined: Tue Feb 06, 2007 12:36 pm

Re: Factory Firmware Test

Post by arnaud »


The factory firmware is a lighthouse V1 only firmware and the line protocol is different, this is why you had to wait a lot for a sync: the sync is not the same. The bitstream from factory should be version 2: https://github.com/bitcraze/lighthouse-fpga/tree/V2. The tools from the git V2 tag should then work.

As for the seeed, it is indeed a bit tight but you could have downloaded the prebuilt latest bitstream from github: https://github.com/bitcraze/lighthouse- ... ses/tag/V5.

So to answer your questions:

- Using the V5 tools with V2 bitstream did not work and this is why you saw random values, you should use the tools that correspond to the bitstream version you are using. The reason we are shipping is that way is that, when used with a Crazyflie, the deck will be re-flashed at first startup using the bitstream contained in the Crazylfie lighthouse driver, so the bitstream shipped with the deck is only used to test the board in factory.
- The factory firmware is the old version 2 that only supports lighthouse V1. If you need lightouse V2 support you need to update them to V5. The nextPnR seed value should not affect the bitstream functionalities.

A last note: the script is showing in human form the raw data sent by the FPGA. If you are receiving signal from a lighthouse V1, identity of the beam should be ignored and only timestamp and width should be used. This is what a Crazyflie would do.
Post Reply