AnsweredAssumed Answered

Why nor flashcan not storage the data

Question asked by xuhui li on Jul 8, 2016
Latest reply on Jul 10, 2016 by xuhui li

We had designed a custom board based on imx6qsabre-AI , but the nor flash storage the data , the code is

 

#ifdef CONFIG_MXC_SPI

iomux_v3_cfg_t const ecspi1_pads[] = {

    MX6_PAD_CSI0_DAT4__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL),

    MX6_PAD_CSI0_DAT5__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL),

    MX6_PAD_CSI0_DAT6__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL),

    MX6_PAD_CSI0_DAT7__GPIO5_IO25 | MUX_PAD_CTRL(NO_PAD_CTRL),

 

 

};

 

void setup_spinor(void)

{

    imx_iomux_v3_setup_multiple_pads(ecspi1_pads,

                     ARRAY_SIZE(ecspi1_pads));

        gpio_direction_output(IMX_GPIO_NR(5, 25), 0);

 

}

 

int board_spi_cs_gpio(unsigned bus, unsigned cs)

{

    return (bus == 0 && cs == 1) ? (IMX_GPIO_NR(5, 25)) : -1;

}

#endif

 

 

 

U-Boot 2015.04-14468-gd7d7c43-dirty (Jul 08 2016 - 14:38:47)

 

CPU:   Freescale i.MX6Q rev1.5 at 792 MHz

CPU:   Temperature 46 C

Reset cause: POR

Board: MX6Q-GWI-SCANNER revA

I2C:   ready

DRAM:  1 GiB

PMIC:  PFUZE100 ID=0x10

MMC:   FSL_SDHC: 0

SF: Detected M25P32 with page size 256 Bytes, erase size 64 KiB, total 4 MiB

In:    serial

Out:   serial

Err:   serial

Net:   FEC [PRIME]

Boot from USB for mfgtools

Use default environment for                              mfgtools

Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};

Hit any key to stop autoboot:  0

Bad Linux ARM zImage magic!

=> sf probe 1

SF: Detected M25P32 with page size 256 Bytes, erase size 64 KiB, total 4 MiB

=> setenv serverip 192.168.23.249

=> setenv ipaddr 192.168.23.111

=> setenv gatewayip 192.168.23.1

=> setenv netmask 255.255.255.0

=> saveenv

Saving Environment to SPI Flash...

SF: Detected M25P32 with page size 256 Bytes, erase size 64 KiB, total 4 MiB

Erasing SPI flash...Writing to SPI flash...done

=> print

baudrate=115200

boot_fdt=try

bootargs=console=ttymxc0,115200 rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber= enable_wait_mode=off

bootcmd=mmc dev ${mmcdev};if mmc rescan; then if run loadbootscript; then run bootscript;else else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi

bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};

bootdelay=1

bootscript=echo Running bootscript from mmc ...; source

console=ttymxc0

emmcdev=2

epdc_waveform=epdc_splash.bin

ethprime=FEC

fdt_addr=0x18000000

fdt_file=imx6q-gwi-scanner.dtb

fdt_high=0xffffffff

gatewayip=192.168.23.1

image=zImage

initrd_addr=0x12C00000

initrd_high=0xffffffff

ip_dyn=yes

ipaddr=192.168.23.111

loadaddr=0x12000000

loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};

loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}

loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}

mfgtool_args=setenv bootargs console=ttymxc0,115200 rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" enable_wait_mode=off

mmcargs=setenv bootargs console=${console},${baudrate} ${smp} root=${mmcroot}

mmcautodetect=yes

mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;

mmcdev=0

mmcpart=1

mmcroot=/dev/mmcblk3p2 rootwait rw

netargs=setenv bootargs console=${console},${baudrate} ${smp} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp

netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;

netmask=255.255.255.0

script=boot.scr

serverip=192.168.23.249

update_emmc_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; if ${get_cmd} ${update_sd_firmware_filename}; then if mmc dev ${emmcdev} 1; then setexpr fw_sz ${filesize} / 0x200; setexpr fw_sz ${fw_sz} + 1; mmc write ${loadaddr} 0x2 ${fw_sz}; fi; fi

update_sd_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; if mmc dev ${mmcdev}; then if ${get_cmd} ${update_sd_firmware_filename}; then setexpr fw_sz ${filesize} / 0x200; setexpr fw_sz ${fw_sz} + 1; mmc write ${loadaddr} 0x2 ${fw_sz}; fi; fi

 

Environment size: 3003/8188 bytes

=>

 

U-Boot 2015.04-14468-gd7d7c43-dirty (Jul 08 2016 - 14:38:47)

 

CPU:   Freescale i.MX6Q rev1.5 at 792 MHz

CPU:   Temperature 45 C

Reset cause: POR

Board: MX6Q-GWI-SCANNER revA

I2C:   ready

DRAM:  1 GiB

PMIC:  PFUZE100 ID=0x10

MMC:   FSL_SDHC: 0

SF: Detected M25P32 with page size 256 Bytes, erase size 64 KiB, total 4 MiB

In:    serial

Out:   serial

Err:   serial

Net:   FEC [PRIME]

Boot from USB for mfgtools

Use default environment for                              mfgtools

Run bootcmd_mfg: run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};

Hit any key to stop autoboot:  0

Bad Linux ARM zImage magic!

=> print

baudrate=115200

boot_fdt=try

bootargs=console=ttymxc0,115200 rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber= enable_wait_mode=off

bootcmd=mmc dev ${mmcdev};if mmc rescan; then if run loadbootscript; then run bootscript;else else if run loadimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi

bootcmd_mfg=run mfgtool_args;bootz ${loadaddr} ${initrd_addr} ${fdt_addr};

bootdelay=1

bootscript=echo Running bootscript from mmc ...; source

console=ttymxc0

emmcdev=2

epdc_waveform=epdc_splash.bin

ethprime=FEC

fdt_addr=0x18000000

fdt_file=imx6q-gwi-scanner.dtb

fdt_high=0xffffffff

image=zImage

initrd_addr=0x12C00000

initrd_high=0xffffffff

ip_dyn=yes

loadaddr=0x12000000

loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};

loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}

loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}

mfgtool_args=setenv bootargs console=ttymxc0,115200 rdinit=/linuxrc g_mass_storage.stall=0 g_mass_storage.removable=1 g_mass_storage.file=/fat g_mass_storage.ro=1 g_mass_storage.idVendor=0x066F g_mass_storage.idProduct=0x37FF g_mass_storage.iSerialNumber="" enable_wait_mode=off

mmcargs=setenv bootargs console=${console},${baudrate} ${smp} root=${mmcroot}

mmcautodetect=yes

mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;

mmcdev=0

mmcpart=1

mmcroot=/dev/mmcblk3p2 rootwait rw

netargs=setenv bootargs console=${console},${baudrate} ${smp} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp

netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${image}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;

script=boot.scr

update_emmc_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; if ${get_cmd} ${update_sd_firmware_filename}; then if mmc dev ${emmcdev} 1; then setexpr fw_sz ${filesize} / 0x200; setexpr fw_sz ${fw_sz} + 1; mmc write ${loadaddr} 0x2 ${fw_sz}; fi; fi

update_sd_firmware=if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; if mmc dev ${mmcdev}; then if ${get_cmd} ${update_sd_firmware_filename}; then setexpr fw_sz ${filesize} / 0x200; setexpr fw_sz ${fw_sz} + 1; mmc write ${loadaddr} 0x2 ${fw_sz}; fi; fi

 

Environment size: 2904/8188 bytes

=>

 

nor flash.png

Outcomes