This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FATFS working on MXIC MX25R6435F but not on S25FS128S

Hello,

We have integrated the FATFS example as shown in the usbd_msc example project into our own firmware application. It works perfectly on the nRF52840dk and when we modify our own hardware with the MX25R6435F chip it also runs fine on our own hardware. Meaning I can mount the filesystem, list the filesystem contents, create files, read files and modify the files.

However when we try to run it on our hardware with S25FS128S (which is the flash chip we use in production) we can only (seemingly) write the filesystem and mount it. When we try to create new files they do seem to get written (the lower level qspi functions are being called) but the filesystem itself does not get updated.

We looked on the devzone and found these examples: https://devzone.nordicsemi.com/f/nordic-q-a/50534/qspi-block-device-issue-with-s25fs-flash-part  and https://devzone.nordicsemi.com/f/nordic-q-a/56928/qspi-32bit-addressing-mode but I was not able to get the FS to behave properly. I am however able to use the memory in both 24 and 32bit addressing mode and get similar behavior.

This are the flash_params we used: static const nrf_serial_flash_params_t m_sflash_params[] = {
    {    /*S25FS128S*/
        .read_id = { 0x01, 0x20, 0x18 },
        .capabilities = 0x00,
        .size = 16 * 1024 * 1024,
        .erase_size = 4 * 1024,
        .program_size = 256,
    }
};

The chip ID is being read just fine.

How can it be that i seem to be able to read and write the FS itself but I'm not able to add files, let alone modify them. We are running on sdk 15.2 with softdevice 140 btw. 

Looking forward to your reply,

Best regards,

Michiel

