I could do with some help on where to look for a problem. I have set up an Arduino Mega with the SD card reader and 2nd RS232 port and uploaded the sd2tpdd code into it. The debug serial port shows the initialisation of the SD card was OK, and I can see a directory listing of the files on SD card. I have confirmed that TS-DOS can traverse the directories and can read and write files on an M100 and T200. The only change to the sd2tpdd source was changing the SD card CS from 4 to 10 for my specific SD card module. The problem (I believe but am not 100% sure) is that any file copied to RAM is being corrupted. I have simplified the test down to the following so it can be reproduced easily:
* Using TS-DOS, copy file from disk to RAM. * Using TS-DOS, copy the file with a different filename back to disk. * Remove the SD card from the Arduino and read it in the laptop. Results: * In all cases so far, the first 2 bytes only are corrupted and the rest of the file has copied correctly. * In all cases so far, the 2 bytes are at least twice the hex value of what they should be and in some cases near the top end of range i.e., 0xD5. * Repeating of the test results in different values for the first 2 bytes. * If I attempt to load the corrupted file, it usually results in having to do a cold reset. I have tried from cold starts of both the M100 and the Arduino. I have tried with different files. The particular file for the majority of the testing is a plain text basic program as a .DO file, however it also corrupts text files in the same way. I do have duplicate hardware to try this again with different hardware if necessary. Any suggestions or ideas?