Writing Large data size to Flash Memory

HI all, I am back with more questions

I am working on a consumer project to use the Arduino Micro as a USB device that will be able to get the tempreature from temp sensor and to write calibration data (>1k) to Flash memory.

I am successfully were able to do all the previous but I have one issue. I can write to memmory no problem, but only if my file is less than 2096 (I am not sure why is that number-it looks so random )

if i tried to send more than 2096 lets say 3311 everythign locks up at Serial.readbytes()

this is the part of the code that locks up

 int nBufLen = 3311;
 int test=nBufLen;
      EEPROM.put(0, test) ;
	  
      // Did we get zip buffer?
      if(Serial.readBytes(pCalDATA, nBufLen) < 0) {
        // ERROR
        nBufLen = 3 ; // Read data error
        EEPROM.put(0, nBufLen) ; 
        BLINK(13, .01, 2) ;
      }

any suggestions ?

Flash memory, or EEPROM?

Micro has 1 kbyte EEPROM, that is 1000 1024 bytes and 2,5kbyte RAM, that is 2500 2560 bytes

Or 1024 bytes of EEPROM and 2560 bytes of RAM.

AWOL: Or 1024 bytes of EEPROM and 2560 bytes of RAM.

doesn't help to store 3 kbyte :-)

but only if my file is less than 2096

I'm guessing ASCII hex, two characters per byte stored, plus overhead.

AWOL:
Flash memory, or EEPROM?

Flash memory,

AWOL: I'm guessing ASCII hex, two characters per byte stored, plus overhead.

what do yo mean ?

bemin: Flash memory,

Then why EEPROM.put(0, nBufLen) ;?

bemin: what do yo mean ?

I mean, in the absence of any detail, and with only a snippet of code to go on (hint) I guess your data comes as ASCII hex.

I think AS you guys mentioned before, The Size of the fiel I am trying to write , is bigger that the memory in the RAM so when I try to rellocate the 3311 it doesnt work.

I guess I need a work around

So break the read down into smaller packets.

I guess my hint didn't work - good luck.

ye that is what i would like to do, but if iam sending 3311 in the serial buffer and read only 2000 , then did few codes and comeback to read the rest will it be available ? It should be avilable until it is read right ?

It should be avilable until it is read right ?

With a 64 byte serial input buffer?

imagine two water tanks. one is the source (of your data) and some pump fills a small cup (64 byte buffer). so you must pump the water (data) from the cup (buffer) to your target tank faster then it fills.

Swap over to a teensy3.2 processor. Same thing but has 64k RAM.

Oh the possibilities!

-jim lee

Yes Unfortunately it is too late for that now