Flash Trash?
Posted: Fri Aug 26, 2016 9:22 pm
I am writing a data logger and need to save lots of data to flash (about 100K bytes for each Log). I do this by concatenating my data into large strings (I can’t seem to go beyond about 3K bytes per string before it resets), and then write each long string into flash using a ‘write’ command.
Even though it successfully writes a large string into flash, I can’t read it back because after reading about 2K bytes, I get a “Soft WDT reset” error and the system crashes. Since all data that is read is sent out the serial#1 port as a debugging aid, at 9600 baud it takes too long writing one string out to serial and the watchdog probably kicks in.
It would be great to be able to either have the watchdog go for longer, or be able to temporarily disable the watchdog, or be able to write debugging information to the serial port at 115200 baud, or be able to turn off (and on) the serial#1 port debugging aid information (which would be great).
Anyway, if I limit myself to data blocks about 2K bytes in length, I can get around the Soft WDT reset problem now.
Of course it would be much better if I could write much longer strings into flash (and of course read them back) - which would save eating up precious variable names.
But there is another worry: Where are these strings going? I must be eating up my flash, but I cannot see where they go, and after I do my work, and the next day send my data out in an email, I certainly would like to DELETE the data that I put into flash! Otherwise, I’ll eventually fill flash up with trash!
The very best solution would be the ability to open, write, read, and delete files with names (seen in the file manager - with lengths?) : Open #1 for write as “Log1”. Write #1, bla$. Close #1. Delete “Log1”, etc.
California dreaming..
Even though it successfully writes a large string into flash, I can’t read it back because after reading about 2K bytes, I get a “Soft WDT reset” error and the system crashes. Since all data that is read is sent out the serial#1 port as a debugging aid, at 9600 baud it takes too long writing one string out to serial and the watchdog probably kicks in.
It would be great to be able to either have the watchdog go for longer, or be able to temporarily disable the watchdog, or be able to write debugging information to the serial port at 115200 baud, or be able to turn off (and on) the serial#1 port debugging aid information (which would be great).
Anyway, if I limit myself to data blocks about 2K bytes in length, I can get around the Soft WDT reset problem now.
Of course it would be much better if I could write much longer strings into flash (and of course read them back) - which would save eating up precious variable names.
But there is another worry: Where are these strings going? I must be eating up my flash, but I cannot see where they go, and after I do my work, and the next day send my data out in an email, I certainly would like to DELETE the data that I put into flash! Otherwise, I’ll eventually fill flash up with trash!
The very best solution would be the ability to open, write, read, and delete files with names (seen in the file manager - with lengths?) : Open #1 for write as “Log1”. Write #1, bla$. Close #1. Delete “Log1”, etc.
California dreaming..