Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

problem with using flash driver!!!

hello!

I am using Nios II Linux v1.4, my development board is customized, it use 4M flash at address 0x0, 8M sdram at address 0x800000, my kernel can boot from flash when reset.

i can operate (just erase , write and read) my flash with direct access physical address, using the command list in the flash datasheet.

but i want to using flash as a MTD device, so i followed the step in this page

http://nioswiki.jot.com/wikihome/operating...flashprogrammer (http://nioswiki.jot.com/wikihome/operatingsystems/flashprogrammer)

when i mount –t jffs2 /dev/mtdblock0 /mnt to mount my flash device, it printed as below:

# mount -t jffs2 /dev/mtdblock0 /mnt# Erase at 0x003e0000 failed immediately: errno -5

Erase at 0x003c0000 failed immediately: errno -5

Erase at 0x003a0000 failed immediately: errno -5

Erase at 0x00380000 failed immediately: errno -5

Erase at 0x00360000 failed immediately: errno -5

Erase at 0x00340000 failed immediately: errno -5

Erase at 0x00320000 failed immediately: errno -5

Erase at 0x00300000 failed immediately: errno -5

Erase at 0x002e0000 failed immediately: errno -5

Erase at 0x002c0000 failed immediately: errno -5

Erase at 0x002a0000 failed immediately: errno -5

Erase at 0x00280000 failed immediately: errno -5

Erase at 0x00260000 failed immediately: errno -5

Erase at 0x00240000 failed immediately: errno -5

Erase at 0x00220000 failed immediately: errno -5

Erase at 0x00200000 failed immediately: errno -5

Erase at 0x001e0000 failed immediately: errno -5

Erase at 0x001c0000 failed immediately: errno -5

Erase at 0x001a0000 failed immediately: errno -5

Erase at 0x00180000 failed immediately: errno -5

Erase at 0x00160000 failed immediately: errno -5

Erase at 0x00140000 failed immediately: errno -5

Erase at 0x00120000 failed immediately: errno -5

Erase at 0x00100000 failed immediately: errno -5

Erase at 0x000e0000 failed immediately: errno -5

Erase at 0x000c0000 failed immediately: errno -5

Erase at 0x000a0000 failed immediately: errno -5

Erase at 0x00080000 failed immediately: errno -5

Erase at 0x00060000 failed immediately: errno -5

Erase at 0x00040000 failed immediately: errno -5

Erase at 0x00020000 failed immediately: errno -5

Erase at 0x003f0000 failed immediately: errno -5</span>

this is my kernel booting information:

Altera NDK flash (AMD): Found 1 x16 devices at 0x0 in 16-bit bank

Amd/Fujitsu Extended Query Table at 0x0040

number of CFI chips: 1

cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.

cmdlinepart partition parsing not available

RedBoot partition parsing not available

Using Altera NDK partition definition

Creating 4 MTD partitions on "Altera NDK flash (AMD)":

0x00000000-0x00391000 : "jffs2"

mtd: Giving out device 0 to jffs2

0x00391000-0x003b6000 : "loader/kernel"

mtd: partition "loader/kernel" doesn&#39;t start on an erase block boundary -- force read-only

mtd: Giving out device 1 to loader/kernel

0x003b6000-0x003db000 : "User configuration"

mtd: partition "User configuration" doesn&#39;t start on an erase block boundary -- force read-only

mtd: Giving out device 2 to User configuration

0x003db000-0x00400000 : "safe configuration"

mtd: partition "safe configuration" doesn&#39;t start on an erase block boundary -- force read-only

mtd: Giving out device 3 to safe configuration

Freeing unused kernel memory: 512k freed (0x910000 - 0x98f000)

init started: BusyBox v1.1.1-pre0 (2006.05.22-08:25+0000) multi-call binary

i have changed my altera.c

what&#39;s the problem?

also, i have another problem when i add MTD supporting in the uClinux-dist, i selected the MTD erase, erase-all, mkfs.jffs2, and flashw, but when i typed make subdirs , it printed "can&#39;t find a header file" when making mkfs.jffs2, i have forgot the file name.

i am using uClinux-dist-test-1209, if i changed a uClinux-dist version ,can this problem be solved?

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    when compling mkfs.jffs2 in the /uClinux-dist-test/user/mtd-utils directory, it printed:

    compr_zlib.c:38:18: zlib.h: No such file or directory

    when i manully changed " include "zlib.h" " to " include "../../include/zlib.h" ", it still has some problems

    this is my menuconfig settings in the uClinux-dist-test

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    flash tools---->

    --- MTD utils

    [*] mtd-utils

    [*] erase

    [*] eraseall

    [ ] ftl_check

    [ ] ftl_format

    [ ] mkfs.jffs

    [*] mkfs.jff2 [/b]

    --- Quote End ---

    how can i solve this problem, who can help me ?