Parents
  • Hi Simon,

    I tried to modify the nrf_block_dev_qspi.c with the suggested file in the other thread without any luck. I tried for with my flash memory both in 24 and 32bit addressing mode.

    As for the read_id I triple checked it and cross referenced it with the s25f data sheet and it is correct. Also if I make this value to be anything else the memory will not initialize and in that case I cannot mount the file system, which I currently can so I am pretty positive this is not the culprit.

    It would be nice if you could open an internal ticket. As by this time I really have no clue what could still be going wrong. Specially since it does work fine with the other memory chip and there are no more obvious things to try and verify as far as I can see.

    I did also make a log of the read and write addresses used by the firmware during the creation of the filesystem both on the working device and our custom hardware. Here I can see that at the end of the creation of the file system the working device writes to the front of the memory (starting from address 0 up to address 3584) and on our hardware it only reads address 0 but does not perform the writes. Maybe this is a good indication for you on what is going on?

    Thanks again for your support,

    Michiel

    <info> app: Initializing disk 0 (QSPI)...
    <info> app: Mounting volume...
    <info> app: reading from: 0
    <error> app: Mount failed. Filesystem not found. Please format device.
    <info> app: 
    Creating filesystem...
    <info> app: reading from: 28672
    <info> app: writing to: 28672
    <info> app: writing to: 29184
    <info> app: writing to: 29696
    <info> app: writing to: 30208
    <info> app: writing to: 30720
    <info> app: writing to: 31232
    <info> app: writing to: 31744
    <info> app: writing to: 32256
    <info> app: reading from: 32768
    <info> app: writing to: 32768
    <info> app: writing to: 33280
    <info> app: writing to: 33792
    <info> app: writing to: 34304
    <info> app: writing to: 34816
    <info> app: writing to: 35328
    <info> app: writing to: 35840
    <info> app: writing to: 36352
    <info> app: reading from: 36864
    <info> app: reading from: 40960
    <info> app: reading from: 45056
    <info> app: reading from: 49152
    <info> app: writing to: 49152
    <info> app: writing to: 49664
    <info> app: writing to: 50176
    <info> app: writing to: 50688
    <info> app: writing to: 51200
    <info> app: writing to: 51712
    <info> app: writing to: 52224
    <info> app: writing to: 52736
    <info> app: reading from: 53248
    <info> app: reading from: 57344
    <info> app: reading from: 61440
    <info> app: reading from: 0
    <info> app: writing to: 0
    <info> app: writing to: 512
    <info> app: writing to: 1024
    <info> app: writing to: 1536
    <info> app: writing to: 2048
    <info> app: writing to: 2560
    <info> app: writing to: 3072
    <info> app: writing to: 3584
    <info> app: Mounting volume...
    <info> app: reading from: 0
    <info> app: reading from: 32256
    <info> app: Done

    <info> app: Initializing disk 0 (QSPI)...
    <info> app: Mounting volume...
    <info> app: reading from: 0
    <error> app: Mount failed. Filesystem not found. Please format device.
    <info> app: 
    Creating filesystem...
    <info> app: reading from: 28672
    <info> app: writing to: 32256
    <info> app: reading from: 32768
    <info> app: writing to: 32768
    <info> app: writing to: 33280
    <info> app: writing to: 33792
    <info> app: writing to: 34304
    <info> app: writing to: 34816
    <info> app: writing to: 35328
    <info> app: writing to: 35840
    <info> app: writing to: 36352
    <info> app: reading from: 36864
    <info> app: writing to: 36864
    <info> app: writing to: 37376
    <info> app: writing to: 37888
    <info> app: writing to: 38400
    <info> app: writing to: 38912
    <info> app: writing to: 39424
    <info> app: writing to: 39936
    <info> app: writing to: 40448
    <info> app: reading from: 40960
    <info> app: writing to: 40960
    <info> app: writing to: 41472
    <info> app: writing to: 41984
    <info> app: writing to: 42496
    <info> app: writing to: 43008
    <info> app: writing to: 43520
    <info> app: writing to: 44032
    <info> app: writing to: 44544
    <info> app: reading from: 45056
    <info> app: writing to: 45056
    <info> app: writing to: 45568
    <info> app: writing to: 46080
    <info> app: writing to: 46592
    <info> app: writing to: 47104
    <info> app: writing to: 47616
    <info> app: writing to: 48128
    <info> app: writing to: 48640
    <info> app: reading from: 49152
    <info> app: writing to: 49152
    <info> app: writing to: 49664
    <info> app: writing to: 50176
    <info> app: writing to: 50688
    <info> app: writing to: 51200
    <info> app: writing to: 51712
    <info> app: writing to: 52224
    <info> app: writing to: 52736
    <info> app: reading from: 53248
    <info> app: writing to: 53248
    <info> app: writing to: 53760
    <info> app: writing to: 54272
    <info> app: writing to: 54784
    <info> app: writing to: 55296
    <info> app: writing to: 55808
    <info> app: writing to: 56320
    <info> app: writing to: 56832
    <info> app: reading from: 57344
    <info> app: writing to: 57344
    <info> app: writing to: 57856
    <info> app: writing to: 58368
    <info> app: writing to: 58880
    <info> app: writing to: 59392
    <info> app: writing to: 59904
    <info> app: writing to: 60416
    <info> app: writing to: 60928
    <info> app: reading from: 61440
    <info> app: writing to: 61440
    <info> app: writing to: 61952
    <info> app: writing to: 62464
    <info> app: writing to: 62976
    <info> app: writing to: 63488
    <info> app: writing to: 64000
    <info> app: writing to: 64512
    <info> app: writing to: 65024
    <info> app: reading from: 65536
    <info> app: writing to: 65536
    <info> app: writing to: 66048
    <info> app: writing to: 66560
    <info> app: writing to: 67072
    <info> app: writing to: 67584
    <info> app: writing to: 68096
    <info> app: writing to: 68608
    <info> app: writing to: 69120
    <info> app: reading from: 69632
    <info> app: writing to: 69632
    <info> app: writing to: 70144
    <info> app: writing to: 70656
    <info> app: writing to: 71168
    <info> app: writing to: 71680
    <info> app: writing to: 72192
    <info> app: writing to: 72704
    <info> app: writing to: 73216
    <info> app: reading from: 73728
    <info> app: writing to: 73728
    <info> app: writing to: 74240
    <info> app: writing to: 74752
    <info> app: writing to: 75264
    <info> app: writing to: 75776
    <info> app: writing to: 76288
    <info> app: writing to: 76800
    <info> app: writing to: 77312
    <info> app: reading from: 77824
    <info> app: writing to: 77824
    <info> app: writing to: 78336
    <info> app: writing to: 78848
    <info> app: writing to: 79360
    <info> app: writing to: 79872
    <info> app: writing to: 80384
    <info> app: writing to: 80896
    <info> app: writing to: 81408
    <info> app: reading from: 0
    <info> app: writing to: 0
    <info> app: Mounting volume...
    <info> app: reading from: 0
    <info> app: reading from: 32256
    <info> app: Done

