cancel
Showing results for 
Search instead for 
Did you mean: 

How to decode serial data from VL53L8CH?

Carterpaul
Associate

Hello,

I am trying to get histograms off of the VL53L8CH sensor. I have the sensor hooked up to an F401 and I'm using the official driver from here: https://www.st.com/en/embedded-software/stsw-img043.html.

When I start ranging with the sensor through the driver, it starts sending binary data over the serial port. I believe the format of this data is described in general terms in section 5.8 of the user guide for the sensor (UM3183). But it's not very specific and it would be quite a pain to write my own function to decode the data. I believe the EVK software (from the link above) includes code that reads in this data from the serial port and saves it to a csv and/or numpy array. However the EVK software is pre-compiled so it's not easy to use this code myself. Is there example code for decoding data from the serial port, or can the code used in the EVK software be made available?

Thank you.

3 REPLIES 3
Anne BIGOT
ST Employee

Hello,

It looks like you are using the STM32 software we provide for use with the EVK GUI as a “driver”… but it was not intended as a “driver”.

The UM3188 you refer to describes the I2C from the sensor not the STM32->GUI comms.

Today you have two options:

  1. Use the simple Example_12_cnh_data part of the ULD distribution as a basic starting point then add the functions you want to send the data to the host in the form he wants.
  2. Take the full source code for the STM32 MZ-AI EVK project and modify the module that encodes the data before sending to host GUI.  This is done in module “encode_frame” it would be quite easy to replace this module with your own code. Downside of this is, you will also have to copy what the MZ-AI GUI does with regards sending commands to configure and start the sensor streaming.

Regards

Anne


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'

Thanks for the response Anne,

I have made progress towards getting option 1 to work as you describe. I'm still confused about option 2 though. Can you tell me exactly how to access the STM32 MZ-AI EVK project source code? The download on this page only gives me a pre-built version as far as I can tell.

Hi I am also try to get option 1 to work as the description, After writing the Example_12_cnh_data to the F4001 board, how to get the data?