Hydra : Limit of #bytes in an Array?

Hi,

I succeed to manage a 64x32 Led Display (4 x this panel http://hackspark.fr/fr/afficheur-a-led-rvb-controle-en-usb-de-32cm-x-16cm.html). I have a C# program on a server which transform an image/text (bmp, jpg, png) into a byte array. So far, I am still in a testing mode, I just cut from the server and paste to the Hydra card the array definition.
i.e :

public static byte[] MESSAGE = new byte[32646] {0x00, 0x00, 0xff, ..., 0x00};

and then via a serialport.write(MESSAGE, MESSAGE.Lenght), I display the image on the led display with an horizontal scrolling.

The issue I am facing is the size limit of my array is 32646 bytes, one byte more and I am having the following error :
#### Exception System.Exception - CLR_E_WRONG_TYPE (2) ####
#### Message:
#### System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray [IP: 0000] ####
#### LedDisplay32x16.Message::.cctor [IP: 0011] ####
Une exception de première chance de type ‘System.Exception’ s’est produite dans mscorlib.dll
Une exception non gérée du type ‘System.Exception’ s’est produite dans mscorlib.dll

OR sometime I could not even start the generation and I am having “CLR_E_OUT_OF_MEMORY” :frowning:

Is there any way to find a solution to this error ?

PS : I would like to reach a limit of MESSAGE[99999] :slight_smile:

IMG 0185 - YouTube

There is a LargeArray or LargeBuffer, forgot what it is called. This uses custom heap.

I am not sure if this is part of the firmware and I never used it much but it is worth the try.

Otherwise, using

Debug.Print("Free mem : " + Debug.GC(false).ToString());

to keep track of memory might help, or the full GC output would be even better to see where it gets stored.