I am working with a SD NAND with nrf5340dk using toolchain and SDK version 2.7.0. I am using the mass sample from zephyr. It seems like the SD card could be recognised and all block information are correct, and I can read directories without any problems. However, after I connect nrf5340 usb port to my macOS, there is no usb device recognised as mass storage, and in the terminal I have the following log info:
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 *** *** Using Zephyr OS v3.6.99-100befc70c74 *** Mount /SD:: 0 /SD:: bsize = 512 ; frsize = 32768 ; blocks = 118912 ; bfree = 118802 /SD: opendir: 0 F 29 SOME.DAT D 0 SOME F 29 TEST.TXT D 0 TEST D 0 SPOTLI~4 D 0 FSEVEN~4 End of files [00:00:00.351,135] <inf> main: The device is put in USB mass storage mode. [00:00:07.853,302] <err> usb_msc: !! Disk cache sync error !! [00:00:07.878,997] <err> usb_msc: !! Disk cache sync error !! [00:00:07.917,846] <err> usb_msc: !! Disk cache sync error !! [00:00:07.943,603] <err> usb_msc: !! Disk cache sync error !! [00:00:08.012,145] <err> usb_msc: !! Disk cache sync error !!
This error just continues.
I attach my sd.overlay file here:
&i2c0 { status = "disabled";}; &spi0 { status = "disabled";}; &i2c1 { status = "disabled";}; &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; pinctrl-0 = <&spi1_default>; pinctrl-1 = <&spi1_sleep>; pinctrl-names = "default", "sleep"; cs-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; sdhc0: sdhc@0 { compatible = "zephyr,sdhc-spi-slot"; reg = <0>; status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; status = "okay"; }; spi-max-frequency = <25000000>; }; }; &pinctrl { spi1_default: spi1_default { group1 { psels = <NRF_PSEL(SPIM_SCK, 0, 6)>, <NRF_PSEL(SPIM_MOSI, 0, 7)>, <NRF_PSEL(SPIM_MISO, 0, 26)>; }; }; spi1_sleep: spi1_sleep { group1 { psels = <NRF_PSEL(SPIM_SCK, 0, 6)>, <NRF_PSEL(SPIM_MOSI, 0, 7)>, <NRF_PSEL(SPIM_MISO, 0, 26)>; low-power-enable; }; }; };
And my sd.conf file:
# CONFIG_DISK_DRIVER_SDMMC=y CONFIG_SPI=y # CONFIG_APP_MSC_STORAGE_SDCARD=y CONFIG_MAIN_STACK_SIZE=2048 CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192 CONFIG_DISK_ACCESS=y CONFIG_DISK_DRIVERS=y CONFIG_DISK_DRIVER_SDMMC=y CONFIG_FILE_SYSTEM=y CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_APP_MSC_STORAGE_SDCARD=y
I cannot locate where this error log is generated. But if I reset the board without connection to the nrf5340usb port, this error never appears. So I am assuming some USB negotiation problem with the device and my laptop?
Update:
If I connect the usb port to a windows machine, the error persists, but windows can recognise mass storage device and I can see my files on windows and perform delete.
Any ideal why this error and how can I solve it?