whartung wrote:
So, was the difficulty figuring out what commands to send? or just getting it work once you knew that?
Both. The PDF doesn't do a good job of stating what each command does or the the order in which they must be used.
whartung wrote:
Are these high level commands to the controller, vs USB Block Mode (or whatever it is) commands?
Its a bit of a mixture. Some are high level commands working at the level of files and directories. Others access LBA addressed sectors, however ...
After more head scratching last night I released I'm not reading LBA 0 for the flash disk (e.g. the first partition MBR). Instead I'm reading the first sector of the first FAT32 partition e.g. the boot sector.
My goal was to access the whole physical device so I could implement my own filing system. The addressing scheme I was going to use meant a large physical disk would have to be subdivided into lots of smaller partitions.
If I stick with the CH376 then I could work within FAT32 partition overwriting its contents or place my filing system inside a big file in the root directory -- attractive in that I can inspect and alter the file with a C or Java app under windows but potentially slower as all random access to the sectors has to be mapped through the FAT table.
Or I could go back to SPI accessing SD cards directly.