USB works or does not work depends of code size

Hi,
Thank you and everyone for help with this problem.
Current situation is: I found one working USB stick and order next one "recommended", let see, I think backup of the data is not required but obligatory with such behave.
Actually if you have any good suggestions how to properly perform it please share the idea.
I would like to avoid situation what I observe with "bad USB stick" that the whole OS crash (red LED blinking) when I call USB, seems that only right approach is to call USB at the very end when all data is collected already and store somewhere, there is no internal EEPROM or SRAM with backup power which will be best in such case.
Regards