U-Boot from ext2 formatted SD card fails.


shiny`

Still Fresh
Joined
Nov 5, 2008
Messages
4
I've recently received by Pandora (wooooooooo), and am getting down to do some hacking. I've cross-compiled myself a custom root image consisting of pretty much just busybox and a kernel for testing. I've created a u-boot script which looks like this:



Code:
setenv bootargs root=/dev/mmcblk0p1 rw rootdelay=2 vram=6272K omapfb.vram=0:3000K

ext2load mmc 0:1 0x80300000 /boot/uImage

bootm 0x80300000

(cribbed from here: http://neuvoo.org/wiki/index.php?title=Install_Pre-Built_Image)



I've formatted a 16GB SD card as ext2 and copied this root image onto it. When I boot from it on the Pandora I get:



Code:
ext2fs_devread() read error - block

whilst reading the kernel image. If I try with the SD card formatted as FAT32 (and use fatload) then it boots fine.


Looking around on the internet seems to indicate that it could be this issue: http://bugs.openpandora.org/index.php?do=details&task_id=192 which is marked as already fixed in November last year. I guess it is this commit: http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-u-boot.git;a=commit;h=d4741b75c6f7980c8cc5dec98e390e38a0e267f9. I guess this should be in the Zaxxon flash (which my Pandora is flashed with)? Or is it not? Is there a way to find the version of u-boot which is flashed on my Pandora? Also, is there a way to flash a newer version of just u-boot onto the NAND?
 
Looking around on the internet seems to indicate that it could be this issue: http://bugs.openpandora.org/index.php?do=details&task_id=192 which is marked as already fixed in November last year. I guess it is this commit: http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-u-boot.git;a=commit;h=d4741b75c6f7980c8cc5dec98e390e38a0e267f9. I guess this should be in the Zaxxon flash (which my Pandora is flashed with)? Or is it not? Is there a way to find the version of u-boot which is flashed on my Pandora? Also, is there a way to flash a newer version of just u-boot onto the NAND?
The commit you reference is quite old - but I think you need to apply HF4 regardless (maybe ED said it was now being flashed during assembly, not certain).


I do boot from an ext2 SD, with no problems, on a one-nub unit. My boot.txt is slightly different in its ext2load:



Code:
setenv bootargs debug root=/dev/mmcblk0p1 rw rootdelay=2 console=ttyS0,115200n8 vram=6272K omapfb.vram=0:3000K

ext2load mmc 0 0x80300000 /boot/uImage

bootm 0x80300000
 
The commit you reference is quite old - but I think you need to apply HF4 regardless (maybe ED said it was now being flashed during assembly, not certain).
Forgot to mention that I have applied HF4 and the codec pack. Not sure if hotfix installers update u-boot though (possibly only happens when full reflashing)? Have you done a full reflash at any point, or just applied the hot fixes?

I do boot from an ext2 SD, with no problems, on a one-nub unit. My boot.txt is slightly different in its ext2load:



Code:
setenv bootargs debug root=/dev/mmcblk0p1 rw rootdelay=2 console=ttyS0,115200n8 vram=6272K omapfb.vram=0:3000K

ext2load mmc 0 0x80300000 /boot/uImage

bootm 0x80300000

Hmm, I can't find any decent documentation about the exact meaning of the ext2load parameters, but I'm guessing that it will try to open the device rather than a partition - do you have a partition table on your SD Card? I guess you must have as the root is on /dev/mmcblk0p1.


I've worked around my issue by formatting the SD Card with two partitions, a 32M vfat and the rest as ext2. I'm putting just the kernel image on the vfat partition and using the ext2 partition as root. This seems to work fine, though it's not quite as neat.
 
ext2load doesn't support partitions in the version of uBoot installed on the Pandora. At least not properly. It's kind of flaky, can only read the first partition on the device. Just have a single partition and load the entire device (ext2load mmc 0 0x80300000 /boot/uImage) instead of trying to specify partition.


I believe they started with an old version which contained the bug. They could probably update, but that would require merging changes into the newer uBoot, but the bug isn't so bad that it's critical priority, I think.
 
ext2load doesn't support partitions in the version of uBoot installed on the Pandora. At least not properly. It's kind of flaky, can only read the first partition on the device. Just have a single partition and load the entire device (ext2load mmc 0 0x80300000 /boot/uImage) instead of trying to specify partition.


I believe they started with an old version which contained the bug. They could probably update, but that would require merging changes into the newer uBoot, but the bug isn't so bad that it's critical priority, I think.

I just tried with a single ext2 partition and "ext2load mmc 0 0x80300000 /boot/uImage" and it gives me exactly the same error; u-boot seems to still be loading from mmc 0:1:



Code:
Loading file "boot.txt" from mmc1 device 0:1 (xxa1)

138 bytes read

## Executing plain script at 82000000

Loading file "/boot/uImage" from mmc device 0:1 (xxa1)

 ** ext2fs_devread() read error - block

** Unable to read "/boot/uImage" from mmc 0:1 **

## Booting kernel from Legacy Image at 80300000 ...

<...kernel image info which I can't be bothered to type in...>

    Verifying Checksum ... Bad Data CRC

ERROR: Can't get kernel image!

script finished


I'll continue with my separate fat boot partition for now, but it would be nice to get a newer version of u-boot. Do you know the scale of the Pandora-specific changes? the distant earth blog article on the Pandora boot sequence says:

We have an OpenPandora specific U-Boot tree that we use to keep our platform specific patches in, most of our changes have long since gone into the mainline U-Boot trees.
but then later seems to indicate that the boot menu is still a custom thing.
 
It looks like you still have old u-boot, HF4 script is supposed to update that. Maybe you could run HF4 installer again and check /tmp/updater.log /tmp/updater_err.log when it's done. And yes the menu is custom thing, they don't allow custom menus in mainline.
 
Last edited by a moderator:
I had a similar error, which was something like



Code:
 ** ext2fs_devread() read outside partition sector

** Unable to read "/boot/uImage" from mmc 0:1 **

ERROR: Can't get kernel image!

script finished


It turns out the uImage symbolic link in my devos/boot folder (on my ext2 partition) was broken. I just copied over the actual uImage from the NAND, renamed it to whatever the uImage link was pointing to (something like uImage-x.xsomethingsomething) and it seems to be working fine.
 
I followed these instructions:


http://pandorawiki.org/Running_Linux_from_an_SD_card#Setting_up_mutliple-partition_SD_cards_for_booting


And I used this latest image:


http://openpandora.org/firmware/images/Angstrom-pandora-xfce-image-glibc-ipk-2010.4-test-20110622-omap3-pandora.ubifs.img.md5


On a SD Card partitioned into:


... Unassigned, 1MB (was suggested by GParted wizard, and I accepted this advice)


1) FAT32, 12GB, boot.txt resides here, with "root=/dev/mmcblk0p2" (left slot, partition 2)


2) EXT2, ~3GB, the whole OS is here including boot/, I tried it once as ext3 too, but the same error occured


... Unassigned, 512MB (for later swap use)


But the boot process always stops with this message:



Code:
reading boot.txt


169 bytes read

## Executing plain script at 82000000

script failed


Do I need to alter boot.txt so that it works with the newer images?


If so, I will update the wiki, as soon as you tell me that info. Thanks!
 
Seeing as your boot partition is the third one on the card, your boot.txt should look something like this:



Code:
setenv bootargs root=/dev/mmcblk0p3 rw rootdelay=2 vram=6272K omapfb.vram=0:3000K

ext2load mmc 0:3 0x80300000 /boot/uImage

bootm 0x80300000
 
Back
Top