-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Operating System
Windows 10
Board
raspberry pi pico
Firmware
examples/host/cdc_msc_hid
What happened ?
When trying the msc host example with the fatfs implementation based on the example code, one first runs into the following code at line 97 and 107:
if ( TUSB_ERROR_NONE != tuh_msc_read10(usb_addr, 0, buff, sector, count) ) return RES_ERROR;
Which needs to be correct to:
if ( !tuh_msc_read10(usb_addr, 0, buff, sector, count, NULL) ) return RES_ERROR;
in order to make it compile.
However after this:
- disk_initialize succeeds
- disk_is_ready succeeds
- f_mount succeeds
- f_chdrive succeeds
- f_chdir fails with an error 13
Error 13: no filesystem. Although it's clear there's a FAT32 with 512 block size on the USB stick.
When checking the buffer returned from "disk_read" in the function check_fs() (which is called from f_chdir), there's supposed to be a record signature at offset 510, however this buffer is completely empty. It seems like tuh_msc_read10() did not succeed in filling the buffer with an actual value.
How to reproduce ?
- Run the examples/host/cdc_msc_hid with only the msc example engaged,
- comment out the tuh_msc_inquiry() call (this will cause a race condition with the other calls)
- uncomment the file system code below this call
- fix the calls on line 97 and 107 in diskio.c
- see an error 13
Debug Log as txt file
No response
Screenshots
No response