It seems that I have a lack of understanding how booting SD-Card images on devices like the Banana Pi work. The situation is as follows.
I have a Banana Pi and a Banana Pro. Every device has an image of some distribution on a SD card plugged into the device (Banana Pro -> Arch Linux, Banana Pi -> Bananian). The images can be downloaded from here and here. This works fine.
TFTP performance with U-Boot running under QEMU. Hello, I previously got the Buildroot generated Linux kernel and RFS running in a QEMU VM (ARM versatilepb), where the Linux kernel zImage is.
But since the Banana Pi / Pro has a SATA port, it would be nice if the root system could be booted from an attached Hard Drive. As can be read here this can be accomplished quite simple.
But now comes the part I'm struggling with. Flashing an entire 4GB SD card (or even larger ones) with the distributions image and using just a 50MB partition seems a bit wasteful. So I tried to use a smaller SD card.
I created a partiton with fdisk
(50MB size) and used mkfs.vfat -F 16 /dev/sdXX
to create the filesystem on the partiton. I made it FAT 16 because of the parted
output while examining the image file.
.
After that I mounted the partion from the image to /tmp/boot
with sudo mount -o loop,offset=1048576 ArchLinux_For_BananaPro_v1412.img /tmp/boot
. The offset value is the Start value in the parted output.
Copied the files (script.bin, uEnv.txt, uImage) to my SD card partition, changed the root path in uEnv.txt. Made a sync and dismounted the SD card.
Everything seems fine. Even when comparing the boot partitons on a SD card flashed with the entire image and my SD card with only the boot partiton, they are identical (according to fdisk
)
But the Banana Pi / Pro won't boot with the SD card with just a boot partition providing the u-boot files.
Has anyone a clue on that behaviour?
UPDATE:
Thanks to @BananaFreak I recognized my mistake. The bootloader was indeed missing but even after following that guide from lemaker the BananaPro does not boot. One weird thing on the lemaker wiki page is the first sentence stating:
Note: these instructions are for a Linux computer, not the Banana Pro/Pi!!
2 Answers
I think you've missed bootloader. U-Boot has to be present on your SD. Take a look at how the SD layout should be for the Banana Pi / Pro:
Jonathan KomarHere is my report on the deeper dives into the booting process on the BananaPro/Pi. First thing you'll need is a RS232 serial TTL UART converter to interface with the onboard UART.
Afterwards you can open that serial device to investigate the booting procedure (Be careful and leave the VCC pin of your TTL-UART converter unattached to the board. If your converter uses 5V TTL you could damage the BananaPro when conneting VCC to it.)
On the terminal I got output like this:
It's quite likely that you get dropped off in a kind of shell environment provided by u-boot after a failed boot procedure. From there you can use u-boot tools to perfrom some diagnostics. Here is a list of commands, though it may be possible not all of them are available.
In my case the last few lines of the boot-output led to the conclusion that u-boot is compiled in a way that it looks for the second partition and eventually builds a CRC over some data. Since my goal was to omit the second partition I guess the only solution is compiling a u-boot binary with the needed modifications.
Not the answer you're looking for? Browse other questions tagged linuxembeddedu-boot or ask your own question.
Actually i am trying to boot linux on mine Zedboard(having zync SoC with ARM cortex-A9 processor). But getting no success. Here i will share the story till now:-
1- I have done first partition of mine SD card and given it name Boot and i copied following things here:-
BOOT.bin
uEnv.txt
devicetree.dtb
uImage
uramdisk.image.gz
2- Now i am trying to boot it from SD card but it is not happening and i am getting the following message. In this message i have highlighted the error message specially along with other relevant message that i have got in mine tty terminal.
3- The content of mine uenv.txt file is as follows:-
4- I have created the ramdiskimage by following command:-
Upon execution of above command i got the following message:-
5- So Here is my printenv
list as requested in the comments:-
baudrate=115200
bitstream_image=system.bit.bin
boot_image=BOOT.bin
boot_size=0xF00000
bootcmd=run $modeboot
bootdelay=3
bootenv=uEnv.txt
devicetree_image=devicetree.dtb
devicetree_size=0x20000
ethact=Gem.e000b000
ethaddr=00:0a:35:00:01:22
fdt_high=0x20000000
importbootenv=echo Importing environment from SD ...; env import -t
${loadbootenv_addr} $filesize
initrd_high=0x20000000
ipaddr=10.10.70.102
jtagboot=echo TFTPing Linux to RAM... && tftpboot 0x3000000 ${kernel_image} && tftpboot 0x2A00000 ${devicetree_image} && tftpboot 0x2000000 ${ramdisk_image} && bootm 0x3000000 0x2000000 0x2A00000
kernel_image=uImage
kernel_size=0x500000
loadbit_addr=0x100000
loadbootenv=fatload mmc 0 ${loadbootenv_addr} ${bootenv}
loadbootenv_addr=0x2000000
mmc_loadbit_fat=echo Loading bitstream from SD/MMC/eMMC to RAM.. && mmcinfo && fatload mmc 0 ${loadbit_addr} ${bitstream_image} && fpga load 0 ${loadbit_addr} ${filesize}
modeboot=sdboot
nandboot=echo Copying Linux from NAND flash to RAM... && nand read 0x3000000 0x100000 ${kernel_size} && nand read 0x2A00000 0x600000 ${devicetree_size} && echo Copying ramdisk... && nand read 0x2000000 0x620000 ${ramdisk_size} && bootm 0x3000000 0x2000000 0x2A00000
norboot=echo Copying Linux from NOR flash to RAM... && cp.b 0xE2100000 0x3000000 ${kernel_size} && cp.b 0xE2600000 0x2A00000 ${devicetree_size} && echo Copying ramdisk... && cp.b 0xE2620000 0x2000000 ${ramdisk_size} && bootm 0x3000000 0x2000000 0x2A00000
qspiboot=echo Copying Linux from QSPI flash to RAM... && sf probe 0 0 0 && sf read 0x3000000 0x100000 ${kernel_size} && sf read 0x2A00000 0x600000 ${devicetree_size} && echo Copying ramdisk... && sf read 0x2000000 0x620000 ${ramdisk_size} && bootm 0x3000000 0x2000000 0x2A00000
ramdisk_image=uramdisk.image.gz
ramdisk_size=0x5E0000
rsa_jtagboot=echo TFTPing Image to RAM... && tftpboot 0x100000 ${boot_image} && zynqrsa 0x100000 && bootm 0x3000000 0x2000000 0x2A00000
rsa_nandboot=echo Copying Image from NAND flash to RAM... && nand read 0x100000 0x0 ${boot_size} && zynqrsa 0x100000 && bootm 0x3000000 0x2000000 0x2A00000
rsa_norboot=echo Copying Image from NOR flash to RAM... && cp.b 0xE2100000 0x100000 ${boot_size} && zynqrsa 0x100000 && bootm 0x3000000 0x2000000 0x2A00000
rsa_qspiboot=echo Copying Image from QSPI flash to RAM... && sf probe 0 0 0 && sf read 0x100000 0x0 ${boot_size} && zynqrsa 0x100000 && bootm 0x3000000 0x2000000 0x2A00000
rsa_sdboot=echo Copying Image from SD to RAM... && fatload mmc 0 0x100000 ${boot_image} && zynqrsa 0x100000 && bootm 0x3000000 0x2000000 0x2A00000
sdboot=if mmcinfo; then run uenvboot; echo Copying Linux from SD to RAM... && fatload mmc 0 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000
${devicetree_image} && fatload mmc 0 0x2000000 ${ramdisk_image} && bootm 0x3000000 0x2000000 0x2A00000; fi
serverip=10.10.70.101
stderr=serial
stdin=serial
stdout=serial
uenvboot=if run loadbootenv; then echo Loaded environment from ${bootenv}; run importbootenv; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd; fi
usbboot=if usb start; then run uenvboot; echo Copying Linux from USB to RAM... && fatload usb 0 0x3000000 ${kernel_image} && fatload usb 0 0x2A00000 ${devicetree_image} && fatload usb 0 0x2000000 ${ramdisk_image} && bootm 0x3000000 0x2000000 0x2A00000; fi
Environment size: 3368/131068 bytes
So based on mine above information please can u please tell/suggest me the solution of mine problem.
artless noise1 Answer
You have not passed a load address to mkimage. Try to add -a 0x2000000
parameter to it.Also -C gzip
parameter may be wrong because you take input file that is already compressed. Try to use -C none
instead.