Newbie questions

To boot a Raspberry-Pi we need only to write the system on a SD card, insert the cartd in the SD and power ON. But for BPI-W2 things seem more complicated. The code must be written to SPI flash.

Many doc tell something like: Connect the serial port between the host and the board correctly… or connect USB to serial or degub port, etc

What is this port ? Is it part of the 40-pin GPIO ?

I bought DSD TECH 2PCS USB to TTL Serial Adapter but this one count 6 (4 used) pins. In the BPI-W2 doc I saw only 3 pins are used (CON2-P1 GND, CON2-P2 UART0-RX, CON2-P3 UART0-TX) is it correct ?

Is it possible to write and boot a Linux system on eMMC only (without SD card) ?

Is boot from sata SSD or USB 3 possible ?

Nope. SPI flash for bootloader. You should use EMMC or microsd for OS.

4 pin uart near the 3 buttons(vcc not soldered).

Yeap. Just plug RX->TX, TX->RX, GND->GND U can use minicom on Linux or putty on Windows to access tty.

You can run Linux on EMMC without SD. But for partitioning, creating OS on EMMC you should run system from SD or sata, etc. Maybe you can access EMMC by USB-C with USB button. Not sure about this, not tried.

Yes. You must change root fs location in uEnv.txt .

Thank a lot for your reply.

The DSD TECH 2PCS USB to TTL Serial Adapter connect well to board (I can the boot console output [below]). Next I want install ubuntu but I cannot get “debug menu” http://wiki.banana-pi.org/Getting_Started_with_BPI-W2 tell:

press “ctrl+q” then to power on the board, and when the screen appears’ d/g/r ', it can be released;

other tell:

Holding on press “ctrl + q” and power on board,after the screen show “d/g/r”,then loose “ctrl + q

or:

start BPI-R2 — !!! press power button for 10 seconds !!!

(assume “power button” is the one on the board)

but I never get the “debug menu”

Any idea ?

The bpi-w2 work well. I can get these info from Settings Model: Realtek Kylin 32-bit QTT_NAS Android version: 7.1.1

At the startup the uart console show the output:

[    0.114304] bl31_set_memory_protect 
INFO:    Non-Secure Boot or 1295 IC_REV >= B00 : no action !! 
[    0.123909] bl31_set_memory_protect ret = 0 
[    0.160666] ****** rtk_lockapi_init 619, chip: id=0x00000000, revision=0x00030000
[    0.169123] ****** rtk_lockapi_init 626, bypass mode
[    0.242978] rtk-usb-power-manager 98000000.rtk_usb_power_manager: rtk_dwc3_u2host status is okay
[    0.252915] rtk-usb-power-manager 98000000.rtk_usb_power_manager: ehci status is okay
[    0.261757] rtk-usb-power-manager 98000000.rtk_usb_power_manager: ohci status is okay
[    0.270594] rtk-usb-power-manager 98000000.rtk_usb_power_manager: rtk_dwc3_u3host status is okay
[    0.287353] rtk-usb-power-manager 98000000.rtk_usb_power_manager: create_debug_files
[    0.782544] [RTD129x PCIE Slot2] 9803b000.pcie2: PCIE device has link down in slot 2
[    0.791299] [RTD129x PCIE Slot2] 9803b000.pcie2: rtk_pcie2_hw_initial fail
[    1.016118] [RTD129x PCIE Slot1] 9804e000.pcie: PCIE device has link down in slot 1
[    1.024765] [RTD129x PCIE Slot1] 9804e000.pcie: rtk_pcie_hw_initial fail
[    1.036434] rtk119x-ir 98007000.irda: [rtk119x_ir_probe]: can't get multiple support from dtb, set to default->not support

