Issue mounting SPI-NOR Flash in Linux on custom board based on iMX93

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Issue mounting SPI-NOR Flash in Linux on custom board based on iMX93

107 Views
Bob_NXP_user
Contributor III

Hello everybody,

I'm tryng to mount a partition of my 256 MB SPI-NOR Flash memory MT25QU02GCBB8E12-0AUT in Linux, in order to see it as a folder of the file system (/mnt) and store data easily. 

I already use the first 128 MB of the memory to store the entire OS, and I succesfully boot from there, so I would like to set the remaining part for data storage. I partitioned into the dts file like this:

 

&flexspi1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexspi>;
assigned-clock-rates = <80000000>;
status = "okay";
 
flash0: flash@0 {
     reg = <0>;
     #address-cells = <1>;
     #size-cells = <1>;
     compatible = "jedec,spi-nor";
     spi-max-frequency = <10000000>;
     spi-tx-bus-width = <4>;
     spi-rx-bus-width = <4>;
 
     /* 128 MB partition dedicated to bootloader, device tree, kernel and rootfs */
     partition@0 {
          label = "system-readonly";
          reg = <0x0000000 0x8000000>;
          read-only;
          };
 
     /* 128 MB partition dedicated to user data (for example: application, logs) */
     partition@8000000{
          label = "data";
          reg = <0x8000000 0x8000000>;
          };
     };
};
 
enabling the mtd-utils I can see the partitions into /proc/mtd
Bob_NXP_user_0-1748935315521.png

 

then if I do the following steps I'm able to save files into the /mnt folder:

  1. flash_erase -j /dev/mtd1 0 0
  2. modprobe mtdblock
  3. mount -t jffs2 /dev/mtdblock1 /mnt
  4. echo 'test' > /mnt/file.txt

but when I reset the board and I try do the mounting step without erasing all the memory it gives me the following error:

Bob_NXP_user_1-1748935826341.png

Can you tell me what's going on? Is there a way to use this memory as data storage? Thanks.

Best Regards,

Bob

0 Kudos
Reply
0 Replies