How to make a SD card with bootloader

You were using the kernel which is debugging version, please re-download which I have updated.

Thanks! Autofs and NFS are working.

I have no problems with latest (2018.05.23) kernel and u-boot, board reboots fine.

But I’m using a freshly bootstrapped Debian Unstable and not Ubuntu.

Sadly. I use the newest uImage which is in this topic, but it still boot fail almost every times. (I need to keep reboot and hope there are one time to boot into system. I need to reboot about 20 to 30 times and it may successes boot. rarely)

I get different kernel panic message when boot failed. I had tested different SD card.

But this board can boot to openWrt which in emmc.

I’m really thinking that is this a broken board or what I did wrong.

different fail message https://pastebin.com/vhN72UXy https://pastebin.com/S5Uqen8R https://pastebin.com/6h94a201 (stuck here and not continue https://pastebin.com/hBfi0Stf

Could you please flash the newest u-boot to emmc and boot from it, which will load system from SD card firstly, to test if it works? The u-boot for emmc name is dvrboot.exe.bin.

I don’t fully understand step 3. I’ve downloaded u-boot.bin using my Windows PC, but I’m not sure where to put it for this step. Can you please clarify for me. Thanks.

This is my result of executing tftp:

BPI-W2> tftp 0x1500000 u-boot.bin
Using r8168#0 device
TFTP from server 192.168.100.2; our IP address is 192.168.100.1
Filename 'u-boot.bin'.
Load address: 0x1500000
Loading: T T T T T T T T T T
Retry count exceeded; starting again
BPI-W2>

Here is full output of reboot with ESC key:

  C1:80000000
C2
?
C3hswitch frequency to 0x00000046
frequency divider is 0x00000080
switch frequency to 0x00000046
frequency divider is 0x00000004
switch to SDR 8 bit
switch bus width to 0x00000008 bits success

hwsetting size: 00000BE4
C4
f
5-5
s_f
5-5-2
Goto FSBL: 0x10100000
switch frequency to 0x00000046
frequency divider is 0x00000080
switch frequency to 0x00000046
frequency divider is 0x00000004
emmc_cid[3] = 0xE9547849 emmc_cid[2] = 0xDD650152 emmc_cid[1] = 0x34454D47 emmc_
cid[0] = 0x38000115
switch bus width to 0x00000008 bits success
DEVICE_TYPE = 00000057
emmc_sec_count = 00E90000
switch speed to 0x00000002 success
switch frequency to 0x000000A6
frequency divider is 0x00000000
1st TX_window = 0xFFFFFFDE
1st phase TX VP0= 0x00000012
RX_window = 0xFFFFFC03
phase RX VP1= 0x00000015
Welcome to FSBL ...
[FSBL] Warm Boot: 0x00000000
[FSBL] Secure: 0x0000BEEE
[FSBL] Flash Type: 0x00000002
[FSBL] DCache Enable: 0x00000000
[FSBL] SVP = N
********** FW_TYPE_GOLD_TEE **********
    FW Image to 0x10200000, size=0x0007BDA0 (0x1027BDA0)
    FW Image fr 0x000B0600
********** FW_TYPE_GOLD_BL31 **********
    FW Image to 0x10120000, size=0x000062A0 (0x101262A0)
    FW Image fr 0x0012C400
********** FW_TYPE_BOOTCODE **********
    FW Image to 0x00020000, size=0x0007DC20 (0x0009DC20)
    FW Image fr 0x00020E00
md copy audio bin
VERBOSE: bl31_setup
NOTICE:  BL31: v1.2(debug):a6c9ab6
NOTICE:  BL31: Built : 15:16:22, Apr 27 2017
INFO:    BL31: Initializing runtime services
INFO:    Start to init service std_svc
INFO:    Finish to init service std_svc
INFO:    Start to init service opteed_fast
INFO:    Finish to init service opteed_fast
INFO:    BL31: Initializing BL32
INFO:    TEE-CORE: TEE OS v2.1
INFO:    TEE-CORE: TA RAM slim vesion.
INFO:    TEE-CORE: Skipping to check tee os version.
INFO:    TEE-CORE: Initializing (9a5884c #1 四 12月  7 17:26:20 CST 2017 aarch
64)
MESSAGE: [0x0] TEE-CORE:tee_otp_get_hw_unique_key:70: ************************
   tee_otp_get_hw_unique_key chip id: 30000
MESSAGE: [0x0] TEE-CORE:tee_otp_get_hw_unique_key:75: ************************
   tee_otp_get_hw_unique_key used Kf
