5

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.

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.

enter image description here.

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)

enter image description here

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!!

1
  • gitbook.com/@bananapi banana pi online documents for BPI-M1,BPI-M1+,BPI-M2,BPI-M2+,BPI-M3
    – user169503
    May 9, 2016 at 7:30

2 Answers 2

3

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:

http://wiki.lemaker.org/BananaPro/Pi:Setting_up_the_bootable_SD_card#SD_Card_Layout

2
  • 1
    Ah ok, seems logic. I thought the bootloader will also be copied on the sd-card when using dd but it's not part of the 1st partition and therefore needs to be installed separately. I'll try that as soon as possible. Thx
    – IlikePepsi
    Jul 24, 2015 at 7:45
  • Today I made some deeper dives into the booting process on the BananaPro and I guess it's an issue how u-boot (the bootloader) was compiled. I guess for what I tried to achieve a recompilation of u-boot would be necessary. Though I will mark your answer as the correct one.
    – IlikePepsi
    Jul 28, 2015 at 15:54
0

Here 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.

BananaPro UART interface header

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:

 U-Boot SPL 2014.04-10733-gbb5691c (Dec 18 2014 - 12:54:35)

 Board: BananaPro
 DRAM: 1024 MiB
 CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
 spl: not an uImage at 1600

 U-Boot 2014.04-10733-gbb5691c (Dec 18 2014 - 12:54:35) Allwinner Technology

 CPU:   Allwinner A20 (SUN7I)
 Board: BananaPro
 I2C:   ready
 DRAM:  1 GiB
 MMC:   SUNXI SD/MMC: 0
 *** Warning - bad CRC, using default environment

 In:    serial
 Out:   serial
 Err:   serial
 Net:   dwmac.1c50000
 Hit any key to stop autoboot:  0 
 reading uEnv.txt
 354 bytes read in 17 ms (19.5 KiB/s)
 Loaded environment from uEnv.txt
 Running uenvcmd ...
 reading /script.bin
 50564 bytes read in 100 ms (493.2 KiB/s)
 reading /uImage
 Error reading cluster
 ** Unable to read file /uImage **
 ## Booting kernel from Legacy Image at 48000000 ...
   Image Name:   Linux-3.4.103
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4822880 Bytes = 4.6 MiB
   Load Address: 40008000
   Entry Point:  40008000
   Verifying Checksum ... Bad Data CRC
 ERROR: can't get kernel image!
 ** Can't read partition table on 0:0 **
 ** Invalid partition 1 **

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.

1
  • 1
    I have a Lamobo R1...cutting the story short. When it comes to Linux Sinovoip/Lemaker make a minimum effort. I tried Bananian and it was crap. Use Armbian, it is so much better and they have been making a serious effort solving most of the problems. armbian.com/banana-pi-pro Mar 29, 2016 at 13:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .