wwatson4506 / UsbMscFat

Teensy 36/40/41 Compatiblility Layer for MSC and SdFat
MIT License
10 stars 4 forks source link

Compile error with examples #6

Closed BOBILLIER closed 3 years ago

BOBILLIER commented 3 years ago

Hi wwatson I try to test your library but encountered one problem during the compilation of at least two examples (DataloggerUSB and BenchUSB). The error message refers to msReadSectorsWithCB , and is:

C:\Program Files\Arduino\libraries\UsbMscFat-main\src\USBmscDevice.cpp: In member function 'virtual bool USBMSCDevice::readSectorsWithCB(uint32_t, size_t, void ()(uint32_t, uint8_t), uint32_t)': C:\Program Files\Arduino\libraries\UsbMscFat-main\src\USBmscDevice.cpp:172:28: error: 'class msController' has no member named 'msReadSectorsWithCB' m_errorCode = thisDrive->msReadSectorsWithCB(sector, ns, callback, token);

I have maid my test on T3.6 with Arduino 1.8.13 and Teensyduino 1.56 Beta 7 ( and not 6 like indicate). Any suggestions to solve this? Eric

stytlus1234 commented 3 years ago

Hi.

I had the same problem, those errors ocor when you have mismatched versions of the library UsbMscFat and MSC library, there are a bunch of diferent versions of MSC its very confusing, but its understandable cince its still in development, you have to use the one that comes in TeensyDuino 1.54B6.

BOBILLIER commented 3 years ago

Thanks for your reply stytlus1234, but i can't back to 1.54B6. I have try, to unistall B7 and install B6 but teensyduino installer stay locked . I have try to replace in B7 the USBHost_t36 with the WWatson version https://github.com/wwatson4506/USBHost_t36 but have always same problem. I hope than wwatson or somebody else solve this in next update.

stytlus1234 commented 3 years ago

To uninstall you have to do it manualy, you just have to go to "C:\Program Files (x86)\Arduino\hardware" and delete the folder named "teensy". I also had that problem.

Best Regards.

BOBILLIER commented 3 years ago

It's exactly what i have do, but that not enought. In Teensyduino installation process you can see what wrong, and this indicate than one file (compile of arduino 1.8.13) is not same size as expected. And in this refused to install 1.54B6... Best regards

wwatson4506 commented 3 years ago

@BOBBILLIER, @stytlus1234 - Sorry about the confusion here. You are right we are still working on all of this. A lot of what you see happening with MSC and UsbMscFat was for MTP_T4. @BOBILLIER - There were functions added to MSC by @KurtE and were available in his USBHost_t36 branch called MSC_read_sectors_cb. He added this function to speed up sector reads for FAT32 formatted drives and it works well. These changes to MSC are used bye the latest version of UsbMscFat which had PFsLib added to it to allow use of multiple partitions on FAT16, FAT32 and EXFAT formatted drives and allow the drives to be formatted to these three types of FAT.

The compile error you are seeing is from not having the right version of USBHost_t36 for UsbMscFat. Here is a link to my version of USBHost_t36: https://github.com/wwatson4506/USBHost_t36/tree/MSC_read_sectors_cb. And @KurtE's version: https://github.com/KurtE/USBHost_t36/tree/MSC_read_sectors_cb. The only difference is I fixed a timeout error reading USB SD card readers in my version. Make sure you download the zip file and unzip it. Don't clone it or you will get the master version which will not work. You will need to replace the 'USBHost_t36' library in '/arduino-1.8.13/hardware/teensy/avr/libraries' with USBHost_t36-MSC_read_sectors_cb'. Hope this helps:)

wwatson4506 commented 3 years ago

@BOBILLIER - Also note this all working with arduino 1.8.13 and Teensyduino 1.54 beta 7.

BOBILLIER commented 3 years ago

You are right wwatson. i have install your USBHost_t36 version and compilation errors disappear. is-there plan to merge your version with teensyduino ?

BOBILLIER commented 3 years ago

Hi I have just made test with Teensyduino-1-54-Beta-9 and it seems no longer useful to update HUBHost_t36 with your version. Now the compilation works the first time. Nice.