[ROS: openRPC() intr_scpu_dev_r buf  0x00e2ffa1 s  0x00e2ffa1 e  0x00e4ffa1 i  0x00e2ffa1
[ROS: openStubRPC() intr_w buf  0x00e6ffa1 s  0x00e6ffa1 e  0x00e8ffa1 i  0x00e6ffa1[AVCPU] Set Debug level flag  0x8fc4de74 *flag  0x0fc38ef8 ucache  0xafc38ef8 
[AVCPU] Set Debug level *ptrDebugFlag  0x00000001 


......


[    1.832231] card->mmc_avail_type = 0x00000013 
[    1.843050] Inherit bootcode tuning phase: TX=0xf, RX=0x13
[    1.893780] rtk-dwc3-type_c 98013200.rtk_dwc3_drd_type_c: create_debug_files
===== OpenWRT + Android =====
[    2.448264] hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    2.650518] usb usb1-port1: port 1, status 0101, change 0000, 12 Mb/s
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level


......


ext4 etc mounted!
mount: /dev: filesystem mounted, but mount(8) failed: No such file or directory
[    6.181380] init: could not import file '/init.lighttpd.rc' from '/init.kylin.rc': No such file or directory
[    6.702883] init: Failed to read from /dev/hw_random: No such device
[    6.709698] init: could not open /dev/keychord: No such file or directory
[    6.728290] init: do_start: Service watchdogd not found
[    6.787483] init: Failed to read from /dev/hw_random: No such device
[    7.519475] Do not detect the SDIO card and close the clock
[    7.525249] rtk_sdmmc_get_cd: SD card does not exist, regCARD_EXIST = 0
[    7.529927] jnl: version magic '4.1.35-04005-g6c2818e-dirty SMP preempt mod_unload aarch64' should be '4.1.35-04005-dirty SMP preempt mod_unload aarch64'
[    7.534599] jnl: version magic '4.1.35-04005-g6c2818e-dirty SMP preempt mod_unload aarch64' should be '4.1.35-04005-dirty SMP preempt mod_unload aarch64'
[    7.538060] jnl: version magic '4.1.35-04005-g6c2818e-dirty SMP preempt mod_unload aarch64' should be '4.1.35-04005-dirty SMP preempt mod_unload aarch64'
[    7.540709] jnl: version magic '4.1.35-04005-g6c2818e-dirty SMP preempt mod_unload aarch64' should be '4.1.35-04005-dirty SMP preempt mod_unload aarch64'
[    7.918521] init: /recovery not specified in fstab
[    7.924577] init: do_start: Service debuggerd64 not found
[    8.413980] init: SELinux:  Could not stat /data/dalvik-cache/arm64: No such file or directory.
[    8.422960] init: SELinux:  Could not stat /data/dalvik-cache/mips: No such file or directory.
[    8.431954] init: SELinux:  Could not stat /data/dalvik-cache/mips64: No such file or directory.
[    8.441039] init: SELinux:  Could not stat /data/dalvik-cache/x86: No such file or directory.
[    8.450133] init: SELinux:  Could not stat /data/dalvik-cache/x86_64: No such file or directory.
[    8.605605] init: insmod: open("/system/vendor/modules/jnl.ko") failed: No such file or directory
[    8.616273] init: insmod: open("/system/vendor/modules/ufsd.ko") failed: No such file or directory[AVCPU] Set Debug level flag  0x8fc4914c *flag  0x010c07b0 ucache  0xa10c07b0 
[AVCPU] Set Debug level *ptrDebugFlag  0x00000000 
[    8.684726] init: cannot find '/system/bin/install-recovery.sh' (No such file or directory), disabling 'flash_recovery'
[    8.702260] init: cannot find '/system/bin/jpuinit' (No such file or directory), disabling 'jpuinit'
[    8.703547] init: couldn't write 4132 to /dev/cpuset/camera-daemon/tasks: No such file or directory
kylin32:/ $ [    8.739149] init: cannot find '/sbin/verity_kylin.sh' (No such file or directory), disabling 'verity'
[   17.370565] init: no such service 'regService'
[   17.375288] init: no such service 'regService'
[   18.208773] r8169 98016000.gmac eth0: rtl_csiar_cond == 0 (loop: 100, delay: 10).
[   18.217772] r8169 98016000.gmac eth0: rtl_csiar_cond == 1 (loop: 100, delay: 10).
[   18.744223] audit: rate limit exceeded
[   20.418691] init: avc:  denied  { set } for property=ctl.xen_tcp_server pid=7130 uid=0 gid=0 scontext=u:r:realtek:s0 tcontext=u:object_r:ctl_default_prop:s0 tclass=property_service permissive=1
[   21.030920] audit: rate limit exceeded
[   22.803683] audit: rate limit exceeded
[   23.638914] init: avc:  denied  { set } for property=tmp.exec_ubus pid=6749 uid=1000 gid=1000 scontext=u:r:system_app:s0 tcontext=u:object_r:default_prop:s0 tclass=property_service permissive=1
[   23.839550] init: avc:  denied  { set } for property=tmp.exec_ubus pid=8507 uid=0 gid=0 scontext=u:r:realtek:s0 tcontext=u:object_r:default_prop:s0 tclass=property_service permissive=1
[   23.857996] audit: rate limit exceeded

this board boots as soon as you plug in power barrel (power button is not required).

if you wish to go this route this is how it goes:

hold ctrl+q while having your terminal opened and ready to get console output and power on the board after that.

another thing is - this guide you are following is old. there is perfectly working SD image that might just work for you without all that hassle

try this:

I am completely lost with BPI-W2…

I try to install bpi-tools to burn a SD card following the instructions from

but uart console don’t have sudo command !

When I try to install bpi-tools on my Ubuntu system I got this error at sudo bpi-tools --upgrade

/usr/bin/bpi-tools: line 36: curl: command not found

bpi-copy is there but fail with: /usr/bin/bpi-copy: line 117: pv: command not found

???

Does Android on BPI-W2 have a terminal and how to access the terminal ?

What can we do with this Android ? For me Android is totally useless !

if you log in with root / bananapi to console you have all permissions required - sudo is not needed.

simple apt-get install is enough

On ubuntu:

sudo apt-get install curl pv

If it will complain about other command not found try sudo apt-get install whatever it will complain about

Generally what you need is to get bpi-w2.img written on SD card:

you can either burn W2 ubuntu image to SD from your own laptop with bpi-copy or via any other means (dd command , image burning software …) - no matter laptop OS

burn image to SD on your laptop (similar way as you did for raspberry), plug SD into bpi-w2, switch SW4 (next to 40pin header on bpi-w2) to ‘1’, plug power

you are on ubuntu now ;]

