How to use all the memory in portenta H7?

I have question please; I am working on code that deal with image make some processing on it. When I run my code on teensy 4.1(memory= 1M) the max size of image that I can upload is uint8_t image[200][200]. The memory of portenta h7 is (2M) so why I can not use image size like [300][300] or [250][250] for the same code?

Hi @m_lena

Welcome to the forum!

There is a note on our firmware about this, hopefully this can clarify things for you:

You get the above error when there’s not enough (contiguous) memory to allocate TFLite arena. This can be caused by different reasons

  1. Heap fragmentation
  2. Not enough RAM/heap.

In the case of (1) you may want to allocate the tensor arena statically by defining "-DEI_CLASSIFIER_ALLOCATION_STATIC" in arduino-build.sh or boards.local.txt . If the problem still persists, then it may be that there’s not enough RAM/heap for your model and this application. Currently the heap is placed in a 512k RAM segment.

@mateusz fyi

Best

Eoin