Is it possible to replace AT91Bootstrap (on the DataFlash) from Linux user space?
This is what my target system (AT91SAM9263-EK, busybox, manual /dev nodes) tells me about MTD:
# cat /proc/mtd
dev: size erasesize name
mtd0: 04000000 00020000 "Partition 1"
mtd1: 0c000000 00020000 "Partition 2"
mtd2: 00840000 00000420 "spi0.0-AT45DB642x"
# ls -l /dev/mtd2
crw-r--r-- 1 root root 90, 4 Feb 19 2008 /dev/mtd2
# mtd_debug info /dev/mtd2
mtd.type = (unknown type - new MTD API maybe?)
mtd.flags =
mtd.size = 8650752 (8M)
mtd.erasesize = 1056 (1K)
mtd.oobblock = 1056 (1K)
mtd.oobsize = 0
mtd.ecctype = (unknown ECC type - new MTD API maybe?)
regions = 0
I have tried using:
# mtd_debug write /dev/mtd2 0 4120 /home/dataflash_at91sam9263ek.bin
Copied 4120 bytes from /home/dataflash_at91sam9263ek.bin to address 0x00000000 in flash
But AT91Bootstrap is not functional after that, I need to flash it manually using the SAM-BA tool. Flashing the exact same .bin image with this method works. And by the way, the .bin file size is 4120 byte:
# ls /home/dataflash_at91sam9263ek.bin -l
-rw-r--r-- 1 500 500 4120 Feb 19 2008 /home/dataflash_at91sam9263ek.bin
Another approach:
# flash_info /dev/mtd2
Device /dev/mtd2 has 0 erase regions
# flashcp -v /dev/mtd2 /home/dataflash_at91sam9263ek.bin
This doesn't seem to be a valid MTD flash device!
Anyone has a suggestion..?
Thanks a lot,
Carlos
Writing to DataFlash from linux
Moderator: nferre
Post
Re: Writing to DataFlash from linux
Same problem:
root@sama5d3xek:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00020000 "bootstrap"
mtd1: 00080000 00020000 "uboot"
mtd2: 00040000 00020000 "env"
mtd3: 00040000 00020000 "env_redundant"
mtd4: 00040000 00020000 "spare"
mtd5: 00080000 00020000 "dtb"
mtd6: 00600000 00020000 "kernel"
mtd7: 0f800000 00020000 "rootfs"
mtd8: 00400000 00001000 "spi32766.0"
root@sama5d3xek:~# mtd_debug info /dev/mtd8
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 4194304 (4M)
mtd.erasesize = 4096 (4K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 0
Any idea to solve that?
root@sama5d3xek:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00020000 "bootstrap"
mtd1: 00080000 00020000 "uboot"
mtd2: 00040000 00020000 "env"
mtd3: 00040000 00020000 "env_redundant"
mtd4: 00040000 00020000 "spare"
mtd5: 00080000 00020000 "dtb"
mtd6: 00600000 00020000 "kernel"
mtd7: 0f800000 00020000 "rootfs"
mtd8: 00400000 00001000 "spi32766.0"
root@sama5d3xek:~# mtd_debug info /dev/mtd8
mtd.type = MTD_NORFLASH
mtd.flags = MTD_CAP_NORFLASH
mtd.size = 4194304 (4M)
mtd.erasesize = 4096 (4K)
mtd.writesize = 1
mtd.oobsize = 0
regions = 0
Any idea to solve that?
- blue_z
- Location: USA
Post
Older versions of AT91Bootstrap (certainly one circa 2008) did not build with an ARM Exception vector suitable for RomBOOT.
Specifically the length value in the sixth word was missing. Refer to the Atmel datasheets (the boot strategy section) for more detail.
All you had to do was read this image from flash (using the complementary operation that you used in Linux userspace), and then compare it with the original image.
Then you'd realize that the SAM-BA utility had modified the vector.
Regards
Re: Writing to DataFlash from linux
Yes, assuming that you have a properly configured system.vranckenc wrote:Is it possible to replace AT91Bootstrap (on the DataFlash) from Linux user space?
Older versions of AT91Bootstrap (certainly one circa 2008) did not build with an ARM Exception vector suitable for RomBOOT.
Specifically the length value in the sixth word was missing. Refer to the Atmel datasheets (the boot strategy section) for more detail.
That provides a clue to the solution.vranckenc wrote:I need to flash it manually using the SAM-BA tool. Flashing the exact same .bin image with this method works.
All you had to do was read this image from flash (using the complementary operation that you used in Linux userspace), and then compare it with the original image.
Then you'd realize that the SAM-BA utility had modified the vector.
Regards
Who is online
Users browsing this forum: No registered users and 3 guests