I have used this tool on windows (not from this website - this one is for ubuntu):

Android do not have google services (or any other app store ) installed. To get any app you need to transfer .apk manually (usb / network / SD) and install from there.

You can always install 3rd party store like xda-lab / apkmirror / whatever via .apk, and rest from there - like on your smartphone (android is android after all - platform does not matter)

Thank you. With yours explanantions I was able to bpi-copy image to burn SD card.

W2 linux image web page show:

If your board startup log print “SPI ROM:20180907”, then you don’t need to update spi rom.

But the capture log from uart don’t have anuthing started with “SPI ROM” How to get the spi rom version ?

I can boot the lastest Ubuntu (2018-09-16-ubuntu-18.04-mate) but this one has HDMI problem. At the boot time uart show many lines:

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

After may reboot I was able to get the desktop playing with cntl-alt-Fx and alt-Fx (cntl-alt-F7 don’t show the desktop) but I was not able to reproduce the process to get desktop even after retry many time!

2018-09-17-debian-9-stretch-mate work well except it was slow. Is it normal ?

What is the purpose of the 3 buttons: Power Key, Reset Key, LSADC Key ? I read LSADC Key involve u-boot but I don’t know what to do with this. The Power Key must show something at startup when hold for 10 seconds but I have never notice naything.

I do not recall having SPI ROM version prior to upgrade either.

There is a guide about upgrading SPI rom here on the forum. Just remember that plugging usb-c to your laptop will boot this board taking power via USB cable (no need barrel plug)

OK, I know how to burn image to SD card with bpi-copy. Now I want to burn image to eMMC and I want to be sure to not do any mistake.

By default when no destination is given bpi-copy install to eMMC. Correct ?

Does image and bpi-tools need to be into the SD card or can I use image and bpi-tools on the PC and call bpi-copy on the PC ?

After the eMMC was burn: switch to SW4 to 0 and restart ?

Anything else ?

Is it possible to change the eMMC chip for a more power one, by example a 64 gb ?

Is boot from sata SSD or USB 3 possible ?

Yes. You must change root fs location in uEnv.txt . [/quote]

