Finally, I got it compiled with IAR.
I changed
list.h and some sources due to absence of
typeof in IAR, and changed format of
packed and
align.
With 512 byte block it gives me ~500Kb/s read speed and 230Kb/s write speed, but with blocks of 4096 bytes I got:
Code: Select all
BLK: Raw read test (1MB, 10240B blocks)
BLK: Raw read in 961 ms, 1065kB/s
FS: Block driver ready, try mount...
FS: Mounted.
FS: 487320 free clusters, 32 sectors per cluster, 3689283584 bytes free
FS: Write test (create file /test.dat, 1MB)
FS: Written 1MB in 1185 ms, 864kB/s
FS: Read test (read file /test.dat, 1MB, compare)
FS: Read 1MB in 1057 ms, 968kB/s
FS: Scan files test
FS: /SANDIS~1.0/DOWNLO~1.PDF
FS: /SANDIS~1.0/QUICKS~1.PDF
FS: /SANDIS~1.EXE
FS: /SYSTEM~1/INDEXE~1
FS: /TEST.DAT
FS: Tests done, restarting in 3s
I got this results using SanDisk 8G USB stick.
Some problems still exists.
2GB MyFlash (oldest USB stick I found) - 155Kb/s write speed (much more on PC).
8Gb Smartbuy - not works at all, gives:
Code: Select all
16383.000 HPRT: Port connection detected
16383.000 Port 1 connected, wait debounce...
16383.000 Try reset...
16383.004 HPRT: Port enabled
00018.760 Reset OK, recovery...
00118.754 DEV[CTRL]: Open EP
00118.778 Enumerate.
00118.785 Get first 8 bytes of device descriptor
00119.817 Configure bMaxPacketSize0 = 64
00119.859 DEV[CTRL]: Closing EP...
00119.883 DEV[CTRL]: Closed
00119.909 DEV[CTRL]: Open EP
00119.942 Set device address: 1
00120.087 DEV[CTRL]: Closing EP...
00120.112 DEV[CTRL]: Closed
00120.147 DEV[CTRL]: Open EP
00120.172 Wait stabilization...
00139.753 Get full device desc
00140.687 Enumeration finished.
00140.709 Loading langID0...
00143.638 langID0=0409
00143.657 Device has only one configuration
00143.668 Reading basic configuration descriptor 0
00145.168 Selecting configuration 0
00145.308 Device configured.
00145.316 New device found.
00145.324 ----- Device info -----
00145.332 Device descriptor:
00145.341 USBSpec=0200, #configurations=1, langID0=0409
00145.396 Class=00, Subclass=00, Protocol=00
00145.433 VID=13FE, PID=4200, Release=0100
00148.468 Manufacturer:
00151.773 Product: USB DISK 2.0
00155.164 Serial Number: 90005B3479AF3542
00155.206 Configuration descriptor (partial):
00155.217 bConfigurationValue=1, Length=32, #interfaces=1
00155.271 Current=100mA
00155.293 SelfPowered=0, RemoteWakeup=0
00155.325 Name:
00155.348 ----- End Device info -----
00156.714 ----- Configuration info -----
00156.725 Configuration descriptor:
00156.749 Configuration 1, #IFs=1
00156.778 Interface 0, alt=0, #EPs=2, Class=08, Subclass=06, Protocol=50
00156.848 Endpoint descriptor, Address=81, Type=2, MaxPacket=64, Interval=0
00156.919 Endpoint descriptor, Address=02, Type=2, MaxPacket=64, Interval=0
00156.981 ----- End Configuration info -----
00156.1000 Load a driver for each IF.
00157.012 Try load driver MSD
00157.038 BULK IN endpoint found: bEndpointAddress=81
00157.089 BULK OUT endpoint found: bEndpointAddress=02
00157.131 Reading Max LUN:
00158.180 max_lun = 1
00158.200 MSD[BIN ]: Open EP
00158.234 MSD[BOUT]: Open EP
00158.264 INQUIRY...
00159.402 PDT=00
00159.427 READ CAPACITY(10)...
00161.722 MSD[BIN ]: STALL
00161.780 MSD: Data phase: USBH_URBSTATUS_STALL
00161.792 READ CAPACITY(10): Transaction error
It sounds strange, but it worked and finished to work properly in endless tests and restarts of firmware. PC can read and write it.
What should I do with this USB stick? How to make it working? I think solving this problem will be useful to all of us.
I have attache my modified sources to this message.
If someone will make source files compatible to both compilers and will merge all this to ChibiOS-Contrib repo, it will be nice (I have no knowledge to do it by myself).