Hi Tim, On 12/22/21, Tim <t...@jti.uk.com.invalid> wrote: > 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. >
Try to spot the exact place where it is happening, also enabling the DEBUG FS could help to spot issues. > 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 > Here the issue is because FAT sector is always 512 bytes, but your Flash is 256, you can modify the menuconfig to let the MTD export/convert it as 512. > 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 > Here the issue is your ramdisk size. You need at least 64 sectors to be able to format as FAT, try it: https://acassis.wordpress.com/2020/08/23/how-to-use-ramdisk-as-filesystem-on-nuttx/ > This suggests some fundamental - but obscure - CONFIG setting is enabled > but who knows what! > NuttX has many option, but it is not obscure, it is like for the Linux kernel, you need to get used to it. And the only way to get used to it is using and testing it. This is how we get control over a motor machine, use it everyday and get connected to it. > 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. > I don't remember the size limitation of SmartFS, I remember using it for SPI NOR Flash up to 64MB. > 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 :( > Just because a spaceship has many knobs and you don't know how to turn it on, doesn't mean it is bad. The only supposed "fundamental stuff" that are "should work" are the predefined board configs, but even that can eventually break, because we don't have much people working on it. Also as you saw that tutorial is already 5 years old and NuttX evolved too much since then. Try to create a RAMDISK with more space and format it as FAT, then enable the USB MSD to use it to as disk before trying to use your flash as MSD. BR, Alan