Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 05 Jan 2006 09:08 AM by  coldfire@metacom.co.za
bad code flash
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages
hadi_dewan
New Member
New Member
Posts:


--
06 Oct 2005 08:32 AM
    Hi,
    I am using [/b]using MCF-547x coldfire eval board. I think I have bad code flash. I have erased the code flash several time. However I still get the same error during boot up. I follow the exact steps to download and burn linux on the code flash provided by logicPd linux Distribution.
    I can see Linux pick up the flash config fine. However duing bootup it complain about bad flash block. Following is my output. This is a brand new box. And I never used code flash before.. So I am not sure why this could happen

    losh>
    losh> add-yaffs flash nor 0xE0000000 0x01000000
    add-yaffs: inserted: start 0xe0000000 - len 0x1000000
    losh> mount yaffs /flash
    Mounting a YAFFS partition.

    ---------------------------------------------------
    Starting YAFFS file system:
    Current YAFFS partition table:
    0: flash 00000000 - 0000007f ( 0)
    1: <NULL>
    2: <NULL>
    3: <NULL>
    YAFFS initialized.
    ---------------------------------------------------

    losh> load elf /flash/boot/vmlinux
    loading from /flash/boot/vmlinux:
    ...............................................................................................................................
    warning: guessing combined program header size as 71600
    loaded 1252944 @ 0x000c0000 Ram
    md5sum of _loaded_ portion of the file:
    c0bf4c531797e0a7882d3367ca537901 - addr: 000c0000 len: 00131e50
    file loaded
    losh> exec
    Linux version 2.4.26 (sams@lpdlnx07) (gcc version 3.4.3) #1 Mon Aug 8 19:13:01 CDT 2005
    starting up linux rev 0.2: startmem 0xc022e000, size 61MB
    Flex CS0: ff800000 007f0001 00101180
    Flex CS1: e0000000 07ff0001 00101180
    Flex CS4: 40000000 0fff0001 00104580
    Flex CS5: 50000000 0fff0001 00101d80
    On node 0 totalpages: 8192
    zone(0): 1024 pages.
    zone(1): 7168 pages.
    zone(2): 0 pages.
    Kernel command line: root=/dev/mtdblock/2 rootfstype=yaffs rw
    Have no hardware time clock, returning ToD as 00:00:00 on 1 Jan 1970
    Calibrating delay loop... 263.78 BogoMIPS
    Memory: 62880k/65536k available (960k kernel code, 1640k data, 56k init)
    kmem_create: Forcing size word alignment - mm_struct
    kmem_create: Forcing size word alignment - filp
    Dentry cache hash table entries: 8192 (order: 3, 65536 bytes)
    Inode cache hash table entries: 4096 (order: 2, 32768 bytes)
    Mount cache hash table entries: 1024 (order: 0, 8192 bytes)
    kmem_create: Forcing size word alignment - bdev_cache
    kmem_create: Forcing size word alignment - cdev_cache
    kmem_create: Forcing size word alignment - kiobuf
    Buffer cache hash table entries: 2048 (order: 0, 8192 bytes)
    Page-cache hash table entries: 8192 (order: 2, 32768 bytes)
    POSIX conformance testing by UNIFIX
    Linux/m68k PCI BIOS32 revision 0.06
    ColdFire PCI Host Bridge (Rev. 0) detected
    PCI: Probing PCI hardware
    layout_bus: starting bus 0
    layout_bus: disable_dev for bus 0
    layout_bus: starting bus 0 devices
    layout_dev: bus 0 slot 0x1 VID 0x1131 DID 0x1561 class 0xc0310
    layout_dev: bus 0 slot 0x1 VID 0x1131 DID 0x1561 class 0xc0310
    layout_dev: bus 0 slot 0x1 VID 0x1131 DID 0x1562 class 0xc0320
    layout_dev: bus 0 slot 0x2 VID 0x126f DID 0x712 class 0x30000
    layout_dev: bus 0 slot 0x5 VID 0x126f DID 0x712 class 0x30000
    layout_bus: bus 0 finished
    Initialize Multi-channel DMA API Alpha v0.3 (2004-04-26)
    Linux NET4.0 for Linux 2.4
    Based upon Swansea University Computer Society NET3.039
    kmem_create: Forcing size word alignment - sock
    Initializing RT netlink socket
    Starting kswapd
    kmem_create: Forcing size word alignment - file_lock_cache
    devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
    devfs: boot_options: 0x1
    i2c-core.o: i2c core module version 2.6.1 (20010830)
    i2c-algo-mcf.o: I2C ColdFire algorithm module is loaded.
    pty: 256 Unix98 ptys configured
    ColdFire internal UART serial driver version 1.00
    ttyS0 at 0xe0008600 (irq = 99) is a builtin ColdFire UART
    ttyS1 at 0xe0008700 (irq = 98) is a builtin ColdFire UART
    ttyS2 at 0xe0008800 (irq = 97) is a builtin ColdFire UART
    ttyS3 at 0xe0008900 (irq = 96) is a builtin ColdFire UART
    tracek: ring buffer size: 64K
    rtc: RV5C387 RTC driver successfully loaded
    kmem_create: Forcing size word alignment - blkdev_requests
    FireEgine CompactFlash IDE driver
    Flex CS4: 40000000 0fff0001 00008580
    Flex CS5: 50000000 0fff0001 00003980
    fire_engine_cpld_init:97 hw revision 58
    fire_engine_cpld_init:109 cpld_programmed 0
    cfide_init:572 present 0
    RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
    loop: loaded (max 8 devices)
    IPsec over IPv4 tunneling driver
    ColdFire internal FEC driver version 0.11
    PPP generic driver version 2.4.2
    MCF547x/8x DSPI device driver installed
    Coldfire DSPI driver is loaded
    Flex CS0: ff800000 001f0001 00102180
    cfi_cmdset_0001: Erase suspend on write enabled
    Using word write method
    Creating 2 MTD partitions on "FireEngine BootFlash":0x00000000-0x000c0000 : "LoLo"
    0x000c0000-0x00200000 : "flash-boot"
    Flex CS1: f0000000 00ff0001 00102180
    cfi_cmdset_0001: Erase suspend on write enabled
    Using buffer write method
    Creating 1 MTD partitions on "FireEngine UserFlash":
    0x00000000-0x01000000 : "flash-user"
    Initializing Cryptographic API
    NET4: Linux TCP/IP 1.0 for NET4.0
    IP Protocols: ICMP, UDP, TCP, IGMP
    kmem_create: Forcing size word alignment - ip_dst_cache
    IP: routing cache hash table of 1024 buckets, 8Kbytes
    TCP: Hash tables configured (established 8192 bind 16384)
    ip_conntrack version 2.1 (512 buckets, 4096 max) - 148 bytes per conntrack
    ip_tables: (C) 2000-2002 Netfilter core team
    arp_tables: (C) 2002 David S. Miller
    NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
    VFS: Mounted root (yaffs filesystem).
    Mounted devfs on /dev
    starting: hwclock
    starting: proc
    starting: local-fs
    starting: flash-fs
    block 1 is bad
    block 2 is bad
    block 3 is bad
    block 4 is bad
    block 5 is bad
    block 6 is bad
    block 7 is bad
    block 8 is bad
    block 9 is bad
    block 10 is bad
    block 11 is bad
    block 12 is bad
    block 13 is bad
    block 14 is bad
    block 15 is bad
    block 16 is bad
    starting: BASE
    starting: syslogd
    sourcing: load-drivers
    sourcing: start-applications
    starting: network-settings
    Getting eth0 IP configuration via DHCP
    udhcpc (v0.9.9-pre) started
    Sending discover...
    Sending discover...
    Sending discover...
    No lease, failing.
    starting: irda
    Starting IrDA: 1.1 Tue Nov 9 15:30:55 1999 Dag Brattli

    starting: ip-settings
    starting: inetd
    starting: hotplug
    IrDA: Registered device irda0
    ** can't synthesize input events - /proc/bus/input/devices missing
    ** can't synthesize pci hotplug events
    usb.c: registered new driver hub
    usb.c: deregistering driver hub
    starting: devfsd
    devfsd v1.3.25 started for /dev
    starting: boas
    done

    localhost login: SysRq : HELP : loglevel0-8 reBoot tErm kIll showMem showPc unRaw Sync showTasks Unmount tlbs
    ot
    Password:
    Login incorrect
    localhost login: root
    Welcome to
    __ __ __ __
    / / ____ ____ /_/____ / / /_/____ __ ____ __
    / / / __ \/ __ \__ / __// / __ / __ \/ / / /\ \/ /
    / /___/ /_/ / /_/ / // /__/ /___/ // / / / /_/ / / /
    /_____/\____/\__ /_/ \___/_____/_//_/ /_/\____/ /_/\_\
    For further informaiton check:
    http://www.LogicPD.com
    [root@localhost root]# more /proc/mtd
    dev: size erasesize name
    mtd0: 000c0000 00010000 "LoLo"
    mtd1: 00140000 00010000 "flash-boot"
    mtd2: 01000000 00020000 "flash-user"
    [root@localhost root]# load elf /flash/boot/vmlinux
    sh: load: command not found
    [root@localhost root]#
    [root@localhost root]#
    peter.barada@logicpd.com
    New Member
    New Member
    Posts:72


    --
    06 Oct 2005 09:54 AM
    I think what may be happening is that the remainder of the code flash was not erased so YAFFS is finding trash in that section of hte flash and interpretting some of those bits to indicate that the block is bad.

    Try:

    losh> erase 0xff8c0000 0x140000
    losh> add-yaffs flash nor 0xE0000000 0x01000000
    losh> mount yaffs /flash
    losh> load elf /flash/boot/vmlinux
    losh> exec

    Which should erase the remainder of the code flash, then load the kernel and run.
    --
    Peter Barada
    peterb@logicpd.com
    paul@metacom.co.za
    New Member
    New Member
    Posts:


    --
    04 Jan 2006 09:25 AM
    I am getting the same problem but I cannot even start linux. When I then type exec nothing happens and losh hangs. The md5sum of vmlinux does also not match up. I managed to get linux compiled and working with romfs but on YAFFS it always gives this problem.

    Here is the output of losh:

    Quote:
    losh> ifconfig sm0 dhcp
    losh> erase 0xe0000000 0x01000000
    losh> erase 0xff8c0000 0x140000
    losh> load raw 0xe0000000 9306112 /tftp/192.168.2.38:yaffs-rootfs-m5475cfe-evb.i
    mg
    loading from /tftp/192.168.2.38:yaffs-rootfs-m5475cfe-evb.img:
    loading raw binary to 0xe0000000 (flash) len 008e0000:
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................ignoring rest of file...done
    md5sum of _loaded_ portion of the file:
    e4a426742d6d18ee1317eeb3ff69a6d1 - addr: 00200000 len: 008e0000
    file loaded to ram buffer, destined for flash addr: 0xe0000000
    losh> burn
    burning 9306112 bytes from 00200000 to /dev/flash1
    unlocking flash blocks
    erasing flash: 100%
    burning flash: 100%
    locking flash blocks
    burn good (9306112 bytes)
    losh> add-yaffs flash nor 0xe0000000 0x01000000
    add-yaffs: inserted: start 0xe0000000 - len 0x1000000
    losh> mount yaffs /flash
    Mounting a YAFFS partition.

    ---------------------------------------------------
    Starting YAFFS file system:
    Current YAFFS partition table:
    0: flash 00000000 - 0000007f ( 0)
    1: <NULL>
    2: <NULL>
    3: <NULL>
    YAFFS initialized.
    ---------------------------------------------------

    losh> load elf /flash/boot/vmlinux
    loading from /flash/boot/vmlinux:
    ................................................................................
    ..............................................................
    warning: guessing combined program header size as 62448
    loaded 1139212 @ 0x000c0000 Ram
    md5sum of _loaded_ portion of the file:
    05592861315b2d5c6f2d6fc87a69a0e1 - addr: 000c0000 len: 0011620c
    file loaded

    losh> ls /flash
    : linuxrc 11
    D : root 512
    D : sbin 512
    D : proc 512
    D : home 512
    D : boot 512
    D : www 512
    D : usr 512
    D : var 512
    : tmp 8
    D : mnt 512
    D : lib 512
    D : etc 512
    D : dev 512
    D : bin 512
    D : lost-found 512
    losh> cd /flash/boot
    losh> ls
    : vmlinux 1160856
    losh>
    losh> exec
    (hanging)


    Below is some extra information on the memory:
    installed sdram: 67108864
    DMA task memory start: 0x10010000
    DMA task memory end: 0x1001191c
    LoLo start address: 0x00000000
    LoLo end address: 0x000bffff

    Configuration of /dev/flash0:
    Bus width: 16 bits
    Total Chips: 1
    Base Address: 0xff800000
    End Address: 0xff9fffff
    Total Length: 2097152 bytes
    Buffer Size: 0 bytes
    Block[0] qty=8 size=0x2000 end_addr=0xffff
    Block[1] qty=31 size=0x10000 end_addr=0x1fffff

    Configuration of /dev/flash1:
    Bus width: 16 bits
    Total Chips: 1
    Base Address: 0xe0000000
    End Address: 0xe0ffffff
    Total Length: 16777216 bytes
    Buffer Size: 64 bytes
    Block[0] qty=128 size=0x20000 end_addr=0xffffff

    SRAM_0 start address: 0x10010000
    SRAM_0 end address: 0x10017fff
    SRAM_1 start address: 0x20000000
    SRAM_1 end address: 0x20000fff
    SRAM_2 start address: 0x20001000
    SRAM_2 end address: 0x20001fff

    heap statistics:
    avail: 501752
    used : 137000
    free : 364752
    max : 139864
    err : 0
    peter.barada@logicpd.com
    New Member
    New Member
    Posts:72


    --
    04 Jan 2006 12:13 PM
    >I am getting the same problem but I cannot even start linux. When I then type exec nothing
    > happens and losh hangs. The md5sum of vmlinux does also not match up. I managed to
    > get linux compiled and working with romfs but on YAFFS it always gives this problem.

    your exec command is trying to exec the YAFFS file system you loaded. Try:

    losh> add-yaffs flash nor 0xe0000000 0x01000000
    losh> load /flash/boot/vmlinux
    losh> exec

    to load/exec the *kernel* thats in the YAFFS partition...
    coldfire@metacom.co.za
    New Member
    New Member
    Posts:


    --
    05 Jan 2006 09:08 AM
    Hi,

    All the commands were executed.

    I have also posted a new topic under the linux forum.
    "linux not starting on Coldfire M5475EVB"

    Is there anything else I could try?

    kind regards,

    Jurgen
    You are not authorized to post a reply.