From f446fd54517d6501ed79bbb586769c65081d88d1 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Sun, 1 Dec 2024 22:48:29 +0800 Subject: [PATCH] esp32s3-devkit/usbmsc: Add bind for MTD And fix error: Unsupported sector size 256. Test # Build & Flash ./tools/configure.sh -l esp32s3-devkit:usbmsc make flash ESPTOOL_PORT=/dev/ttyACMx # Runtime (Device) nsh> mkrd -m 10 -s 512 640 nsh> ls -l /dev/esp32s3flash frw-rw-rw- 1048576 /dev/esp32s3flash nsh> msconn mcsonn_main: Creating block drivers mcsonn_main: Configuring with NLUNS=2 mcsonn_main: handle=0x3fcdecc8 mcsonn_main: Bind LUN=0 to /dev/ram10 mcsonn_main: Bind LUN=1 to /dev/esp32s3flash mcsonn_main: Connected Log (Host) [1478371.410664] usb 1-5: new full-speed USB device number 22 using xhci_hcd [1478371.539471] usb 1-5: New USB device found, idVendor=584e, idProduct=5342, bcdDevice= 3.99 [1478371.539475] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [1478371.539476] usb 1-5: Product: Mass Storage [1478371.539477] usb 1-5: Manufacturer: NuttX [1478371.539478] usb 1-5: SerialNumber: 0101 [1478371.542497] usb-storage 1-5:1.0: USB Mass Storage device detected [1478371.542851] scsi host5: usb-storage 1-5:1.0 [1478372.582401] scsi 5:0:0:0: Direct-Access NuttX Mass Storage 0101 PQ: 0 ANSI: 2 [1478372.582785] scsi 5:0:0:1: Direct-Access NuttX Mass Storage 0101 PQ: 0 ANSI: 2 [1478372.582990] sd 5:0:0:0: Attached scsi generic sg3 type 0 [1478372.583167] sd 5:0:0:1: Attached scsi generic sg4 type 0 [1478372.584150] sd 5:0:0:0: [sdd] 640 512-byte logical blocks: (328 kB/320 KiB) [1478372.801405] sd 5:0:0:0: [sdd] Write Protect is off [1478372.801410] sd 5:0:0:0: [sdd] Mode Sense: 0f 00 00 00 [1478373.021406] sd 5:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [1478373.023228] sd 5:0:0:1: [sde] 2048 512-byte logical blocks: (1.05 MB/1.00 MiB) [1478373.241405] sd 5:0:0:1: [sde] Write Protect is off [1478373.241410] sd 5:0:0:1: [sde] Mode Sense: 0f 00 00 00 [1478373.461442] sd 5:0:0:1: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [1478374.353460] sde: sde1 [1478374.353725] sd 5:0:0:1: [sde] Attached SCSI disk [1478374.363233] sd 5:0:0:0: [sdd] Attached SCSI disk [1478375.442736] FAT-fs (sde1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. Signed-off-by: wangjianyu3 --- boards/xtensa/esp32s3/esp32s3-devkit/configs/usbmsc/defconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boards/xtensa/esp32s3/esp32s3-devkit/configs/usbmsc/defconfig b/boards/xtensa/esp32s3/esp32s3-devkit/configs/usbmsc/defconfig index cdac5c4207..d87781c610 100644 --- a/boards/xtensa/esp32s3/esp32s3-devkit/configs/usbmsc/defconfig +++ b/boards/xtensa/esp32s3/esp32s3-devkit/configs/usbmsc/defconfig @@ -2,8 +2,11 @@ CONFIG_BCH=y CONFIG_DEV_ZERO=y CONFIG_ESP32S3_SPIFLASH=y +CONFIG_ESP32S3_SPIFLASH_MTD_BLKSIZE=512 CONFIG_SYSTEM_USBMSC=y CONFIG_SYSTEM_USBMSC_DEVPATH1="/dev/ram10" +CONFIG_SYSTEM_USBMSC_DEVPATH2="/dev/esp32s3flash" CONFIG_USBMSC=y CONFIG_USBMSC_EPBULKIN=2 CONFIG_USBMSC_EPBULKOUT=1 +CONFIG_SYSTEM_USBMSC_NLUNS=2