Third party port - UART packets not as expected

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
cylops
Beginner
Posts: 1
Joined: Mon Jul 12, 2021 3:13 pm

Third party port - UART packets not as expected

Post by cylops »

Hi there,

I'm trying to use the lighthouse deck with a third party microcontroller (ESP32). I have been going through the crazieflie source code and have read the relevant README files etc. I'm a little bit stuck at present and would appreciate any help if possible.

What works:
1) I can read the bootloader verison and send the firmware-boot command to the bootloader over I2C. This results in the green LED lighting up and the UART starts to transmit some bytes.

What I'm struggling with:
1) The UART packets I am seeing don't seem to match what I would expect. According to the readme on the fpga repository the deck should be transmitting constant frames of 12 bytes. However when I look at the pulse train using a Saleae logic analyser I can see frames that are 14 bytes long, 35 bytes long and some that are 42 bytes long (the behaviour changes if the senors are covered or unconvered. I have two V1 lighthouses operating in the room in mode b and c so should be using optical sync).

Image
2) The all-1s sync signal is supposed to be 12 bytes long but most of the signals I have captured are only 7 bytes. This is a big problem as I can never sychronise the packet decoder to the start of frame. I notice if I add debug logs to my code that I will get some valid 12-byte 0xFF periods *only* when I cover the sensors to block the lighthouse pulses.
eg:
Image.

The timing between consecutive pulse trains seems correct in terms of the Lighthouse system timing of ~8.4ms. But there is too many bytes in each pulse train? The timing between the falling edge of each pulse train decreases when the sensors are uncovered.

The I2C readback tells me that I have bootloader version 2. I am using the master branch of the crazyflie-firmware repo as my reference for the decoder code.

Is there something that I'm missing here? It seems odd that the uart frames I am seeing are not 12 bytes or multiples of same. And the sync frame length seems incorrect. Has anyone seen this before? Maybe my module is damaged somehow?

Thanks!
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Third party port - UART packets not as expected

Post by arnaud »

Hi,

The lighthouse deck does not come out of factory with a release firmware but with a production test firmware that is based on a pretty old version, this is likely the problem you are having.

You should try to update to the latest firmware. The bootloader is available on both UART of the deck as well as on the I2C port so the easiest would be to use the UART with this script (make sure you use a 3.0V uart or add a voltage divider to your TX line!): https://github.com/bitcraze/lighthouse- ... tloader.py. The latest released FPGA bitstream, the one used in the current firmware, is V6: https://github.com/bitcraze/lighthouse- ... ses/tag/V6.
Colin
Beginner
Posts: 1
Joined: Tue Feb 01, 2022 3:08 pm

Re: Third party port - UART packets not as expected

Post by Colin »

Hello,
I'm trying to use the lighthouse deck with a third party microcontroller (ESP32) in I2C.

I just want to get get 6 DOF by I2C from lighthouse deck.

Does the firmware send 6 DOF by I2C ?

Thanks a lot
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Third party port - UART packets not as expected

Post by kristoffer »

Hi!

No, the data from the deck is basically a raw format of data from the sensors, see https://github.com/bitcraze/lighthouse-fpga

Also, please consider starting a new thread rather tagging on an old one, see the forum rules at the top of the page.
Post Reply