6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 17, 2024 3:19 am

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Wed Nov 14, 2018 6:28 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
So, was the difficulty figuring out what commands to send? or just getting it work once you knew that?

Are these high level commands to the controller, vs USB Block Mode (or whatever it is) commands?


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 15, 2018 9:22 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
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.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 15, 2018 10:47 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
After more research I discovered that my USB flash drive was formatted in USB-FDD mode so there is no partition table. The whole drive is a single FAT32 partition.

I used a RPi and 'gparted' to reformat the drive in USB-HDD mode with a partition table and added a couple of small partitions . Now the contents of LBA 0 look like a MBR.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 15, 2018 7:31 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
I haven't looked at it to deeply, so I was curious if you were going to be able to do, effectively, sector level I/O at a higher level than the raw USB protocol. (Not that I have much of an idea of what that entails.)

Because, in the end, while that chip is conscious of the FAT file system, its also a universal USB connector -- so you can use that not just for a DOS USB FOB, but for all sorts of other USB things.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: