Skip to main content
Associate II
October 1, 2026
Solved

VL53L9 software package for low resource microcontroler ?

Hi,

 

I’m trying to use a VL53L9 with a microcontroller which have 128kB of RAM. For this I use the STM32CubeExpansion_53L9A1_V1.0.0 package. 

The problem is the streaming library delivered within the package is not made for low RAM usage. It’s stack usage is high. Too high for the microcontroller I use.

Is there VL53L9 software implementation available for low RAM usage ?

 

Regards,

Nicolas

MeganeG
MeganeGBest answer
ST Technical Moderator
October 6, 2026

@DrPiWork,

These files are part of the depth post-processing and are needed to obtain accurate values. So unfortunately, they cannot be avoided. However, some algorithms inside them can still be disabled if needed.

Thanks, Megane

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.

8 replies

MeganeG
ST Technical Moderator
October 2, 2026

Hello ​@DrPiWork,

We do not have a specific software package for low-resource microcontrollers. However, some functions can be disabled, such as the TNR and sharpening algorithms, and the resolution can be reduced by using binning.

Thanks, Megane

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
DrPiWorkAuthor
Associate II
October 2, 2026

Hello ​@MeganeG ,

 

Thanks for your answer.

Can I completely avoid the usage of the streaming library (it is not clear to me what it is used for) ?

 

Best regards,
Nicolas

MeganeG
ST Technical Moderator
October 5, 2026

Hello ​@DrPiWork,

Which library/file are you mentioning exactly?

Thank you, Megane

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
Senior III
October 5, 2026

To reduce FLASH usage you can also make sure to have float operations instead of double precision operations.

For instance, in the API of the VL53L1X (which is a similar sensor of the one you’re using), some operations were using double precisions numbers. Turning them to floating one I’ve not noticed a degradation of the operation of those specific APIs but a huge increase of flash savings (if, of course, you’re not using double precision operations anywhere else on the code)

DrPiWorkAuthor
Associate II
October 5, 2026

Hi ​@nico23 ,

 

Thanks for your answer.

My problem is not with FLASH but with RAM.

The streaming library allocates large arrays on the stack.
For example, the compute_norm_maps() function (called at init) uses 146736 bytes of stack by itself (Static Stack Analyzer output) . To this, you have to add the stack usage of other functions.
The STM32 I use has 128kB of RAM. This is less than the stack usage of the compute_norm_maps() function.

For a 54x42 pixels sensor, this seems largely oversized.

Regards,
Nicolas