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.

AM3352: UBI PART command fails for NAND flash

Part Number: AM3352


Hi Team,

Observing failure with following command 

ubi part nand0,0 2048;

Processor results in continuous reset with following log

_____________________________________________________________________________________

U-Boot SPL 2016.05-rc3 (Oct 20 2016 - 17:30:33)
Trying to boot from SPI


U-Boot 2016.05-rc3 (Oct 20 2016 - 17:30:33 +0530)

Watchdog enabled
DRAM: 256 MiB
NAND: 256 MiB
SF: Detected S25FL164K with page size 256 Bytes, erase size 64 KiB, total 8 MiB
Press SPACE to abort autoboot in 0 seconds
Booting from nand ...
data abort
pc : [<8ffb7812>] lr : [<8ffb6b79>]
reloc pc : [<8081e812>] lr : [<8081db79>]
sp : 8ef88740 ip : 00000000 fp : 00000028
r10: 0001f000 r9 : 8ef88ee0 r8 : 00000000
r7 : 000000dc r6 : 0001f000 r5 : 8ef90400 r4 : 8f03a940
r3 : 00000000 r2 : 000000da r1 : 8ef90678 r0 : 00000000
Flags: nZCv IRQs off FIQs on Mode SVC_32
Resetting CPU ...

resetting ...

_____________________________________________________________________________________

Environment is currently set to -

_____________________________________________________________________________________

=> print
alt2bootcmd=echo BOOTFAILED....; gpio set 46;
altbootcmd=echo booting from recovery images...; run setrecoveryboot; setenv bootfile ${altbootfile}
altbootfile=recovery/zImage
altfdtfile=recovery/beanbag-gateway-am3352.dtb
arch=arm
baudrate=115200
board=beanbag
board_name=beanbag
boot_targets=nand
bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
bootcmd_flasher=echo Booting from TFTP over USB RNDIS ...; setenv autoload no; setenv ethact usb_eth000; fi;
bootcmd_nand=echo Booting from nand ...; run nandargs; dcache on; ubi part nand0,0 2048; ubifsmount t; then bootz ${loadaddr} - ${fdtaddr};else echo WARN: Failed to load boot/${fdtfile}; fi; else echod;
bootcount=1
bootdelay=0
bootfailed=mw 0x44E3E064 0x010002b0; reset;
bootfile=zImage
bootlimit=3
bootm_size=0x10000000
console=ttyO0,115200n8
cpu=armv7
fdt_addr_r=0x88000000
fdtaddr=0x88000000
fdtfile=beanbag-gateway-am3352.dtb
kernel_addr_r=0x82000000
loadaddr=0x82000000
loadfdt=ubifsload ${fdtaddr} boot/${fdtfile}
loadimage=ubifsload ${loadaddr} boot/${bootfile}
mtddevname=NAND.file-system
mtddevnum=0
mtdids=nand0=nand.0
mtdparts=mtdparts=nand.0:-(NAND.file-system)
nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
nandroot=ubi0:beanbag-rootfs rw ubi.mtd=NAND.file-system,2048
nandrootfstype=ubifs rootwait=1
optargs=quiet
partition=nand0,0
pxefile_addr_r=0x80100000
ramdisk_addr_r=0x88080000
rdaddr=0x88080000
scriptaddr=0x80000000
setrecoveryboot=mw 0x44E3E064 0x000102b0;
soc=am33xx
stderr=ns16550_serial
stdin=ns16550_serial
stdout=ns16550_serial
vendor=secure
ver=U-Boot 2016.05-rc3 (Oct 20 2016 - 17:30:33 +0530)

Environment size: 1967/65531 bytes

_____________________________________________________________________________________

Any pointers to debug further?

  • Hello Mukesh,

    The U-Boot version you use is outdated 2016.05 release candidate 3, if you update to the latest U-Boot version and add these defined below to the <Processor SDK>/board-support/u-boot-<version>/include/configs/am335x_evm.h file, the ubi part command will work.

    /* UBI Support */
    #ifndef CONFIG_SPL_BUILD
    #define CONFIG_MTD_PARTITIONS
    #define CONFIG_CMD_UBI
    #define CONFIG_MTD_UBI_WL_THRESHOLD 4096
    #define CONFIG_MTD_UBI_BEB_LIMIT 20
    #define CONFIG_RBTREE
    #define CONFIG_CMD_UBIFS
    #define CONFIG_MTD_DEVICE
    #endif

    Best regards,
    Kemal

  • Hi Kemal,

    The above command seems to be working on one board while failing on another. So please elaborate why above marked changes are required/will work fine with latest U-boot?

    Thanks
    Mukesh
  • Can you post the log from working board to prove that is working?

  • _____________________________________________________________________________________

    =>
    U-Boot SPL 2016.05-rc3 (May 06 2019 - 06:08:04)
    Trying to boot from SPI


    U-Boot 2016.05-rc3 (May 06 2019 - 06:08:04 -0700)

    Watchdog enabled
    DRAM: 256 MiB
    NAND: 256 MiB
    SF: Detected S25FL164K with page size 256 Bytes, erase size 64 KiB, total 8 MiB
    Press SPACE to abort autoboot in 0 seconds
    Booting from nand ...
    Loading file 'boot/zImage' to addr 0x82000000...
    Done
    Loading file 'boot/beanbag-gateway-am3352.dtb' to addr 0x88000000...
    Done
    Kernel image @ 0x82000000 [ 0x000000 - 0x2cb300 ]
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8ef7b000, end 8ef85a0e ... OK

    Starting kernel ...

    [ 1.589402] omap-sham 53100000.sham: initialization failed.
    [ 1.625846] omap_voltage_late_init: Voltage driver support not added
    INIT: version 2.88 booting
    Starting udev
    INIT: Entering runlevel: 5
    Configuring network interfaces... Configuration file: /etc/hostapd.conf
    wlan1: interface state UNINITIALIZED->COUNTRY_UPDATE
    done.
    Starting system message bus: dbus.
    Starting OpenBSD Secure Shell server: sshd
    Could not load host key: /etc/ssh/ssh_host_dsa_key
    Could not load host key: /etc/ssh/ssh_host_ecdsa_key
    Could not load host key: /etc/ssh/ssh_host_ed25519_key
    done.
    Starting watchdog: [ OK ]
    Starting syslogd/klogd: done
    * Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
    ...done.
    Mfg mode is active,starting mfg process
    Starting beanbag mfg process
    Loading serial driver for mfg process
    Process not running
    Exit status of mfg server is 0

    Poky (Yocto Project Reference Distro) 2.0.2 beanbag /dev/ttyO0

    beanbag login:

    _____________________________________________________________________________________

  • If this command was working before and this start to happen lately, you may have uncorrectable ECC errors or bad blocks on that NAND which can cause this data abort.

    Try erasing and reflashing the whole chip.

    => nand erase.chip

    If you are doing board bring up, the wrong timings or configuration register values may lead to this data abort, just like happened in this thread.

  • Hello Mukesh,

    Have you got any other clues on this issue?

    Best regards,
    Kemal