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 Reply Children
  • Hi Simon,

    Is it correct that the QSPI driver always sends a 0x06 (write enable) command. I don't think this is necessary and in some cases prevents the actual command from running. Eg. A reset enable should be followed by a reset command but there should not be a write enable in between.

    Is there away to avoid this behavior?

    Thanks and best regards,

    Michiel

  • My bad, I think I see it, you can set the WREN to false in the config!

  • Hi Simon,

    I got as an answer from infineon that:

    Regarding the values you have provided in your latest response, I will not be able to comment on Nordic driver specific values, you should contact Nordic for it. However, can you explain why have you put erase size as 4KB (4*1024)? If you enable uniform sector architecture, the sector size will be 64KB or 256KB

    If I understand correctly this means I should change the params to the following:

    static const nrf_serial_flash_params_t m_sflash_params[] = {
        {    /*S25FS128S*/
            .read_id = { 0x01, 0x20, 0x18 },
            .capabilities = 0x00,
            .size = 16 * 1024 * 1024, 
            .erase_size = 64 * 1024,
            .program_size = 256,
        }
    };

    However when I run my code like this, I get the following error message:

    <error> app: QSPI FLASH erase unit size not supported

    So I changed this as well:

    /**
     * @brief QSPI block device internal erase unit buffer size
     * */
    #define NRF_BLOCK_DEV_QSPI_ERASE_UNIT_SIZE (4096*16)

    Now the erase unit size not supported error is no longer there, but I fail to mount the fs now. When changing the erase size what other buffer sizes and settings should I change? For example I can imagine that the buffer sizes to do a read modify write on a drive with 4k erase needs substantially smaller buffer compared to a drive with 64k erase blocks...

    Best regards,

    Michiel

  • Hi,

    Any suggestions on the questions above?

    Best regards,

    Michiel

Related