2008-12-11 06:05:20 Memory erase on CM-BF537E
Patrick Hotz (GERMANY)
Message: 66628
Hi,
im using the CM-BF537 board which uses PF4 to access the upper 2Mb of the 4Mb flash.
My problem is that i cant use "flashw" or "eraseall"....
root:/> cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00020000 "U-Boot"
mtd1: 000c0000 00020000 "JFFS2"
mtd2: 00300000 00020000 "uClinux"
mtd3: 00a00000 00001000 "ROMfs"
root:/> eraseall /dev/mtd2
Erasing 128 Kibyte @ 100000 -- 33 % complete.physmap-flash.0: Waiting for chip t
o be ready timed out. Status 0
eraseall: /dev/mtd2: MTD Erase failure: Input/output error
Erasing 128 Kibyte @ 120000 -- 37 % complete.physmap-flash.0: Waiting for chip t
o be ready timed out. Status 0
eraseall: /dev/mtd2: MTD Erase failure: Input/output error
Erasing 128 Kibyte @ 140000 -- 41 % complete.physmap-flash.0: Waiting for chip t
o be ready timed out. Status 0
eraseall: /dev/mtd2: MTD Erase failure: Input/output error
Erasing 128 Kibyte @ 160000 -- 45 % complete.physmap-flash.0: Waiting for chip t
o be ready timed out. Status 0
eraseall: /dev/mtd2: MTD Erase failure: Input/output error
Erasing 128 Kibyte @ 180000 -- 50 % complete.physmap-flash.0: Waiting for chip t
o be ready timed out. Status 0
eraseall: /dev/mtd2: MTD Erase failure: Input/output error
Erasing 128 Kibyte @ 1a0000 -- 54 % complete.physmap-flash.0: Waiting for chip t
o be ready timed out. Status 0
eraseall: /dev/mtd2: MTD Erase failure: Input/output error
Erasing 128 Kibyte @ 1c0000 -- 58 % complete.physmap-flash.0: Waiting for chip t
o be ready timed out. Status 0
eraseall: /dev/mtd2: MTD Erase failure: Input/output error
Erasing 128 Kibyte @ 1e0000 -- 62 % complete.physmap-flash.0: Waiting for chip t
o be ready timed out. Status 0
eraseall: /dev/mtd2: MTD Erase failure: Input/output error
Erased 3072 Kibyte @ 0 -- 100% complete.
root:/> flashw -u /media/uimage.ext /dev/mtd2
physmap-flash.0: block unlock error: (status timeout)
I think the problem is the PF4 but i have no idea to get the programms running.
Is it possible to get a patch or someting that i can use the programms?
I want to write a programm which updates my uClinux....
Thanks,
Patrick
TranslateQuoteReplyEditDelete
2008-12-11 15:20:30 Re: Memory erase on CM-BF537E
Mike Frysinger (UNITED STATES)
Message: 66643
what version of things are you using exactly ? the 2008R1.5 release and older did not include a driver for the parallel flash. a real driver for it was added to trunk ...
QuoteReplyEditDelete
2008-12-11 16:07:48 Re: Memory erase on CM-BF537E
Patrick Hotz (GERMANY)
Message: 66645
Hi Mike,
i am using the 2008R1.5 dist.
Is there a possibility to patch the 2008R1.5 or change some files in this distro?
I don´t want to use the trunk-version because we need a system which is stable....
Patrick
TranslateQuoteReplyEditDelete
2008-12-11 16:40:02 Re: Memory erase on CM-BF537E
Mike Frysinger (UNITED STATES)
Message: 66647
the driver should be easy to use in 2008R1.5. just copy it over. see drivers/mtd/maps/gpio-addr-flash.c in trunk (as well as adding it to the local Makefile/Kconfig).
QuoteReplyEditDelete
2008-12-12 08:08:14 Re: Memory erase on CM-BF537E
Patrick Hotz (GERMANY)
Message: 66662
Hi Mike,
just copy the gpio-addr-flash.c and adding it to the local Makefile/Config seems to be not so very easy....
The dist leaves making with lots of errors like this:
..gpio-addr-flash.c: In Funktion gpio_flash_probe:
..gpio-addr-flash.c: 135: Error: expected "=", ",", ";", "asm" or "__atttribute__" before "char"
..gpio-addr-flash.c: 144: Error: expected "=", ",", ";", "asm" or "__atttribute__" before "char"
..gpio-addr-flash.c: 156: Error: expected "=", ",", ";", "asm" or "__atttribute__" before "char"
..gpio-addr-flash.c: 161: Error: expected "=", ",", ";", "asm" or "__atttribute__" before "char"
..gpio-addr-flash.c: 167: Error: expected "=", ",", ";", "asm" or "__atttribute__" before "char"
do you have any idea to get the dist running?
Patrick
TranslateQuoteReplyEditDelete
2008-12-12 15:15:31 Re: Memory erase on CM-BF537E
Mike Frysinger (UNITED STATES)
Message: 66668
you probably need to edit the driver and remove __devinitconst from pr_devinit()
QuoteReplyEditDelete
2008-12-15 10:26:51 Re: Memory erase on CM-BF537E
Patrick Hotz (GERMANY)
Message: 66715
Hi Mike,
after days of headache and lots of work i think the best way is to patch the 2008R1.5 with the 2007R1 drivers.
There is a patch for the 2007R1 but i cant copy the total "mtd" folder into the 2008R1.5. There are a lots of errors.....
I attach the files from the 2007R1 and hope somebody can help me to get the new dist running with this file.
I have no idea what i can do with this files...
Patrick
cfi_cmdset_0001_2007R1.c
cfi_cmdset_0001_2008R1.5.c
TranslateQuoteReplyEditDelete
2008-12-15 13:13:15 Re: Memory erase on CM-BF537E
Mike Frysinger (UNITED STATES)
Message: 66718
i dont know what patch you're talking about or why you're touching cfi_cmdset
QuoteReplyEditDelete
2008-12-15 13:36:23 Re: Memory erase on CM-BF537E
Patrick Hotz (GERMANY)
Message: 66721
Excuse me Mike,
the patch that i use is a modified cfi_cmdset file that i have downloaded on the "Bluetechnix project" (http://blackfin.uclinux.org/gf/project/bluetechnix/frs/).
The modified file is working correctly on uClinux-dist2007R1 so i think this file uses the PF4 I/O to access the upper 2Mb of flash. But i cant use this file with the uClinux-dist2008R1.5
TranslateQuoteReplyEditDelete
2008-12-15 13:43:07 Re: Memory erase on CM-BF537E
Mike Frysinger (UNITED STATES)
Message: 66722
none of those patches are supported. you can either figure it out (you might want to look at the vendors/Bluetechnix/patches/ dir in the 2008R1.5 release), or you can use the gpio flash map file i pointed you to already.
QuoteReplyEditDelete
2008-12-16 09:54:26 Re: Memory erase on CM-BF537E
Patrick Hotz (GERMANY)
Message: 66759
Thank you for your help Mike,
now i have modified the cfi_cmdset_0001.c to access the full 4Mb of flash.
I read the address and set the GPIOs based on crossing 0x200000....
Its not the best way but it works...
Greetings,
Patrick
TranslateQuoteReplyEditDelete
2009-02-06 14:24:36 Re: Memory erase on CM-BF537E
Tim Shearer (UNITED STATES)
Message: 69005
Hi there, Blackfin n00b here.
I was wondering if you ever successfully reflashed the kernel image on the CM-BF537E?
I'm using 2008R1.5. I modified the cfi_cmdset_0001.c, basing the bank switching scheme on the Bluetechnix patch used on the 2007 release. I can now successfully read from, erase, and write small files to the /dev/mdt2 partition.
However, when writing a larger image, such as a kernel image, it falls over. Incidentally, I'm either using redirection or cp to copy the data to the partition, since nandwrite doesn't work (unknown device) and flashw won't compile.
TEST221:>eraseall /dev/mtd2
Erased 3072 Kibyte @ 0 -- 100% complete.
TEST221:>cat /mnt/mmc/uIrf > /dev/mtd2
physmap-flash.0: buffer write error (bad VPP)
cat: write error: Input/output error
From analysing the data, it isn't writing anything to mtd2 after address 0x00FFFFF. Which indicates that all isn't well with the gpio switching.
So how come I can read and erase files > 0x0FFFFF in size, yet I can't write?
Thanks in advance,
Tim
QuoteReplyEditDelete
2009-02-06 14:31:37 Re: Memory erase on CM-BF537E
Mike Frysinger (UNITED STATES)
Message: 69008
it doesnt make any sense to use nandwrite. this isnt a nand device.
/dev/mtd# is not directly writable. it is the interface to the device for erasing/etc... if you want to write directly with cat, then use mtdblock#.
QuoteReplyEditDelete
2009-02-09 09:42:34 Re: Memory erase on CM-BF537E
Tim Shearer (UNITED STATES)
Message: 69125
Hi Mike, it works now. I manually inserted bank switching gpio to cfi_cmdset_001.c.
Also, when copying the data contents from the SD card to mtdblock 2, I use dd and copy in 1024 byte blocks.
It works great, it's really helpful to bea able to update the kernel and bootloader at runtime.
Thanks,
Tim