This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM335X: Mount JFFS 2 on NAND Flash .

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: AM3359

Tool/software:

Hi TI Team ,


We are using Linux 4.19.5 version,AM3359 is connected to NAND Flash .
Able to create MTD partitions in DTS, need to Mount JFFS2 file system on NAND flash .
Target is to boot the application from NAND flash via JFFS.

Queries :
Does Linux supports JFFS 2 for NAND Flash , should we use UBIFS?
Can we get any documentation on how to proceed further to mount a file system on NAND Flash .

Thanks ,
Venkat Vellanki.

  • Hi, I am out of office for the next two weeks. Please expect delayed response. 

  • Hi Venkat,

    Yes, JFFS2 support has been dropped in the SDK, and replaced with UBIFS.

    Please refer to the following doc for the using UBIFS on NAND.

    https://software-dl.ti.com/processor-sdk-linux/esd/AM335X/09_03_05_02/exports/docs/linux/Foundational_Components/U-Boot/UG-NAND.html

  • Hi Bin Liu,

    Sorry for the delayed response .
    We have started working on JFFS2 and at end of our implementation stage in order to shift to UBIFS. Please help in resolving JFFS2 issue

    We were able to create the JFF2 image and mount JFFS2 on the NAND flash using below command .
        mkfs.jffs2 -e 0x20000 -ln -r ./jffs2 -o ./images/user.jffs2
        NAND flash block size/erase size as per data sheet is 128KiB.
    Upon 1st time flashing of JFFS2 , we are not facing any issues .
    After few TFTP transfers in kernel ,from next power cycles we were facing the below issue .
    [    6.773210] jffs2: Empty flash at 0x01eb4064 ends at 0x01eb4800
    [    7.170317] jffs2: jffs2_scan_dirent_node(): Name CRC failed on node at 0x059a47d4: Read 0x247964c3, calculated 0x0d44b065
    [    7.197081] jffs2: Empty flash at 0x059a4810 ends at 0x059a5000

    Issue is that they were not a part of JFFS2 filesystem partition and occurring at random address of NAND flash like kernel partition .
    How can we resolve the randomly occurring warnings ?  
    We have tried padding, compression methods and no improvement has been observed .
    Please let us know if we were missing anything.

    Edit : Please find the kernel configurations related to JFFS2
    CONFIG_JFFS2_FS=y
    CONFIG_JFFS2_FS_DEBUG=0
    CONFIG_JFFS2_FS_WRITEBUFFER=y
    # CONFIG_JFFS2_FS_WBUF_VERIFY is not set
    # CONFIG_JFFS2_SUMMARY is not set
    # CONFIG_JFFS2_FS_XATTR is not set
    # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
    CONFIG_JFFS2_ZLIB=y
    CONFIG_JFFS2_RTIME=y
  • Hi Venkat,

    Sorry but JFFS2 has not been validated and supported in the SDK for many years, it is out of the support scope on this forums.

  • We were using the following versions on AM3359.

    U-Boot : U-Boot 2013.10

    Linux   : Linux 4.19.59-g5f8c1c6121

    NAND Flash : s25fl256.

    We were trying to mount UBIFS on NAND flash but there is no mtd-utils support in the present images .

    From previous forums study enabled UBIFS support in U-boot 

    #define CONFIG_CMD_UBI
    #define CONFIG_CMD_UBIFS
    #define CONFIG_RBTREE
    #define CONFIG_MTD_PARTITIONS
    #define CONFIG_CMD_MTDPARTS
    #define CONFIG_LZO
    #define CONFIG_MTD_DEVICE
    #define CONFIG_CMD_NAND_TRIMFFS
    #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (1024 << 10))

    Able to get command line functionality for MTD , UBIFS but there is no ubiformat functionality.


    In Linux done cross compilation of mtd-utils for ARM and loaded the images via TFTP into target (JFFS2 is being used as default filesystem mtd8).

    Configured mtd9 partition for UBIFS in DTS and unable use ubiformat and observed below error .

    [2025-06-19 14:52:53.043] root@RCU:~# ./ubiformat /dev/mtd9 -f rootfs.ubi
    [2025-06-19 14:53:09.474] ./ubiformat: line 2: syntax error: unterminated quoted string
    [2025-06-19 14:53:09.484] root@RCU:~#

    1) Still anything to be configured in u-boot ?

    2)Can we get a procedure to cross compile mtd-utils properly?

    Our end goal is to use UBIFS instead of JFFS2.

    Expecting a quick response , any improvement will be updated.

    Thanks,

    Venkat Vellanki.

  • Hi Bin Liu,

    We were using the following versions on AM3359.

    U-Boot : U-Boot 2013.10

    Linux   : Linux 4.19.59-g5f8c1c6121

    NAND Flash : s25fl256.

    We were trying to mount UBIFS on NAND flash but there is no mtd-utils support in the present images .

    From previous forums study enabled UBIFS support in U-boot 

    #define CONFIG_CMD_UBI
    #define CONFIG_CMD_UBIFS
    #define CONFIG_RBTREE
    #define CONFIG_MTD_PARTITIONS
    #define CONFIG_CMD_MTDPARTS
    #define CONFIG_LZO
    #define CONFIG_MTD_DEVICE
    #define CONFIG_CMD_NAND_TRIMFFS
    #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (1024 << 10))

    Able to get command line functionality for MTD , UBIFS but there is no ubiformat functionality.


    In Linux done cross compilation of mtd-utils for ARM and loaded the images via TFTP into target (JFFS2 is being used as default filesystem mtd8).

    Configured mtd9 partition for UBIFS in DTS and unable use ubiformat and observed below error .

    [2025-06-19 14:52:53.043] root@RCU:~# ./ubiformat /dev/mtd9 -f rootfs.ubi
    [2025-06-19 14:53:09.474] ./ubiformat: line 2: syntax error: unterminated quoted string
    [2025-06-19 14:53:09.484] root@RCU:~#

    1) Still anything to be configured in u-boot ?

    2)Can we get a procedure to cross compile mtd-utils properly?

    Our end goal is to use UBIFS instead of JFFS2.

    Expecting a quick response , any improvement will be updated.

    Thanks,

    Venkat Vellanki.

  • Hi Venkat,

    kernel 4.19 and u-boot 2013.10 were released many years ago and are no longer supported on this forums.

    Can you please try to reproduce the issue with the latest AM335x SDK (v9.3)?

  • The mounting of ubifs has been completed successfully.

    However, if any alterations are made to the filesystem, it takes some time for these changes to be updated in the flash memory.

    If a modification is made and the file is saved, then the board is powered off and on immediately, that modification will not be reflected.

    If we wait for approximately one minute before powering off and on, the modification will be visible.

    Please assist in reducing the sync time.

  • Hi Venkat,

    This is likely in the generic Linux filesystem, not TI platform specific, and is out of the support scope on this forums.

    I don't know the solution on top of my head, but we might search a round on internet to see if anyone else has talked about it.

  •  thanks for the valuable responses !