Reply
  • Hi Simon,

    I tried to modify the nrf_block_dev_qspi.c with the suggested file in the other thread without any luck. I tried for with my flash memory both in 24 and 32bit addressing mode.

    As for the read_id I triple checked it and cross referenced it with the s25f data sheet and it is correct. Also if I make this value to be anything else the memory will not initialize and in that case I cannot mount the file system, which I currently can so I am pretty positive this is not the culprit.

    It would be nice if you could open an internal ticket. As by this time I really have no clue what could still be going wrong. Specially since it does work fine with the other memory chip and there are no more obvious things to try and verify as far as I can see.

    I did also make a log of the read and write addresses used by the firmware during the creation of the filesystem both on the working device and our custom hardware. Here I can see that at the end of the creation of the file system the working device writes to the front of the memory (starting from address 0 up to address 3584) and on our hardware it only reads address 0 but does not perform the writes. Maybe this is a good indication for you on what is going on?

    Thanks again for your support,

    Michiel

    <info> app: Initializing disk 0 (QSPI)...
    <info> app: Mounting volume...
    <info> app: reading from: 0
    <error> app: Mount failed. Filesystem not found. Please format device.
    <info> app: 
    Creating filesystem...
    <info> app: reading from: 28672
    <info> app: writing to: 28672
    <info> app: writing to: 29184
    <info> app: writing to: 29696
    <info> app: writing to: 30208
    <info> app: writing to: 30720
    <info> app: writing to: 31232
    <info> app: writing to: 31744
    <info> app: writing to: 32256
    <info> app: reading from: 32768
    <info> app: writing to: 32768
    <info> app: writing to: 33280
    <info> app: writing to: 33792
    <info> app: writing to: 34304
    <info> app: writing to: 34816
    <info> app: writing to: 35328
    <info> app: writing to: 35840
    <info> app: writing to: 36352
    <info> app: reading from: 36864
    <info> app: reading from: 40960
    <info> app: reading from: 45056
    <info> app: reading from: 49152
    <info> app: writing to: 49152
    <info> app: writing to: 49664
    <info> app: writing to: 50176
    <info> app: writing to: 50688
    <info> app: writing to: 51200
    <info> app: writing to: 51712
    <info> app: writing to: 52224
    <info> app: writing to: 52736
    <info> app: reading from: 53248
    <info> app: reading from: 57344
    <info> app: reading from: 61440
    <info> app: reading from: 0
    <info> app: writing to: 0
    <info> app: writing to: 512
    <info> app: writing to: 1024
    <info> app: writing to: 1536
    <info> app: writing to: 2048
    <info> app: writing to: 2560
    <info> app: writing to: 3072
    <info> app: writing to: 3584
    <info> app: Mounting volume...
    <info> app: reading from: 0
    <info> app: reading from: 32256
    <info> app: Done

    <info> app: Initializing disk 0 (QSPI)...
    <info> app: Mounting volume...
    <info> app: reading from: 0
    <error> app: Mount failed. Filesystem not found. Please format device.
    <info> app: 
    Creating filesystem...
    <info> app: reading from: 28672
    <info> app: writing to: 32256
    <info> app: reading from: 32768
    <info> app: writing to: 32768
    <info> app: writing to: 33280
    <info> app: writing to: 33792
    <info> app: writing to: 34304
    <info> app: writing to: 34816
    <info> app: writing to: 35328
    <info> app: writing to: 35840
    <info> app: writing to: 36352
    <info> app: reading from: 36864
    <info> app: writing to: 36864
    <info> app: writing to: 37376
    <info> app: writing to: 37888
    <info> app: writing to: 38400
    <info> app: writing to: 38912
    <info> app: writing to: 39424
    <info> app: writing to: 39936
    <info> app: writing to: 40448
    <info> app: reading from: 40960
    <info> app: writing to: 40960
    <info> app: writing to: 41472
    <info> app: writing to: 41984
    <info> app: writing to: 42496
    <info> app: writing to: 43008
    <info> app: writing to: 43520
    <info> app: writing to: 44032
    <info> app: writing to: 44544
    <info> app: reading from: 45056
    <info> app: writing to: 45056
    <info> app: writing to: 45568
    <info> app: writing to: 46080
    <info> app: writing to: 46592
    <info> app: writing to: 47104
    <info> app: writing to: 47616
    <info> app: writing to: 48128
    <info> app: writing to: 48640
    <info> app: reading from: 49152
    <info> app: writing to: 49152
    <info> app: writing to: 49664
    <info> app: writing to: 50176
    <info> app: writing to: 50688
    <info> app: writing to: 51200
    <info> app: writing to: 51712
    <info> app: writing to: 52224
    <info> app: writing to: 52736
    <info> app: reading from: 53248
    <info> app: writing to: 53248
    <info> app: writing to: 53760
    <info> app: writing to: 54272
    <info> app: writing to: 54784
    <info> app: writing to: 55296
    <info> app: writing to: 55808
    <info> app: writing to: 56320
    <info> app: writing to: 56832
    <info> app: reading from: 57344
    <info> app: writing to: 57344
    <info> app: writing to: 57856
    <info> app: writing to: 58368
    <info> app: writing to: 58880
    <info> app: writing to: 59392
    <info> app: writing to: 59904
    <info> app: writing to: 60416
    <info> app: writing to: 60928
    <info> app: reading from: 61440
    <info> app: writing to: 61440
    <info> app: writing to: 61952
    <info> app: writing to: 62464
    <info> app: writing to: 62976
    <info> app: writing to: 63488
    <info> app: writing to: 64000
    <info> app: writing to: 64512
    <info> app: writing to: 65024
    <info> app: reading from: 65536
    <info> app: writing to: 65536
    <info> app: writing to: 66048
    <info> app: writing to: 66560
    <info> app: writing to: 67072
    <info> app: writing to: 67584
    <info> app: writing to: 68096
    <info> app: writing to: 68608
    <info> app: writing to: 69120
    <info> app: reading from: 69632
    <info> app: writing to: 69632
    <info> app: writing to: 70144
    <info> app: writing to: 70656
    <info> app: writing to: 71168
    <info> app: writing to: 71680
    <info> app: writing to: 72192
    <info> app: writing to: 72704
    <info> app: writing to: 73216
    <info> app: reading from: 73728
    <info> app: writing to: 73728
    <info> app: writing to: 74240
    <info> app: writing to: 74752
    <info> app: writing to: 75264
    <info> app: writing to: 75776
    <info> app: writing to: 76288
    <info> app: writing to: 76800
    <info> app: writing to: 77312
    <info> app: reading from: 77824
    <info> app: writing to: 77824
    <info> app: writing to: 78336
    <info> app: writing to: 78848
    <info> app: writing to: 79360
    <info> app: writing to: 79872
    <info> app: writing to: 80384
    <info> app: writing to: 80896
    <info> app: writing to: 81408
    <info> app: reading from: 0
    <info> app: writing to: 0
    <info> app: Mounting volume...
    <info> app: reading from: 0
    <info> app: reading from: 32256
    <info> app: Done

Children
No Data
Related