mount_msdosfs not working for USB device SparkFun Pro nRF52840 Mini

Hans Petter Selasky hps at selasky.org
Mon Apr 5 08:57:56 UTC 2021


On 4/5/21 8:03 AM, Ben Woods wrote:
> Hi FreeBSD USB peeps,
> 
> I recently bought myself a small bluetooth development board to tinker with - a SparkFun Pro nRF52840 Mini:
> https://www.sparkfun.com/products/15025
> 
> But I am having difficulty mounting the mass storage device it presents when in bootloader mode (accessible by double tapping the reset button).  In this mode it presents 3 devices at once - a USB serial (CDC), a DFU (device firmware upgrade) and a mass-storage device (MSD).
> 
> When I attempt to mount the FAT32 formatted mass storage device I get the error:
> mount_msdosfs: /dev/da1: Invalid argument
> 
> I suspect the issue is a USB quirk, and I may just need to use usbconfig with the right command to fix it. I'm hoping someone is able to help me get this mounting, or troubleshoot further?
> 
> Cheers,
> Ben
> 
> --- Output below from bootloader mode ---
> 
> # camcontrol devlist
> <Generic- SD/MMC CRW 1.00>         at scbus0 target 0 lun 0 (pass0,da0)
> <SparkFun nRF525840 Mini 1.0>      at scbus1 target 0 lun 0 (pass1,da1)
> 
> # ls -lah /dev/da1*
> crw-r-----  1 root  operator   0xc9  5 Apr 13:56 /dev/da1
> 
> # mount -t msdosfs /dev/da1 /mnt
> mount_msdosfs: /dev/da1: Invalid argument
> 
> # mount -t msdosfs /dev/msdosfs/NRF52BOOT /mnt
> mount_msdosfs: /dev/msdosfs/NRF52BOOT: Invalid argument
> 
> # fstyp -lu /dev/da1
> msdosfs NRF52BOOT
> 
> # file -s /dev/da1
> /dev/da1: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "UF2 UF2 ", root entries 64, sectors 7998 (volumes <=32 MB), Media descriptor 0xf8, sectors/FAT 32, sectors/track 1, heads 1, serial number 0x420042, label: "NRF52BOOT  ", FAT (16 bit)
> 
> # dmesg
> ugen0.10: <Adafruit Industries Bluefruit nRF52840 DFU> at usbus0
> umodem0 on uhub1
> umodem0: <Bluefruit Serial> on usbus0
> umodem0: data interface 1, has no CM over data, has no break
> umass1 on uhub1
> umass1: <Bluefruit UF2> on usbus0
> umass1:  SCSI over Bulk-Only; quirks = 0x0000
> umass1:1:1: Attached to scbus1
> da1 at umass-sim1 bus 1 scbus1 target 0 lun 0
> da1: <SparkFun nRF525840 Mini 1.0> Removable Direct Access SCSI-2 device
> da1: Serial Number C1599CE596019A19
> da1: 1.000MB/s transfers
> da1: 3MB (8000 512 byte sectors)
> da1: quirks=0x2<NO_6_BYTE>
> 
> # usbconfig -d 0.10 dump_all_desc
> ugen0.10: <Adafruit Industries Bluefruit nRF52840 DFU> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
> 
>    bLength = 0x0012
>    bDescriptorType = 0x0001
>    bcdUSB = 0x0200
>    bDeviceClass = 0x00ef  <Miscellaneous device>
>    bDeviceSubClass = 0x0002
>    bDeviceProtocol = 0x0001
>    bMaxPacketSize0 = 0x0040
>    idVendor = 0x1b4f
>    idProduct = 0x5284
>    bcdDevice = 0x0100
>    iManufacturer = 0x0001  <Adafruit Industries>
>    iProduct = 0x0002  <Bluefruit nRF52840 DFU>
>    iSerialNumber = 0x0003  <C1599CE596019A19>
>    bNumConfigurations = 0x0001
> 
> Configuration index 0
> 
>      bLength = 0x0009
>      bDescriptorType = 0x0002
>      wTotalLength = 0x0062
>      bNumInterfaces = 0x0003
>      bConfigurationValue = 0x0001
>      iConfiguration = 0x0000  <no string>
>      bmAttributes = 0x0080
>      bMaxPower = 0x0032
> 
>      Additional Descriptor
> 
>      bLength = 0x08
>      bDescriptorType = 0x0b
>      bDescriptorSubType = 0x00
>       RAW dump:
>       0x00 | 0x08, 0x0b, 0x00, 0x02, 0x02, 0x02, 0x01, 0x00
> 
> 
>      Interface 0
>        bLength = 0x0009
>        bDescriptorType = 0x0004
>        bInterfaceNumber = 0x0000
>        bAlternateSetting = 0x0000
>        bNumEndpoints = 0x0001
>        bInterfaceClass = 0x0002  <Communication device>
>        bInterfaceSubClass = 0x0002
>        bInterfaceProtocol = 0x0001
>        iInterface = 0x0004  <Bluefruit Serial>
> 
>        Additional Descriptor
> 
>        bLength = 0x05
>        bDescriptorType = 0x24
>        bDescriptorSubType = 0x00
>         RAW dump:
>         0x00 | 0x05, 0x24, 0x00, 0x20, 0x01
> 
> 
>        Additional Descriptor
> 
>        bLength = 0x05
>        bDescriptorType = 0x24
>        bDescriptorSubType = 0x01
>         RAW dump:
>         0x00 | 0x05, 0x24, 0x01, 0x00, 0x01
> 
> 
>        Additional Descriptor
> 
>        bLength = 0x04
>        bDescriptorType = 0x24
>        bDescriptorSubType = 0x02
>         RAW dump:
>         0x00 | 0x04, 0x24, 0x02, 0x02
> 
> 
>        Additional Descriptor
> 
>        bLength = 0x05
>        bDescriptorType = 0x24
>        bDescriptorSubType = 0x06
>         RAW dump:
>         0x00 | 0x05, 0x24, 0x06, 0x00, 0x01
> 
> 
>       Endpoint 0
>          bLength = 0x0007
>          bDescriptorType = 0x0005
>          bEndpointAddress = 0x0081  <IN>
> 
>      Interface 1
>        bLength = 0x0009
>        bDescriptorType = 0x0004
>        bInterfaceNumber = 0x0001
>        bAlternateSetting = 0x0000
>        bNumEndpoints = 0x0002
>        bInterfaceClass = 0x000a  <CDC-data>
>        bInterfaceSubClass = 0x0000
>        bInterfaceProtocol = 0x0000
>        iInterface = 0x0000  <no string>
> 
>       Endpoint 0
>          bLength = 0x0007
>          bDescriptorType = 0x0005
>          bEndpointAddress = 0x0002  <OUT>
>          bmAttributes = 0x0002  <BULK>
>          wMaxPacketSize = 0x0040
>          bInterval = 0x0000
>          bRefresh = 0x0000
>          bSynchAddress = 0x0000
> 
>       Endpoint 1
>          bLength = 0x0007
>          bDescriptorType = 0x0005
>          bEndpointAddress = 0x0082  <IN>
>          bmAttributes = 0x0002  <BULK>
>          wMaxPacketSize = 0x0040
>          bInterval = 0x0000
>          bRefresh = 0x0000
>          bSynchAddress = 0x0000
> 
> 
>      Interface 2
>        bLength = 0x0009
>        bDescriptorType = 0x0004
>        bInterfaceNumber = 0x0002
>        bAlternateSetting = 0x0000
>        bNumEndpoints = 0x0002
>        bInterfaceClass = 0x0008  <Mass storage>
>        bInterfaceSubClass = 0x0006
>        bInterfaceProtocol = 0x0050
>        iInterface = 0x0005  <Bluefruit UF2>
> 
>       Endpoint 0
>          bLength = 0x0007
>          bDescriptorType = 0x0005
>          bEndpointAddress = 0x0003  <OUT>
>          bmAttributes = 0x0002  <BULK>
>          wMaxPacketSize = 0x0040
>          bInterval = 0x0001
>          bRefresh = 0x0000
>          bSynchAddress = 0x0000
> 
>       Endpoint 1
>          bLength = 0x0007
>          bDescriptorType = 0x0005
>          bEndpointAddress = 0x0083  <IN>
>          bmAttributes = 0x0002  <BULK>
>          wMaxPacketSize = 0x0040
>          bInterval = 0x0001
>          bRefresh = 0x0000
>          bSynchAddress = 0x0000
> 

Try to clean the volume with fsck_msdosfs first.

--HPS



More information about the freebsd-usb mailing list