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.

Unable to mount NOR flash (mtd) partition.

Part Number: AM62P

Tool/software:

Hi, 

Once after the kernel and file system are up, I can see the mtd partitions under /proc/mtd/ . 

But, mtd partitions are not listed when I run the df command or mount command. 

Following mount command also fails. 

#mount -t jffs2 /dev/mtdblock2 /mnt/testdir

Regards, 

Prabhu

  • The query has been assigned to the expert. Please expect a response within a day or two.

    Thanks!

  • Once after the kernel and file system are up, I can see the mtd partitions under /proc/mtd/

    Can you provide the output of `ls -al /dev/mtd*`?

    Also, can you pls attach a complete Kernel log.

    Following mount command also fails. 

    #mount -t jffs2 /dev/mtdblock2 /mnt/testdir

    How does it fail (log)?

    Regards, Andreas

  • Output for 

    mount -t jffs2 /dev/mtdblock2 /mnt/test

    tried other types of file system. 

    That is also failed with the following output. 

    output for 

    #ls /dev/mtd* 

    output for 

    #mount 

    Output for 

    #df 

    mkfs commands available on the target. 

    Regards, 

    Prabhu

  • Dmesg log is also attached. Taken just after the kernel and file system are up. 

    0434.dmesg.log
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    dmesg
    [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [ 0.000000] Linux version 6.1.83-ti-gc1c2f1971fbf (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Mon May 13 20:19:51 UTC 2024
    [ 0.000000] Machine model: Visteon AM62P5 Toyota Pre-sample A
    [ 0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    [ 0.000000] printk: bootconsole [ns16550a0] enabled
    [ 0.000000] efi: UEFI not found.
    [ 0.000000] OF: reserved mem: failed to allocate memory for node 'linux,cma': size 576 MiB
    [ 0.000000] Reserved memory: created DMA memory pool at 0x000000009c800000, size 1 MiB
    [ 0.000000] OF: reserved mem: initialized node r5f-dma-memory@9c800000, compatible id shared-dma-pool
    [ 0.000000] Reserved memory: created DMA memory pool at 0x000000009c900000, size 30 MiB
    [ 0.000000] OF: reserved mem: initialized node r5f-memory@9c900000, compatible id shared-dma-pool
    [ 0.000000] Zone ranges:
    [ 0.000000] DMA [mem 0x0000000080000000-0x00000000bfffffff]
    [ 0.000000] DMA32 empty
    [ 0.000000] Normal empty
    [ 0.000000] Movable zone start for each node
    [ 0.000000] Early memory node ranges
    [ 0.000000] node 0: [mem 0x0000000080000000-0x000000009c7fffff]
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards, 

    Prabhu

  • Thanks for the additional info, will review first thing next week.

    Regards, Andreas

  • Hi Prabhu,

    so reviewing what you sent I see evidence in several places that the Kernel is aware of the following (and only those) flash regions/partitions:

    [ 0.208027] 0x000000000000-0x000000080000 : "SBL_STAGE1"
    [ 0.209140] 0x000000080000-0x000000100000 : "SBL_STAGE2"
    [ 0.210097] 0x000000100000-0x000000200000 : "DM_APP"

    ...which get exposed to the system through /dev/mtd*{0,1,2}

    All these are raw partitions, containing straight binary firmware images. There is no filesystem associated with those partitions, hence mounting those won't work.

    If you want to access these raw-data containing partitions you should use the character device for this. For example, to see the contents of the partition that holds "SBL_STAGE1" you would do this (on my system it's all 0xff - erased)

    Fullscreen
    1
    2
    3
    4
    root@am62pxx-evm:~# hexdump -C /dev/mtd0 | head
    00000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
    *
    00080000
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I suppose you are using an SBL-based bootflow, using the bootloader from the MCU+ SDK. If you want to have a filesystem on your flash you need to edit the device tree file to define additional partition(s), which you can then format with a specific filesystem (using `mkfs.xxxx`), and then you can mount them.

    Regards, Andreas