INFO:    TEE-CORE: teecore inits done
INFO:    Core_0 TEESMC_OPTEED_RETURN_ENTRY_DONE
INFO:    Core_0 got optee_vectors (0x1020093c)
INFO:    BL31: Initialized BL32
INFO:    EXIT BL31
INFO:    bl31_to_kernel: kernel_resume_entry = 0x1e000
INFO:    bl31 jumps to EL2: LK entry


U-Boot 2015.07 (May 15 2018 - 22:44:59 +0800)

CPU  : Cortex-A53 Quad Core - AARCH64
Board: Realtek QA Board
DRAM:  2 GiB
Watchdog: Disabled
mapping memory 0x20000000-0x40000000 non-cached
flushing dcache successfully.
nor flash id [0x00ef4018]
sector 256k en: 0
sector  64k en: 1
sector  32k en: 1
sector   4k en: 1
page_program  : 1
max capacity  : 0x01000000
spi type name : WINBOND_W325Q128BV_128Mbit
MMC:   Initialize eMMC in traditional mmc flow.
RTD1295 eMMC: 0
rsp[0]=0x15010038,
                       rsp[1]=0x474d4534,
                       rsp[2]=0x520165dd,
                       rsp[3]=0x497854e9
The cid_val is 15.
rsp[0]=0xd0270132,
                       rsp[1]=0x0f5903ff,
                       rsp[2]=0xf6dbffef,
                       rsp[3]=0x8e40400d
mmc->version=0x40000000
version=0x00000004
[LY] cardtype=57, mmc->card_caps=0f
[LY] freq = 00464388, clk diver = 00000080
[LY] speed up emmc at HS-200
[LY] HS-200 bus width=2
[LY] mmc->boot_caps = 20b
TEMP TX_WINDOW=0xffffffde, TX_best=0x12
RX_WINDOW=0xfffffc03, RX_best=0x15
TX1_WINDOW=0x7fffff80, TX_best=0x12
[LY] hs200 : 0
[HC] ERASE Unit Size = 524288 bytes
[HC] WPG_SIZE = 8388608 bytes
Device: RTD1295 eMMC
Manufacturer ID: 15
OEM: 100
Name: 8GME4
Tran Speed: 200000000
Rd Block Len: 512
MMC version 4.0
High Capacity: No
Capacity: 7.3 GiB
User Capacity: 7.3 GiB
Boot Capacity: 4 MiB
RPMB Capacity: 512 KiB
Bus Width: 8-bit
Speed: HS200
SD:
SD device index# 0
Factory: MMC
Factory: pp:1, seq#:0x1a, size:0x22000
------------can't find tmp/factory/000BootParam.h
In:    serial
Out:   serial
Err:   serial
HDMITx_HPD=False
------------tmp/factory/video_rpc.bin found
EDID checksum: read 00 00, last 8e 00
Sink changed, skip ONE_STEP_RPC
tv_system=25 mode=1
Net:   Realtek PCIe GBE Family Controller mcfg = 0024
dev->name=r8168#0
Checking default environment
Hit Esc or Tab key to enter console mode or rescue linux:  0
------------can't find tmp/factory/recovery

Press Esc Key

Enter console mode, disable watchdog ...

BPI-W2> mmcinfo
Device: RTD1295 eMMC
Manufacturer ID: 15
OEM: 100
Name: 8GME4
Tran Speed: 200000000
Rd Block Len: 512
MMC version 4.0
High Capacity: No
Capacity: 7.3 GiB
Bus Width: 8-bit
Erase Group Size: 256 MiB
BPI-W2> tftp 0x1500000 u-boot.bin
Using r8168#0 device
TFTP from server 192.168.100.2; our IP address is 192.168.100.1
Filename 'u-boot.bin'.
Load address: 0x1500000
Loading: T T T T T T T T T T
Retry count exceeded; starting again
BPI-W2>

I had re flashed dvrboot.exe.bin which is include in this topic google drive, but the problem still happened.

Different kernel panic message randomly shows, or hangs at cpu freq message.

You need to set a tftp server and let your board can access through network.

  1. Set a tftp server. If you use windows, you can try Tftpd32.
  2. Connect a network wire from your board to your computer or switch which your computer is connected too.
  3. Press esc and boot
  4. “env print” can show your settings. Check ipaddr and serverip is correct. (Board and your computer need at same subnet)
  5. If not (EX: your computer is 192.168.1.5), you can use “setenv " to change” (Ex: setenv serverip 192.168.1.5. setenv ipaddr 192.168.1.10)

Then you can try to download file from your computer through tftp protocol.

The issue you met is caused by CPU got wrong instruction, normally it should be one of three reasons:

  1. CPU or cache within it is not stable;
  2. DDR is not stable;
  3. Got wrong data from SD card;

