OpenMV Cam H7 Plus : free RAM ?

First of all, congratulations for all your work on OpenMV Cam boards and MicroPython.

I’d like to understand how the 1 MB SRAM & 32 MB SDRAM are used by MicroPython @ OpenMV Cam H7 Plus :

  • what is the free RAM after reboot ?
import gc
  • more info ?
import pyb
  • what parts of MicroPython (heap, stack, etc) use 32 MB SDRAM ?
  • what is the bus (QSPI ?) frequency for the 32 MB SDRAM ?

The SDRAM is used for the frame buffer. It’s not the MicroPython heap. That hasn’t changed in size. Its still 256KB.

The SDRAM is running at 400 MB/s. The internal SRAM runs at 3.2GB/s (though there are some wait states).

The frame buffer, fballoc stack, and jpeg buffer are placed in SDRAM. When possible, overlays of the fballoc stack are stored in SRAM to speed things up.

We will have double buffering coming to the OpenMV Cam soon which will allow you to hold multiple frames in the SDRAM. This will finally allow the OpenMV Cam to record video and do double buffering for faster fps.

Thanks !

So, currently the SDRAM of OpenMV Cam H7 Plus is not available for generic use in MicroPython, right ?

But the it is used by some OpenMV functions using “the frame buffer, fballoc stack, and jpeg buffer”. OpenMV docs lists which functions use these buffers ?

I’m interested in some MicroPython benchmarks, including with ulab (fft, etc).

All the vision functions use the SDRAM. It’s usage is transparent to the user. You won’t interact with it.

The MicroPython heap is in SRAM which is the 3.2GB/s. So, that’s ultra fast.

“This includes TensorFlow using 32 MB SDRAM ?”

I was searching for “SDRAM” but now found it, yes, TensorFlow supports SDRAM :

The final output .tflite model can be directly loaded and run by your OpenMV Cam. That said, the model and the model’s required sratch RAM must fit within the available frame buffer stack RAM on your OpenMV Cam.

The OpenMV Cam M7 has about 384KB of frame buffer RAM. Please try to keep your model and it’s required scratch buffer under 320 KB.
The OpenMV Cam H7 has about 496KB of frame buffer RAM. Please try to keep your model and it’s required scratch buffer under 400 KB.
The OpenMV Cam H7 Plus has about 31MB of frame buffer RAM. That said, running a model anywhere near the that size will be extremely slow.

Yeah, the network can be loaded in SDRAM and then the activation buffers are allocated there.

So, AFAIK, OpenMV Cam H7 Plus is currently the MCU board with largest RAM for running TensorFlow.