Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add USB MSC support for esp32s3 #14966

Merged

Commits on Nov 27, 2024

  1. boards/xtensa/esp32s3: Add USB MSC support for esp32s3

    Test
    
      # Device:/dev/ram10 <----> Host:/dev/sde
    
      # Device (NuttX)
        nsh> mkrd -m 10 -s 512 640
        nsh> msconn
        nsh> ls -l /dev/ram10
         brw-rw-rw-      327680 /dev/ram10
    
      # Host (e.g /dev/sde)
        $ sudo mkfs.ext4 /dev/sdx
        $ sudo mount /dev/sdx /workspace/mnt
    
      #   Part of `df -h`
        /dev/sdx        292K   24K  248K   9% /workspace/mnt
    
      #   dmesg (/dev/sdd, /dev/sde)
        [1116587.199896] usb 1-10: new full-speed USB device number 122 using xhci_hcd
        [1116587.369226] usb 1-10: New USB device found, idVendor=584e, idProduct=5342, bcdDevice= 3.99
        [1116587.369231] usb 1-10: New USB device strings: Mfr=1, Product=2, SerialNumber=3
        [1116587.369232] usb 1-10: Product: Mass Storage
        [1116587.369233] usb 1-10: Manufacturer: NuttX
        [1116587.369234] usb 1-10: SerialNumber: 0101
        [1116587.385275] usb-storage 1-10:1.0: USB Mass Storage device detected
        [1116587.385526] scsi host5: usb-storage 1-10:1.0
        [1116588.423335] scsi 5:0:0:0: Direct-Access     NuttX    Mass Storage     0101 PQ: 0 ANSI: 2
        [1116588.423746] scsi 5:0:0:1: Direct-Access     NuttX    Mass Storage     0101 PQ: 0 ANSI: 2
        [1116588.424001] sd 5:0:0:0: Attached scsi generic sg3 type 0
        [1116588.424181] sd 5:0:0:1: Attached scsi generic sg4 type 0
        [1116588.424305] sd 5:0:0:0: [sdd] Unsupported sector size 256.
        [1116588.425336] sd 5:0:0:1: [sde] 640 512-byte logical blocks: (328 kB/320 KiB)
        [1116588.638620] sd 5:0:0:1: [sde] Write Protect is off
        [1116588.638624] sd 5:0:0:1: [sde] Mode Sense: 0f 00 00 00
        [1116588.858793] sd 5:0:0:0: [sdd] 0 512-byte logical blocks: (0 B/0 B)
        [1116588.858797] sd 5:0:0:0: [sdd] 256-byte physical blocks
        [1116589.078698] sd 5:0:0:0: [sdd] Write Protect is off
        [1116589.078702] sd 5:0:0:0: [sdd] Mode Sense: 0f 00 00 00
        [1116589.298629] sd 5:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
        [1116589.298903] sd 5:0:0:0: [sdd] Attached SCSI disk
        [1116589.518626] sd 5:0:0:1: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
        [1116589.972872] sd 5:0:0:1: [sde] Attached SCSI disk
        [1116644.299819] EXT4-fs (sde): mounted filesystem d4e18b90-b0c3-4a0f-8969-2493a41c5e02 r/w without journal. Quota mode: none.
    
    Copy from boards/arm/rp2040/common/src/rp2040_usbmsc.c
    
    Signed-off-by: wangjianyu3 <[email protected]>
    JianyuWang0623 committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    8142bc8 View commit details
    Browse the repository at this point in the history
  2. esp32s3-devkit/usbmsc: Initializing configuration for USBMSC

    USBMSC - USB Mass Storage Class
    
    Build
    
      $ ./tools/configure.sh -l esp32s3-devkit:usbmsc
      $ make flash ESPTOOL_PORT=/dev/ttyACMx
    
    Runtime
    
      # Device
      nsh> mkrd -m 10 -s 512 640
      nsh> msconn
    
      # Host
      $ sudo mkfs.ext4 /dev/sdx
      $ sudo mount /dev/sdx ./mnt/
    
    Signed-off-by: wangjianyu3 <[email protected]>
    JianyuWang0623 committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    3cc74a6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    62976db View commit details
    Browse the repository at this point in the history