Since you said openwrt works fine, so could you please check SD partition 1 type and formatting, is it Fat32? And mount it on openwrt to do some reading tests?

The boot partition is fat32, and I had put my sd card and run badblocks. It’s fine.

I also try to use different sd card but I get the same result.

https://pastebin.com/MqV6b7qf

I am on business trip in Australia now, will do some test when back to office next week.

hello,

I seem to have the same problem as Jalen. However, only cold system occurs with me. Once the processor has warmed up, it is fully initialized by the kernel. I hope this does not indicate a hardware error on the board.

Furthermore, I noticed that the LEDs of eth0 (interface next to usb3.0) are without any function.

Is this behavior with you too?

Is there a schematic of the board to download?

Is it possible to download the kernel source? I would like to work under Debian.

Best regards

Thank you! That worked to download u-boot.bin However, when I re-power the BPI-W2, it boots to OpenWRT on the board, not ubuntu on the SD card. Looking at the boot log, references to SD appear around the 10 second mark, which I’ve listed in full below, but specifically, at 13.439279 I see this:

[   13.439279] block: attempting to load /etc/config/fstab
[   13.445329] block: unable to load configuration (fstab: Entry not found)
[   13.452266] block: no usable configuration

Is this preventing the BPI-W2 from booting from the SD card? I have confirmed that there is no /etc/config directory on the SD card:

root@OpenWrt:/# lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk0rpmb  179:24   0   512K  0 disk
mmcblk0boot0 179:8    0     4M  1 disk
mmcblk0boot1 179:16   0     4M  1 disk
mmcblk0      179:0    0   7.1G  0 disk
|-mmcblk0p1  179:1    0    96M  0 part /rom
`-mmcblk0p2  179:2    0    40M  0 part /overlay
mmcblk1      179:32   0  59.1G  0 disk
|-mmcblk1p1  179:33   0 190.8M  0 part /mnt/mmcblk1p1
`-mmcblk1p2  179:34   0    59G  0 part /mnt/mmcblk1p2
root@OpenWrt:/# ls -al /mnt/mmcblk1p2/etc/config
ls: cannot access /mnt/mmcblk1p2/etc/config: No such file or directory
root@OpenWrt:/#

boot log pertaining to SD:

[   10.139897] rtk-sdmmc: CONFIG_MMC_BLOCK_BOUNCE enable
[   10.205377] rtk_sdmmc_get_cd: SD card exists, regCARD_EXIST = 4
[   10.205546] usbcore: registered new interface driver usbhid
[   10.205547] usbhid: USB HID core driver
[   10.211507] ashmem: initialized
[   10.212579] usbcore: registered new interface driver snd-usb-audio
[   10.212764] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[   10.221166] IPVS: Registered protocols ()
[   10.224287] IPVS: Connection hash table configured (size=4096, memory=64Kbytes)
[   10.224350] IPVS: Creating netns size=1328 id=0
[   10.253102] IPVS: ipvs loaded.
[   10.256360] NET: Registered protocol family 10
[   10.261538] NET: Registered protocol family 17
[   10.266122] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[   10.279035] 8021q: 802.1Q VLAN Support v1.8
[   10.284159] Btrfs loaded
[   10.287011] scpu wrappee irq 23, scpu_wrap_addr 0xffffff800d02c000
[   10.287011]
[   10.295771] [SCPU_WRAPPER] initialized
[   10.299661] DRM rtk_platform_drm_init
[   10.303537] DRM rtk_platform_drm_probe
[   10.307383] DRM rtk_drm_init
[   10.310331] RTK DRM initialize, driver name: realtek, version 1.5
[   10.316892] DRM rtk_drm_load 191
[   10.320233] DRM rtk_crtc_create 435
[   10.323835] DRM rtk_connector_create 185
[   10.327944] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[   10.334715] [drm] No driver support for vblank timestamp query.
[   10.340804] create vblank thread success
[   10.344821] DRM rtk_drm_load 265
[   10.348132] [drm] Initialized realtek 1.5.0 20170207 on minor 0
[   10.354288] rtc_rtk 9801b600.rtc: setting system clock to 2016-01-01 00:10:23 UTC (1451607023)
[   10.369496] thermal cooling_device0: thermal-cpufreq-0 bind to TP0: 1 -    6, ret = 0
[   10.377351] thermal cooling_device0: thermal-cpufreq-0 bind to TP1: 7 -    11, ret = 0
[   10.391362] corectrl: token_owenr X -    cpufreq
[   10.398205] dcdc1: disabling
[   10.401155] dcdc2: disabling
[   10.404103] dcdc3: disabling
[   10.407058] dcdc5: disabling
[   10.410007] dcdc6: disabling
[   10.412956] ldo2: disabling
[   10.415824] ldo3: disabling
[   10.415857] ALSA device list:
[   10.415859]   #0: snd_alsa_rtk
[   10.424981] ttyS0 - failed to request DMA
[   10.431611] VFS: Mounted root (squashfs filesystem) readonly on device 179:1.
[   10.441829] devtmpfs: mounted
[   10.444984] Freeing unused kernel memory: 448K (ffffffc000ba0000 - ffffffc000c10000)
[   10.452925] This architecture does not have kernel memory protection.
===== OpenWRT =====
[   10.836531] init: Console is alive
[   11.162299] init: - preinit -
[   11.310444] random: mktemp urandom read with 22 bits of entropy available
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
[   13.225382] SD card is being inserted now...!!!
[   13.230028] [SD] SD card power register=33333323
[   13.235371] rtk_sdmmc_get_cd: SD card exists, regCARD_EXIST = 4
[   13.310153] rtk_sdmmc_send_cmd_get_rsp : reject SDIO commands cmd:0x34
[   13.316944] rtk_sdmmc_send_cmd_get_rsp : reject SDIO commands cmd:0x34
[   13.327260] rtk_sdmmc_send_cmd_get_rsp : reject SDIO commands cmd:0x05
[   13.334043] rtk_sdmmc_send_cmd_get_rsp : reject SDIO commands cmd:0x05
[   13.340829] rtk_sdmmc_send_cmd_get_rsp : reject SDIO commands cmd:0x05
[   13.347631] rtk_sdmmc_send_cmd_get_rsp : reject SDIO commands cmd:0x05
[   13.375021] mount_root: mounting /dev/root
[   13.381680] mount_root: loading kmods from internal overlay
[   13.439279] block: attempting to load /etc/config/fstab
[   13.445329] block: unable to load configuration (fstab: Entry not found)
[   13.452266] block: no usable configuration
fsck from util-linux 2.28
[   13.656044] mmc1: cannot verify signal voltage switch
e2fsck 1.42.12 (29-Aug-2014)
nasetc: recovering journal
nasetc: clean, 89/8200 files, 4411/40952 blocks
resize2fs 1.42.12 (29-Aug-2014)
The filesystem is already 40952 (1k) blocks long.  Nothing to do!

