Hi Alan, I am - right this minute - using GDB (well...VS Studio Code with Segger J-Link) and it falls over during the (second) call to file_dup2 in fs_files.c, on its second call (I believe related to usb_scsi_main), but not got further than that yet.
Had no luck at all with other FS. FAT just results in: Nsh> mkfatfs -F 32 /dev/mtdblock0 mkfatfs_getgeometry: ERROR: Unsupported sector size: 256 nsh: mkfatfs: mkfatfs failed: 1 no -F or -r options make any difference Even tried a ramdisk: nsh> mkfats /dev/ram0 nsh: mkfats: command not found nsh> mkfatfs /dev/ram0 mkfatfs_tryfat16: WARNING: Too few or too many clusters for FAT16: 4081 < 29 < 254 mkfatfs_clustersearch: WARNING: Cannot format FAT16 at 1 sectors/cluster This suggests some fundamental - but obscure - CONFIG setting is enabled but who knows what! SmartFS fails too - just don't think it likes the size of the device - there are some variables as uint16_t's in the smartfs code and I think they need to be uint32_t's for this quite large device. Will try partitions at some point. Right now I am really regretting moving to NuttX as although I seem to be able to write drivers, fundamental stuff that, to me, just "should work" quite often doesn't :( Thanks, Tim. >-----Original Message----- >From: Alan Carvalho de Assis <acas...@gmail.com> >Sent: 22 December 2021 12:22 >To: dev@nuttx.apache.org >Subject: Re: USB MSD problem > >Hi Tim, > >I don't know the root cause of the issue you are facing, but it could be some >memory misalignment. Try to use GDB to investigate where the crash is >happening. > >Also test using other File Systems, if you use USB MSD with FAT then your host OS >will show the content of the SPI Flash. > >BR, > >Alan > >On 12/21/21, Tim <t...@jti.uk.com.invalid> wrote: >> Hi, >> >> Having some grief getting USB MSD device to work, following some notes >> from Alan C. Assis from around 5 years ago. >> >> It is an MT25Q 32Mbyte spi nor flash device, registered as >> /dev/mtdblock0 and also mounted and initialised as an nxfss file >> system at /mnt/flash. I can read/write to it from nsh. >> >> If I run MSCONN, it crashes: >> >> nsh> msconn >> mcsonn_main: Creating block drivers >> find_blockdriver: pathname="/dev/mtdblock0" >> ftl_geometry: Entry >> ftl_geometry: available: true mediachanged: false writeenabled: true >> ftl_geometry: nsectors: 131072 sectorsize: 256 >> usbmsc_exportluns: Starting SCSI worker thread >> arm_dataabort: Data abort. PC: 2002f528 DFAR: e8bd8800 DFSR: 00000005 >> up_assert: Assertion failed at file:armv7-a/arm_dataabort.c line: 160 task: >> msco >> >> It seems to be somewhere in task_init and group_setuptaskfiles >> (duplicating files I think), but debugging deep inside NuttX is, um, scary! >> >> I'm hoping I've just not configured something else it needs; and I >> can't seem to find any relevant debug options to assist - USB MSC MM >> DEBUG seems to cause it all to hang up at a printf statement in the msconn app. >> >> Any thoughts, kind people? >> >> Thanks, Tim. >> >> >>