uEnv.txt in SSD and uEnv.txt in emmc are the same except for tow lines (differ only by a #)

root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait root=/dev/sda2 rw rootfstype=ext4 rootwait

the first line in commented in SSD while the second line is commented in emmc

Must I add/change something in uEnv.txt ?

How do you boot to SSD ?

I have not tried it myself but it looks like you will need to either edit rootwait line or add another one with commenting this one out.

If I remember correctly sata drives are detected’ as /device/sataa and /device/satab (or was it sata1 and sata2 ?)

Check how your bpi detects sata and put it there in uEnv Add partition number to the end for example first partition on sataa - /dev/sataa1

Edit only one uEnv - one is used when booting emmc (emmcblk0p2) and the other boots from SD (sda2)

In case it won’t boot one you can always flip sw4 and boot from the other source to recover uEnv you have edited

sataa1 partition is Fat partition. sataa2 is Ext4. So I set it to sataa2. But W2 does not boot from SSD. W2 try to boot from emmc but fail with hdmi error…

I want to restore from uEnv.txt (booting from from SD card) but I don’t know where is the emmc partiton.

I try to mount /dev/mmcblk0p1 but this is not emmc (seem to be the SD card)

How can I mount the emmc partition holding uEnv.txt ?

emmcblk0 is emmc chip, sda is SD card.

Then you add p# or just # - where # is actual partition number: on emmc (with p) or SD (just number).

Have you tried sata with rootwait like for SD or just root like for emmc? I would do rootwait - sata needs to initiate and it takes time.

You need to remember you are not completely booting from sata. It boots from whatever sw4 decided … then looks for root filesystem on whatever was loaded from uEnv during initial boot. uImage, bluecore.audio, uEnv and all that stuff stays on whatever sw4 points to …

HDMI error looks like it is kernel 4.4 from that old guide. You would need to put uImage (and in general whatever was found on SD card right next to it after burning ready image of say Ubuntu kernel 4.9) into emmc to try to boot without SD card at all.

Then you can move everything from data partition on SD card to sata and edit uEnv to look for those files there instead of standard SD.

There are 2 uEnv: one from emmc and one one from sata ssd. Which one must be modified ? Emmc, sata ssd or both ?

Since I has flashed the SPI, the SD card boot only with SW4 at 1. SW4 at 0 does nothing, SD card inserted or not. Is it normal ?

SW4 - 0: emmc only

SW4 - 1: try SD, fallback to emmc if no SD found

you need to change uEnv on your preferred boot medium (emmc or SD)

there is no need to have it on SSD - you wont be booting from sata, just getting root filesystem from there.

actual boot will always be from emmc / SD depending on SW4 position (that is partition 1 on either SD or emmc if I am not mistaken) - you are changing physical location of ‘/’ on your system (by default it is partition 2 on same medium you booted from - you can edit this to look for ‘/’ on SSD)

SW4 - 0: emmc only

SW4 - 1: try SD, fallback to emmc if no SD found

Yes. Thanks to clarify,

you need to change uEnv on your preferred boot medium (emmc or SD)

My goal is to load the file system on the sata SSD.

The uEnv.txt on the sata SSD is:

uEnv.txt

bpi=bananapi board=bpi-w2 chip=RTD1296 service=linux

kernel=uImage

kernel_loadaddr=0x03000000 audio_loadaddr=0x0f900000 blue_logo_loadaddr=0x30000000 fdt_loadaddr=0x02100000 rootfs_loadaddr=0x02200000

${bpi}/${board}/${service}/${kernel}

sd_boot_dtb=bananapi/bpi-w2/linux/bpi-w2.dtb sd_boot_rootfs=bananapi/bpi-w2/linux/uInitrd sd_vmlinux=bananapi/bpi-w2/linux/uImage sd_audio=bananapi/bpi-w2/linux/bluecore.audio

#root=/dev/ram

SD / eMMC

#root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait

USB / SATA

root=/dev/sda2 rw rootfstype=ext4 rootwait

console=earlycon=uart8250,mmio32,0x98007800 fbcon=map:0 console=ttyS0,115200 bootopts=loglevel=7 debug=7 initcall_debug=0

abootargs=setenv bootargs board=${board} console=${console} root=${root} service=${service} sdmmc_on=${sdmmc_on} ${bootopts}

ahello=echo Banana Pi ${board} chip: $chip Service: $service

#aboot=if fatload $device $partition $rootfs_loadaddr ${bpi}/berryboot.img; gosd; aboot=gosd;

aload_kernel=fatload $device $partition ${kernel_loadaddr} ${bpi}/${board}/${service}/${kernel}

#uenvcmd=run ahello abootargs aload_kernel aboot uenvcmd=run ahello abootargs aboot

END

This file is the same as the one on the emmc or the one on SD card except the comment is moved two line below.

actual boot will always be from emmc / SD depending on SW4 position (that is partition 1 on either SD or emmc if I am not mistaken) - you are changing physical location of ‘/’ on your system (by default it is partition 2 on same medium you booted from - you can edit this to look for ‘/’ on SSD)

So i need only change uEnv.txt on the emmc. Correct ?

My first try: replace (on emmc uEnv.txt) sda2 by sataa2 in the line “root=/dev/sda2 rw rootfstype=ext4 rootwait” Still load only from emmc file system… (SW4 at 1)

What do I need change to load the filesystem on the sata SSD ?

#
## uEnv.txt
#
bpi=bananapi
board=bpi-w2
chip=RTD1296
service=linux
#
##
#
kernel=uImage
#
##
#
kernel_loadaddr=0x03000000
audio_loadaddr=0x0f900000
blue_logo_loadaddr=0x30000000
fdt_loadaddr=0x02100000
rootfs_loadaddr=0x02200000
#
## ${bpi}/${board}/${service}/${kernel}
#
#
sd_boot_dtb=bananapi/bpi-w2/linux/bpi-w2.dtb
sd_boot_rootfs=bananapi/bpi-w2/linux/uInitrd
sd_vmlinux=bananapi/bpi-w2/linux/uImage
sd_audio=bananapi/bpi-w2/linux/bluecore.audio
#
##
#
#root=/dev/ram
# SD / eMMC
#root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait 
# USB / SATA
root=/dev/sda2 rw rootfstype=ext4 rootwait 
#
console=earlycon=uart8250,mmio32,0x98007800 fbcon=map:0 console=ttyS0,115200
bootopts=loglevel=7 debug=7 initcall_debug=0
#
##
#
abootargs=setenv bootargs board=${board} console=${console} root=${root} service=${service} sdmmc_on=${sdmmc_on} ${bootopts} 
#
##
#
ahello=echo Banana Pi ${board} chip: $chip Service: $service
#
##
#
#aboot=if fatload $device $partition $rootfs_loadaddr ${bpi}/berryboot.img; gosd;
aboot=gosd;
#
aload_kernel=fatload $device $partition ${kernel_loadaddr} ${bpi}/${board}/${service}/${kernel}
#
##
#
#uenvcmd=run ahello abootargs aload_kernel aboot
uenvcmd=run ahello abootargs aboot
#
## END
#

From my understanding it I would try like this:

root=/dev/sataa2 rw rootfstype=ext4 rootwait

If I understood you correctly before, this is how you tried it already.

Make sure sataa2 contains what you think by mounting it somewhere while booted with emmc or SD.

Possibly you have first partition on sataa as root volume?

Not sure about single drive but when I tried mdadm raid1 setup of 2 sata drives they were not mounting automatically on boot due to spin-up taking longer than wait time during booting (2.5 inch HDD X2 - not SSD like in your case).

Plug uart while booting and look for anything there - maybe sata drive is initialized after boot process looks for root partition?

Solved !

Problem is Ubuntu (2018-09-16-ubuntu-18.04-mate-desktop-demo-aarch64-bpi-w2-sd-emmc.img.zip) boot enter in infinite loop ending with: “[AO][_AO_if_video_HDMI_mode]HDMI not enabled” see below…

with OpenSuse (2018-09-19-openSUSE-Tumbleweed-ARM-XFCE-desktop-demo-aarch64-bpi-w2-sd-emmc.img.zip) or Kali (2018-09-20-kali-xfce-desktop-demo-aarch64-bpi-w2-sd-emmc.img.zip) everything work fine…

Is there any way to choose system at boot time (something like uboot-menu) ?

By sending a command with uart ?

Thanks a lot.

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[ 42.944408] [RTK_RTC] 9801b600.rtc: set time 2019.01.27 13:18:42

[ 42.950581] [RTK_RTC] 9801b600.rtc: rtk_rtc_disable

[ 42.955578] [RTK_RTC] 9801b600.rtc: enable REG_SEC = 0x4e

[ 42.961105] [RTK_RTC] 9801b600.rtc: enable REG_MIN = 0x0

[ 42.966543] [RTK_RTC] 9801b600.rtc: enable REG_HR = 0x0

[ 42.971893] [RTK_RTC] 9801b600.rtc: enable REG_DATA_LOW = 0x0

[ 42.977776] [RTK_RTC] 9801b600.rtc: enable REG_DATE_HIGH = 0x0

[ 42.983767] [RTK_RTC] 9801b600.rtc: rtk_rtc_enable

[ 42.988675] [RTK_RTC] 9801b600.rtc: enable REG_SEC = 0x54

[ 42.994202] [RTK_RTC] 9801b600.rtc: enable REG_MIN = 0x12

[ 42.999728] [RTK_RTC] 9801b600.rtc: enable REG_HR = 0xd

[ 43.005078] [RTK_RTC] 9801b600.rtc: enable REG_DATA_LOW = 0x5b

[ 43.011050] [RTK_RTC] 9801b600.rtc: enable REG_DATE_HIGH = 0x7

[ 43.017052] [RTK_RTC] 9801b600.rtc: sec=0x2a , min=0x12 . day=0x75b

[ 43.023492] [RTK_RTC] 9801b600.rtc: time read as 2019.01.27 13:18:42

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[ 123.482504] Freeing free logo area memory: 9216K

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled

[AO][_AO_if_video_HDMI_mode]HDMI not enabled