-->
Page 1 of 1

Flash Trash?

PostPosted: Fri Aug 26, 2016 9:22 pm
by raintime
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..

Re: Flash Trash?

PostPosted: Fri Aug 26, 2016 9:34 pm
by Mmiscool
This is some thing that i have been meaning to address.

To have proper qbasic style file i/o.

I just have to deadicate some time to this.

Re: Flash Trash?

PostPosted: Sat Aug 27, 2016 5:43 am
by raintime
Thanks Mike - I'm sure qbasic-style file I/O is a biggie! Very much looked forward to!

But what about a quick command to turn off and on the debugging aid information sent to serial port#1? That would fix the soft WDT errors that occur when reading long strings and give users the ability to use the hardware serial port for their own ends - which would be very useful?