Hello,
I try to install W25Q128 Winbond (serial flash memory) on SPI pin and with /CS W25Q128 on SPI_CS1 (pin 27).
On W25Q128 , Pins
WP and
reset/Hold aren't connected.
MISO, MOSI and clk on EXT3 [ 5 6 7 ] rt5350f' pins.
I have split spi definition on RT5350 DTSI file :
spi@b00 {
compatible = "ralink,rt5350-spi", "ralink,rt2880-spi";
reg = <0xb00 0x40>;
resets = <&rstctrl 18>;
reset-names = "spi";
#address-cells = <1>;
#size-cells = <1>;
pinctrl-names = "default";
pinctrl-0 = <&spi_pins>;
status = "disabled";
};
spi@b40 {
compatible = "ralink,rt5350-spi";
reg = <0xb40 0x60>;
resets = <&rstctrl 18>;
reset-names = "spi";
#address-cells = <1>;
#size-cells = <1>;
pinctrl-names = "default";
pinctrl-0 = <&spi_cs1>;
status = "disabled";
};
Add SPI section on Olimex DTS file :
spi@b40 {
status = "okay";
m25p80@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "w25q128";
reg = <0 0>;
linux,modalias = "m25p80", "w25q128";
spi-max-frequency = <104000000>;
partition@0 {
label = "data";
reg = <0x0 0x8000000>;
};
};
};
patch rt305x.c for Clock declaration :
+ ralink_clk_add("10000b40.spi", sys_rate);
But, i have few errors ... ??? .... :'(
Quote
[ 0.560000] m25p80 spi32766.0: found en25q64, expected s25fl064k
[ 0.570000] m25p80 spi32766.0: en25q64 (8192 Kbytes)
[ 0.580000] 4 ofpart partitions found on MTD device spi32766.0
[ 0.590000] Creating 4 MTD partitions on "spi32766.0":
[ 0.610000] 0x000000000000-0x000000030000 : "u-boot"
[ 0.620000] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.630000] 0x000000040000-0x000000050000 : "factory"
[ 0.640000] 0x000000050000-0x000000800000 : "firmware"
[ 0.730000] 2 uimage-fw partitions found on MTD device firmware
[ 0.740000] 0x000000050000-0x000000158d57 : "kernel"
[ 0.750000] 0x000000158d57-0x000000800000 : "rootfs"
[ 0.770000] mtd: device 5 (rootfs) set to be root filesystem
[ 0.780000] 1 squashfs-split partitions found on MTD device rootfs
[ 0.790000] 0x0000003a0000-0x000000800000 : "rootfs_data"
[ 0.810000] m25p80 spi32765.0: TX failed, err=-145
[ 0.830000] m25p80 spi32765.0: RX failed, err=-145
[ 0.840000] m25p80 spi32765.0: unrecognized JEDEC id 003017
[ 0.850000] ralink_soc_eth 10100000.ethernet: generated random MAC address 52:10:f5:ae:bd:6e
[ 0.870000] ralink_soc_eth 10100000.ethernet eth0: ralink at 0xb0100000, irq 5
[ 0.890000] rt2880_wdt 10000120.watchdog: Initialized
[ 0.900000] TCP: cubic registered
[ 0.910000] NET: Registered protocol family 17
[ 0.910000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[ 0.940000] 8021q: 802.1Q VLAN Support v1.8
[ 0.960000] jffs2: Flash size not aligned to erasesize, reducing to 6784KiB
[ 0.970000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x3934 instead
[ 0.990000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x818e instead
[ 1.010000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0xd661 instead
[ 1.030000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0x0080 instead
[ 1.050000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0x000a instead
[ 1.070000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x0002 instead
[ 1.090000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0x0360 instead
[ 1.110000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0x0002 instead
[ 1.120000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0x8428 instead
[ 1.140000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000024: 0x0080 instead
[ 1.160000] jffs2: Further such events for this erase block will not be printed
[ 1.180000] jffs2: Empty flash at 0x0000003c ends at 0x00000040
[ 1.220000] jffs2: Old JFFS2 bitmask found at 0x000040fc
The boot
openwrt-ramips-rt305x-olinuxino-rt5350f-squashfs-sysupgrade.bin are Ok without patch !!!
Quote
Flash size not aligned to erasesize
err=-145 , it's a probleme with WatchDog ?!
Quote
[ 0.810000] m25p80 spi32765.0: TX failed, err=-145
[ 0.830000] m25p80 spi32765.0: RX failed, err=-145
Need help for DTS/DTSI en Pin and for add NorFlash extension correctly ... :-\ ... thx
I fix Nor flash on SPI connectique with another config :
spi@b00 {
compatible = "ralink,rt5350-spi";
reg = <0xb00 0x100>;
resets = <&rstctrl 18>;
reset-names = "spi";
#address-cells = <1>;
#size-cells = <1>;
pinctrl-names = "default";
pinctrl-0 = <&spi_pins &spi_cs1>;
status = "disabled";
};
spi@b00 {
status = "okay";
num-cs = <2>;
m25p80@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "s25fl064k";
reg = <0 0>;
linux,modalias = "m25p80", "s25fl064k";
spi-max-frequency = <10000000>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
label = "firmware";
reg = <0x50000 0x7b0000>;
};
};
m25p80@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "w25q128";
reg = <1 0x800000 0x1000000>;
linux,modalias = "m25p80", "w25q128";
spi-max-frequency = <10000000>;
partition@800000 {
label = "data";
reg = <0x800000 0x1000000>;
};
};
};
But i have few error ....
Quote
[ 0.560000] m25p80 spi32766.0: found en25q64, expected s25fl064k
[ 0.570000] m25p80 spi32766.0: en25q64 (8192 Kbytes)
[ 0.580000] 4 ofpart partitions found on MTD device spi32766.0
[ 0.590000] Creating 4 MTD partitions on "spi32766.0":
[ 0.600000] 0x000000000000-0x000000030000 : "u-boot"
[ 0.620000] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.630000] 0x000000040000-0x000000050000 : "factory"
[ 0.640000] 0x000000050000-0x000000800000 : "firmware"
[ 0.730000] 2 uimage-fw partitions found on MTD device firmware
[ 0.740000] 0x000000050000-0x000000158d67 : "kernel"
[ 0.750000] 0x000000158d67-0x000000800000 : "rootfs"
[ 0.770000] mtd: device 5 (rootfs) set to be root filesystem
[ 0.780000] 1 squashfs-split partitions found on MTD device rootfs
[ 0.790000] 0x0000003b0000-0x000000800000 : "rootfs_data"
[ 0.810000] m25p80 spi32766.1: w25q128 (16384 Kbytes)
[ 0.820000] 1 ofpart partitions found on MTD device spi32766.1
[ 0.830000] Creating 1 MTD partitions on "spi32766.1":
[ 0.840000] 0x000000800000-0x000001800000 : "data"
[ 0.850000] mtd: partition "data" extends beyond the end of device "spi32766.1" -- size truncated to 0x800000
[ 0.880000] ralink_soc_eth 10100000.ethernet: generated random MAC address be:f7:e2:12:6b:78
[ 0.900000] ralink_soc_eth 10100000.ethernet eth0: ralink at 0xb0100000, irq 5
[ 0.920000] rt2880_wdt 10000120.watchdog: Initialized
i have "truncated" message or if a change reg property , i have "out of reach" message ... ???
[ 0.850000] mtd: partition "data" extends beyond the end of device "spi32766.1" -- size truncated to 0x800000
or
[ 0.860000] mtd: partition "data" is out of reach -- disabled
... how i can fix mtd partition for 24Mbytes ?!
i change reg rules like this :
m25p80@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "w25q128";
reg = <1 0x800000 0x1000000>;
linux,modalias = "m25p80", "w25q128";
spi-max-frequency = <10000000>;
partition@0 {
label = "home ";
reg = <0x0 0x1000000>;
};
};
it's work , without err/warning message on boot ...
Quote
[ 0.550000] rt2880-pinmux pinctrl: found group selector 1 for spi
[ 0.550000] rt2880-pinmux pinctrl: found group selector 6 for spi_cs1
[ 0.550000] rt2880-pinmux pinctrl: request pin 3 (io3) for 10000b00.spi
[ 0.550000] rt2880-pinmux pinctrl: request pin 4 (io4) for 10000b00.spi
[ 0.550000] rt2880-pinmux pinctrl: request pin 5 (io5) for 10000b00.spi
[ 0.550000] rt2880-pinmux pinctrl: request pin 6 (io6) for 10000b00.spi
[ 0.550000] rt2880-pinmux pinctrl: request pin 27 (io27) for 10000b00.spi
[ 0.560000] m25p80 spi32766.0: found en25q64, expected s25fl064k
[ 0.570000] m25p80 spi32766.0: en25q64 (8192 Kbytes)
[ 0.580000] 4 ofpart partitions found on MTD device spi32766.0
[ 0.600000] Creating 4 MTD partitions on "spi32766.0":
[ 0.610000] 0x000000000000-0x000000030000 : "u-boot"
[ 0.620000] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.630000] 0x000000040000-0x000000050000 : "factory"
[ 0.640000] 0x000000050000-0x000000800000 : "firmware"
[ 0.730000] 2 uimage-fw partitions found on MTD device firmware
[ 0.740000] 0x000000050000-0x000000158cf6 : "kernel"
[ 0.750000] 0x000000158cf6-0x000000800000 : "rootfs"
[ 0.770000] mtd: device 5 (rootfs) set to be root filesystem
[ 0.780000] 1 squashfs-split partitions found on MTD device rootfs
[ 0.790000] 0x0000003b0000-0x000000800000 : "rootfs_data"
[ 0.810000] m25p80 spi32766.1: w25q128 (16384 Kbytes)
[ 0.820000] 1 ofpart partitions found on MTD device spi32766.1
[ 0.830000] Creating 1 MTD partitions on "spi32766.1":
[ 0.840000] 0x000000000000-0x000001000000 : "home"
... ... but, i didn't see "home" partition on system
Quote
root@OpenWrt:/# cat /proc/mtd
dev: size erasesize name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 007b0000 00010000 "firmware"
mtd4: 00108d82 00010000 "kernel"
mtd5: 006a727e 00010000 "rootfs"
mtd6: 00450000 00010000 "rootfs_data"
mtd7: 01000000 00010000 "home "
Quote
root@OpenWrt:/# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 4.3M 276.0K 4.0M 6% /
/dev/root 2.5M 2.5M 0 100% /rom
tmpfs 14.3M 60.0K 14.2M 0% /tmp
tmpfs 14.3M 44.0K 14.2M 0% /tmp/root
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mtdblock6 4.3M 276.0K 4.0M 6% /overlay
overlayfs:/overlay 4.3M 276.0K 4.0M 6% /
There are "0x000000000000" on register ! REG , should they follow himself ?!
Quote
[ 0.640000] 0x000000050000-0x000000800000 : "firmware"
[ 0.830000] Creating 1 MTD partitions on "spi32766.1":
[ 0.840000] 0x000000000000-0x000001000000 : "home "
... like "home" start to 0x000000800000 , or it's a new device with new register ? ... oO
So, where i can define mtd partion or fix mount after the boot system ?!
step by step 8)
I can mount with command "mount" ... :P
Quote
BusyBox v1.23.2 (2016-08-19 09:27:07 CEST) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
CHAOS CALMER (15.05-rc4, r46591)
-----------------------------------------------------
* 1 1/2 oz Gin Shake with a glassful
* 1/4 oz Triple Sec of broken ice and pour
* 3/4 oz Lime Juice unstrained into a goblet.
* 1 1/2 oz Orange Juice
* 1 tsp. Grenadine Syrup
-----------------------------------------------------
root@OpenWrt:/# ls -ltr /mnt/home/
root@OpenWrt:/# cat /proc/mtd
dev: size erasesize name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 007b0000 00010000 "firmware"
mtd4: 00108cd6 00010000 "kernel"
mtd5: 006a732a 00010000 "rootfs"
mtd6: 00450000 00010000 "rootfs_data"
mtd7: 01000000 00010000 "home"
root@OpenWrt:/# mount -t jffs2 /dev/mtdblock7 /mnt/home
[ 213.900000] jffs2: Empty flash at 0x000010f0 ends at 0x00001110
[ 213.940000] jffs2: Empty flash at 0x00002108 ends at 0x00002128
[ 213.980000] jffs2: Empty flash at 0x00003120 ends at 0x00003140
[ 214.020000] jffs2: Empty flash at 0x00004138 ends at 0x00004158
[ 214.060000] jffs2: Empty flash at 0x00005150 ends at 0x00005170
[ 214.100000] jffs2: Empty flash at 0x00006168 ends at 0x00006188
[ 214.140000] jffs2: Empty flash at 0x00007180 ends at 0x000071a0
[ 214.180000] jffs2: Empty flash at 0x00008198 ends at 0x000081b8
[ 214.220000] jffs2: Empty flash at 0x000091b0 ends at 0x000091d0
[ 214.260000] jffs2: Empty flash at 0x0000a1c8 ends at 0x0000a1e8
[ 214.300000] jffs2: Empty flash at 0x0000b1e0 ends at 0x0000b200
[ 214.340000] jffs2: Empty flash at 0x0000c1f8 ends at 0x0000c218
[ 214.380000] jffs2: Empty flash at 0x0000d210 ends at 0x0000d230
[ 214.420000] jffs2: Empty flash at 0x0000e228 ends at 0x0000e248
[ 214.460000] jffs2: Empty flash at 0x0000f240 ends at 0x0000f260
[ 214.480000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00070000: 0x042b instead
[ 214.500000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00070004: 0x5406 instead
[ 214.520000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00070008: 0x4003 instead
[ 214.530000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0007000c: 0x00c5 instead
[ 214.550000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00070010: 0x020a instead
... and write file in "/mnt/home" !!! But, after each reboot and mount , Nor flash was erase !!!
How to automount with DTS ?
How to mount without erase data ?
thx.
i have explore log boot ....
Quote
[ 30.610000] mount_root: loading kmods from internal overlay
[ 34.730000] block: attempting to load /etc/config/fstab
[ 34.740000] block: unable to load configuration (fstab: Entry not found)
[ 34.750000] block: no usable configuration
[ 34.760000] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
i smell a failed config with DTS/DTSi definition ... ::)
need help ... possible or not for plug and mount a Nor Flash on SPI ?!
I find an issu on VoCore Blog : VoCore: SPI & MicroSD 11 (http://vonger.cn/?p=1347)
...
Thx Lub !!!
as a previous post : VoCore: SPI & MicroSD 6 (http://vonger.cn/?p=1106) ... devices and SPI pin need a Pull High or Pull up connection !
Quote
also pull HOLD/WP to high
So, i add on FSTAB config few line :
config 'mount'
option target '/mnt/data'
option device '/dev/mtdblock7'
option label 'data'
option fstype 'jffs2'
option 'options' 'rw,noatime'
option enabled '1'
Each start , MTD7 block was mount on mnt :
Quote
BusyBox v1.23.2 (2016-08-30 10:11:09 CEST) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
CHAOS CALMER (15.05-rc4, r46591)
-----------------------------------------------------
* 1 1/2 oz Gin Shake with a glassful
* 1/4 oz Triple Sec of broken ice and pour
* 3/4 oz Lime Juice unstrained into a goblet.
* 1 1/2 oz Orange Juice
* 1 tsp. Grenadine Syrup
-----------------------------------------------------
root@OpenWrt:/# cat /etc/config/fstab
config 'global'
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'
config 'mount'
option target '/mnt/data'
option device '/dev/mtdblock7'
option label 'userdata'
option fstype 'jffs2'
option 'options' 'rw,noatime'
option enabled '1'
root@OpenWrt:/# ls -ltr /mnt/data/
drwxr-xr-x 2 root root 0 Aug 30 11:04 config
root@OpenWrt:/#
Next step : clean the openwrt squashfs image between : spi tools , Flash tools and other MTD's family modules installed for testing.
And up FSTAB config on openwrt source for build a good image.
FiXED !!! ... :)
i change iles like that :
/dts-v1/;
/include/ "rt5350.dtsi"
/ {
compatible = "RT5350F-OLINUXINO", "ralink,rt5350-soc";
model = "RT5350F-OLINUXINO";
palmbus@10000000 {
spi@b00 {
status = "okay";
m25p80@0 {
#address-cells = <1>;
#size-cells = <1>;
...........
};
m25p80@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "w25q128";
reg = <1>;
linux,modalias = "m25p80", "w25q128";
spi-max-frequency = <10000000>;
partition@0 {
label = "userdata";
reg = <0x0 0x1000000>;
};
};
...........
spi@b00 {
compatible = "ralink,rt5350-spi","ralink,rt2880-spi";
reg = <0xb00 0x100>;
resets = <&rstctrl 18>;
reset-names = "spi";
#address-cells = <1>;
#size-cells = <1>;
pinctrl-names = "default";
pinctrl-0 = <&spi_pins &spi_cs1>;
status = "disabled";
};
Dont forget to plug "WP" and "Hold" pins on a 3.3v (pull high)
and I up thr FSTAB file
/openwrt/package/system/fstools/files/fstab.default :
if [ -f i/dev/mtdblock7 ]
echo "Formatage du block MTD7 en jffs2 (no skip bad blocks)"
flash_eraseall -jN /dev/mtd7
then
echo "ERROR : mtdblock7 not FOUND"
fi
if [ ! -f /etc/config/fstab ]
then
echo "Detection des block"
block detect > /etc/config/fstab
echo "ecriture du montage SOLDIOM"
echo " " >> /etc/config/fstab
echo "##SOLIDOM external Mount" >> /etc/config/fstab
echo "config 'mount'" >> /etc/config/fstab
echo " option target '/mnt/data'" >> /etc/config/fstab
echo " option device '/dev/mtdblock7'" >> /etc/config/fstab
echo " option label 'userdata'" >> /etc/config/fstab
echo " option fstype 'jffs2'" >> /etc/config/fstab
echo " option 'options' 'rw,noatime'" >> /etc/config/fstab
echo " option enabled '1'" >> /etc/config/fstab
echo " " >> /etc/config/fstab
echo " " >> /etc/config/fstab
else
echo "FSTAB already in config"
fi
exit 0
SPI FLASH needed a formatting JFFS2 type. So , i write flash_erase on Openwrt install step.
- After the OpenWrt flash ( 2: Load system code then write to Flash via TFTP.), a reboot was need for good mtdblock7 mount
- I wait few second after the reboot for release mount
- Check for good size like 16384 Kbytes on booting log
Quote
[ 0.560000] m25p80 spi32766.0: found en25q64, expected s25fl064k
[ 0.580000] m25p80 spi32766.0: en25q64 (8192 Kbytes)
[ 0.590000] 4 ofpart partitions found on MTD device spi32766.0
[ 0.600000] Creating 4 MTD partitions on "spi32766.0":
[ 0.610000] 0x000000000000-0x000000030000 : "u-boot"
[ 0.620000] 0x000000030000-0x000000040000 : "u-boot-env"
[ 0.630000] 0x000000040000-0x000000050000 : "factory"
[ 0.640000] 0x000000050000-0x000000800000 : "firmware"
[ 0.920000] 2 uimage-fw partitions found on MTD device firmware
[ 0.930000] 0x000000050000-0x000000158d0d : "kernel"
[ 0.940000] 0x000000158d0d-0x000000800000 : "rootfs"
[ 0.950000] mtd: device 5 (rootfs) set to be root filesystem
[ 0.960000] 1 squashfs-split partitions found on MTD device rootfs
[ 0.980000] 0x0000003d0000-0x000000800000 : "rootfs_data"
[ 1.000000] m25p80 spi32766.1: w25q128 (16384 Kbytes)
[ 1.010000] 1 ofpart partitions found on MTD device spi32766.1
[ 1.020000] Creating 1 MTD partitions on "spi32766.1":
[ 1.030000] 0x000000000000-0x000001000000 : "userdata"
after few time , i have :
Quote
root@OpenWrt:/mnt/data# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 4.2M 276.0K 3.9M 6% /
/dev/root 2.5M 2.5M 0 100% /rom
tmpfs 14.3M 64.0K 14.2M 0% /tmp
/dev/mtdblock6 4.2M 276.0K 3.9M 6% /overlay
overlayfs:/overlay 4.2M 276.0K 3.9M 6% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mtdblock7 16.0M 516.0K 15.5M 3% /mnt/data
I see a few warning ... ???
Quote
Warning (reg_format): "reg" property in /palmbus@10000000/spi@b00/m25p80@1 has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
I have write a new issu for package/system/fstools/files/fstab.default
if [ ! -f /etc/config/fstab ]
then
if [ -f /dev/mtdblock7 ]
echo "Formatage du block MTD7 en jffs2 (no skip bad blocks)"
flash_eraseall -jN /dev/mtd7
then
echo "ERROR : mtdblock7 not FOUND"
fi
echo "Detection des block"
block detect > /etc/config/fstab
echo "ecriture du montage SOLDIOM"
echo " " >> /etc/config/fstab
echo "##SOLIDOM external Mount" >> /etc/config/fstab
uci add fstab mount
uci set fstab.@mount[-1].target='/mnt/data'
uci set fstab.@mount[-1].device='/dev/mtdblock7'
uci set fstab.@mount[-1].label='userdata'
uci set fstab.@mount[-1].fstype='jffs2'
uci set fstab.@mount[-1].options='rw,noatime'
uci set fstab.@mount[-1].enabled='1'
uci commit fstab
else
echo "FSTAB already in config"
fi
exit 0
with this UCI commit, you are no erase data on SPI flash after a "firstboot & reboot" .
But, on first flash , the mount/detect finished before the "flash_eraseall". So, may be reboot ralink for good mount.