Hi,
I am working on MCB2300 (with LPC2378 processor). I have written a small function that will read the values into a matrix. But when the control comes to fread it completely hangs up, nothing can be done. Below is the my function which is giving problem
void loadImage(FILE* arq, unsigned char** Matrix){ int i,j; unsigned char tmp; long pos = 51; fseek(arq,0,0); for (i=0; i<300; i++){ for (j=0; j<400; j++){ pos+= 3; fseek(arq,pos,0); fread(&tmp,3,1,arq); Matrix[i][j] = tmp; } } }
Its working fine in GNU C. But when I have tried to use the same code in Keil uVision4, its is not working. Please let me know how to sort this problem
Stop fooling around. 320*200*3 = 64000*3.
The processor don't have enough internal RAM to handle it.
The processor doesn't even have RAM memory regions that are neighbour to each other to allow a single memory allocation of the full size, since the 64kB of main RAM is not neighbour to USB or Ethernet RAM or to the two 64kB external memory banks. And the two 64kB external memory banks are not neighbour either.
Do you have external RAM connected? How much? If yes - how have you convinced the RTL to place 128kB heap in external RAM and 64kB heap in internal RAM?