[   13.782961] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
ext4 etc mounted!
mount: /dev: filesystem mounted, but mount(8) failed: No such file or directory
[   13.821192] procd: - early -
Failed to connect to ubus
[   14.227298] SD/MMC card init done.
[   14.232946] rtk_sdmmc_get_ro: SD card is not write protect, regCARD_EXIST = 4
[   14.386962] rtk_sdmmc_execute_tuning CR_PLL_SD3: 174 (0xae)
[   14.392670] rtk_sdmmc_execute_tuning CLK_GEN DVI: 1
[   14.397695] mmc1: new ultra high speed SDR104 SDXC card at address 59b4
[   14.404807] mmcblk1: mmc1:59b4 USD00 59.1 GiB
[   14.410368]  mmcblk1: p1 p2

The LEDs of eth0 do not work in ubuntu now, it works under router mode.

We are waiting for permit to open schematic and kernel source, will soon.

Hi Jalen,

could you please check the power adapter, does it output 12v ? right ?

And please compare the uImage loaded from tftp and sd card by using below commands under u-boot:

  • tftp uImage
  • fload sd 0:1 1500000 uImage
  • cmp.b 0x1500000 0x3000000 0xc33168

please compare dtb file with the same way.

Hello,

in addition to the above startup problem, the logfiles Bananapi_w2.log (29,8 KB)

after about 1 minute power and reset at 62 ° C core temp Bananapi_w2.log_1 (75,8 KB)

greetings

Hello,

I use a 12V 2A power adapter which I bought with W2 board from the seller. The adapter also has a bpi logo.

I compared the file following the step. It says the same file.

Log here: https://pastebin.com/96bKZr47

Hi all,

please follow below steps to boot up from emmc and load linux from SD card.

  1. update u-boot(dvrboot.exe.bin) in emmc to latest version via MP_tool or hypertrm. (make sure the SW4 been switched to 0)
  2. run commands under u-boot to reset env vars:
    • env default -a
    • save
  3. plug in SD card and reset the board, it will boot up from eMMC and load linux from SD card.

I suspect that the SPI ROM from RTK is not stable now, if the board can boot up from eMMC normally, we will push RTK to update SPI rom.

Thank you, that worked! Now I eagerly await HDMI support. :slight_smile:

When switch SW4 0 and reset env to default, I can boot to sd card right now. It looks no error for booting.

Thanks.