Main Site Documentation

Panda II: Reading InternalFlashStorage Partially


#1

Hi,

I have a memory consuming application running on a Panda II.
Whenever I need to read from flash memory I have to allocate 4096 bytes:

byte[] buffer = new byte[InternalFlashStorage.Size];

Assuming I’m only using the first 100 bytes, is it possible to read/write only this segment ?
I’m getting a lot arbitrary “Out of Memory” exceptions when using the whole 4096 byte area.

Thanks


#2

Allocate this buffer early in your application. And also force the garbage collector debug. GC(true)

This should help with out of memory.


#3

Hi Gus, I’m already doing the GC(true) call before allocating memory, but I still get sometimes out of memory errors.
Is it possible that there’s a hidden “under the hood” method to read only short portion from the internal flash? Maybe some RLP method?

Thanks


#4

No unfortunately


#5

@ Gus - Thanks :-[