Allocating memory from frame buffer for MLX90640

Discussion related to "under the hood" OpenMV topics.
bogflap
Posts: 35
Joined: Mon Apr 16, 2018 10:03 am

Allocating memory from frame buffer for MLX90640

Postby bogflap » Wed Oct 17, 2018 6:31 am

When using the MLX90640 I having been trying to allocate two buffers for the read_ir(...) function in ram.
However I get a memory error (cannot allocate 4096 bytes(?)).
So I thought of using sensor.alloc_extra_fb but this returns a img object. Also what type do I use anyway.
How can I get round this problem?
bogflap
Posts: 35
Joined: Mon Apr 16, 2018 10:03 am

Re: Allocating memory from frame buffer for MLX90640

Postby bogflap » Wed Oct 17, 2018 6:35 am

Forgot to add that I am using an M7 with firmware version 3.1.0
User avatar
kwagyeman
Posts: 2401
Joined: Sun May 24, 2015 2:10 pm

Re: Allocating memory from frame buffer for MLX90640

Postby kwagyeman » Sun Oct 21, 2018 6:12 pm

Mmm, I don't really have an answer for this. Um, does this error happen after the first loop or a few loops in? If it's a few loops in then you're getting heap fragmentation and you just need to call "del object" and then "gc.collect()" after you've finished with things in your script to force the heap from getting fragmented.

The extra_fb cannot be used as heap RAM however.
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests