[Tinyos-devel] bug in LogRead implementation of ST M24P
Razvan Musaloiu-E.
razvanm at cs.jhu.edu
Sat Nov 24 19:42:43 PST 2007
Hi!
I think I hit a bug in the LogRead implementation of LogRead. Here is my
scenario. I'm writing records of 24 bytes and I'm reading chunks of 103
bytes. Before each reading I obtain the current position using
LogRead.currentOffset. The offsets (cookies) I get looks like this:
cookie: 0
cookie: 112
cookie: 219
cookie: 326
cookie: 434
...
cookie: 3974
cookie: 4103
cookie: 4210
cookie: 4317
cookie: 4424
...
The difference between them is 107 but at the 4K boundary there is a
bigger jump (4103-3974=129). If I start a reading from 3974 it works fine
but when I start from 4103 the data I get is incorrect. Here is a reading
starting from 3974:
cookie: 3974 data: [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1]
cookie: 4103 data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1]
And here is the incorrect one from 4103:
cookie: 4103 data: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 24, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Am I using the LogRead interface incorrectly? Is the implementation
incorrect?
Thank you!
Razvan ME
More information about the Tinyos-devel
mailing list