I'm just trying Steve's excellent SD utilities. I've downloaded latest version from Wiki.
I'm using an 1825K20 @ 10MHz on a home made PCB with SD card socket.
I've been reading files on an SD without any problem until I come to use Fseek.
If I open a file using SD.OpenFileRW(...) then I can set pointer and read absolutely fine.
But if I open using SD.OpenFile(..) I get problems.
The .pdf Help file suggests that using OpenFile(..) is OK but if use Fseek and try and read a byte I get strange error.
e.g.
If I Fseek to, say, position 1 (no error from Fseek) and then read a byte it returns an EOF error number.
or
If I Fseek to,say, pos 1 (no error from Fseek) and then Fseek again I get errRWError returned from Fseek function.
THEN, I have to initialise the SD again to do any more open / reads from the File.
It only happens if using OpenFile, using OpenFileRW is fine.
Summary.
OpenFile for normal reading is fine.
OpenFileRW for normal reading is fine.
OpenFile and then using Fseek gives problems.
OpenFileRW and then using Fseek is fine.
Obv I can use OpenFileRW and I notice the .pdf help file looks a bit out of date.
Is there something different I should do if using OpenFile() and using Fseek? (it would be nice to open as read only and be able to do Fseek).
Fseek query
Moderators: David Barker, Jerry Messina
Supplemental
Odd.
If I first open with OpenFileRW then close and then re-open with OpenFile all Fseek operations a re fine.
But if the first operation is OpenFile() then it does its funny thing.
Is something Fseek-related set by OpenFileRW which makes it function OK with subsequent OpenFile() ?
If I first open with OpenFileRW then close and then re-open with OpenFile all Fseek operations a re fine.
But if the first operation is OpenFile() then it does its funny thing.
Is something Fseek-related set by OpenFileRW which makes it function OK with subsequent OpenFile() ?