EDGE-V Boot Sequence & U-Boot

Hello Khadas Team,

I would like to understand the boot sequence of Edge-V, From RK3399 What I understand is that it looks for uboot in SD-Card first then in emmc. I am not sure about USB Stick

Is it same for EDGE-V ? Also Where can I find the u-boot source or binaries? BSP & Mainline - with patch both.

U-boot can’t in USB Stick.

So Edge-V Can only boot from eMMC or Sd Card. Is that right ?

@numbqq
I cannot acess the device over uart.
I tried different baudrate 115200, 1500000, 8250 (found in libreelec extlinux.conf)
Libreelec boots give from sd card but it doesn’t have a uboot binaries inside for reuse.
Other method i can do is basic the uboot from existing libreelec but how many MB is needed from the existing img?

I tried creating Manjaro img using mainline uboot but it doesn’t boot. Then i tried uboot from. Armbian img and that gives me no display which means uboot is recognized but its getting stuck somewhere so to find it i need uart to work.
If you have bsp or mainline pre built uboot then please share it with me for testing.

Thanks.

The baudrate should be: 1500000

Check docs here: https://docs.khadas.com/edge/SetupSerialTool.html

You can check the prebuild images here:

Server/eMMC: https://dl.khadas.com/Firmware/Edge/Ubuntu/EMMC/Edge_Ubuntu-server-bionic_Linux-5.5-rc2_arm64_EMMC_V0.8.3-20200110.7z

Server/SD: https://dl.khadas.com/Firmware/Edge/Ubuntu/SD_USB/Edge_Ubuntu-server-bionic_Linux-5.5-rc2_arm64_SD-USB_V0.8.3-20200110.7z

Xfce Desktop/eMMC: https://dl.khadas.com/Firmware/Edge/Ubuntu/EMMC/Edge_Ubuntu-xfce-bionic_Linux-5.5-rc2_arm64_EMMC_V0.8.3-20200110.7z

Xfce DEsktop/SD: https://dl.khadas.com/Firmware/Edge/Ubuntu/SD_USB/Edge_Ubuntu-xfce-bionic_Linux-5.5-rc2_arm64_SD-USB_V0.8.3-20200110.7z

1 Like

I had trouble with a P2303(EOL) based serial tool on Windows 10, could not achieve the required baud rate on that tool. Same tool worked fine on Linux. Of course, check TX, RX connections, easy to get them switched.

1 Like

Thanks for the links but i am aware of them, my question is about pre built uboot link.

Ive tried on linux only and I am able to use my uart for all other sbcs with 1500000 baudrate just fine only issue is on edge-v.

Ill try another one and see if that works

No, that 's not true. :stuck_out_tongue:
EDGE-V with the correct u-boot in eMMC, runs systems perfectly from USB. I have been using this option for a long time on all rk3399 and can easily start any system with USB. You only once need an SD card to install an Armbian or Libreelec system in eMMC that supports USB startup .

2 Likes

Hi @balbes150
Can you point me to the write uboot for edge-v?
Which can boot from emmc, sd and usb?

Tried a different uart usb and now I can read the uboot logs. Now next is to get a working uboot for it.

Thanks

1 Like

When writing to an SD card, you must use two commands to save the MBR.

I just tried this few mins ago and facing error.

I will try the one from this link. Thanks

Let me share the log here.

In
channel 0
CS = 0
MR0=0x19
MR4=0x3
MR5=0x6
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
CS = 1
MR0=0x19
MR4=0x3
MR5=0x6
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 1
CS = 0
MR0=0x9
MR4=0x3
MR5=0x6
MR8=0x8
MR12=0x62
MR14=0x62
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xEF
CS = 1
MR0=0x9
MR4=0x3
MR5=0x6
MR8=0x8
MR12=0x62
MR14=0x62
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xEF
channel 0 training pass!
channel 1 training pass!
change freq to 416MHz 0,1
Channel 0: LPDDR4,416MHz
Bus Width=32 Col=10 Bank=8 Row=15/15 CS=2 Die Bus-Width=16 Size=2048MB
Channel 1: LPDDR4,416MHz
W FF != R
Cap error!
no stride
channel 0
CS = 0
MR0=0x19
MR4=0x3
MR5=0x6
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
CS = 1
MR0=0x19
MR4=0x3
MR5=0x6
MR8=0x8
MR12=0x72
MR14=0x72
MR18=0x0
MR19=0x0
MR24=0x8
MR25=0xFF
channel 0 training pass!
channel 0, cs 0, advanced training done
channel 0, cs 1, advanced training done
change freq to 856MHz 1,0
ch 0 ddrconfig = 0x101, ddrsize = 0x2020
pmugrf_os_reg[2] = 0x1000EAA1, stride = 0x17
OUT
Boot1: 2019-03-14, version: 1.19
CPUId = 0x0
ChipType = 0x10, 255
SdmmcInit=2 0
BootCapSize=100000
UserCapSize=29820MB
FwPartOffset=2000 , 100000
mmc0:cmd5,20
SdmmcInit=0 0
BootCapSize=0
UserCapSize=15193MB
FwPartOffset=2000 , 0
StorageInit ok = 194467
SecureMode = 0
SecureInit read PBA: 0x4
SecureInit read PBA: 0x404
SecureInit read PBA: 0x804
SecureInit read PBA: 0xc04
SecureInit read PBA: 0x1004
SecureInit read PBA: 0x1404
SecureInit read PBA: 0x1804
SecureInit read PBA: 0x1c04
SecureInit ret = 0, SecureMode = 0
atags_set_bootdev: ret:(0)
GPT 0x3380ec0 signature is wrong
recovery gpt...
GPT 0x3380ec0 signature is wrong
recovery gpt fail!
LoadTrust Addr:0x4000
No find bl30.bin
No find bl32.bin
Load uboot, ReadLba = 2000
hdr 0000000003380880 + 0x0:0xd0,0x0d,0xfe,0xed,0x00,0x00,0x05,0x7b,0x00,0x00,0x00,0x38,,

tag:LOADER error,addr:0x4000
hdr 0000000003380880 + 0x0:0x42,0x4c,0x33,0x58,0x00,0x01,0x00,0x00,0x23,0x00,0x00,0x00,,

Load uboot, ReadLba = 2400
hdr 0000000003380880 + 0x0:0x61,0x73,0x74,0x5f,0x75,0x73,0x61,0x62,0x6c,0x65,0x5f,0x6c,,

tag:LOADER error,addr:0x4400
hdr 0000000003380880 + 0x0:0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,,

Load uboot, ReadLba = 2800
Load OK, addr=0x200000, size=0xa6ee8
RunBL31 0x10000
NOTICE:  BL31: v1.3(debug):370ab80
NOTICE:  BL31: Built : 09:23:41, Mar  4 2019
NOTICE:  BL31: Rockchip release version: v1.1
INFO:    GICv3 with legacy support detected. ARM GICV3 driver initialized in EL3
INFO:    Using opteed sec cpu_context!
INFO:    boot cpu mask: 0
INFO:    plat_rockchip_pmu_init(1181): pd status 3e
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initializatK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x200000
INFO:    SPSR = 0x3c9


U-Boot 2019.10-armbian (Nov 28 2019 - 12:47:20 +0300)

Model: Khadas Edge-V
DRAM:  "Synchronous Abort" handler, esr 0x96000000
elr: 0000000000219814 lr : 00000000002663c8
x0 : 00000000002b05d8 x1 : 00000000002b0ab0
x2 : 00000000fffffffe x3 : 0000000000000020
x4 : 0000000000000000 x5 : 0000000000000030
x6 : 0000000000272e4b x7 : 000000000000000f
x8 : 00000000ffffffd0 x9 : 0000000000000000
x10: 0000000000000010 x11: 0000000000000008
x12: 0000000000000001 x13: 000000000002001d
x14: 0000000000000000 x15: 0000000000000008
x16: 0000000000000001 x17: 0000000000000012
x18: fffffffdfffffeff x19: 00000000002b05d8
x20: 0000000096000000 x21: 0000000000000000
x22: 0000000000000000 x23: 0000000000000000
x24: 0000000000000000 x25: 0000000000000000
x26: 0000000000000000 x27: 0000000000000000
x28: 0000000000000000 x29: 00000000002b0550

Resetting CPU ...

resetting ...
"Synchronous Abort" handler, esr 0x96000000
elr: 00000000002253a8 lr : 00000000002253f8
x0 : fffffffdfffffedf x1 : fffffffdfffffedf
x2 : 00000000002b0b68 x3 : 00000000002afd80
x4 : 0000000000000051 x5 : 0000000000000051
x6 : ffffff80ffffffc8 x7 : 000000000000000f
x8 : 00000000002b01c0 x9 : 0000000000000000
x10: 0000000000000010 x11: 0000000000000006
x12: 000000000001869f x13: 000000000002001d
x14: 0000000000000000 x15: 0000000000000010
x16: 0000000000000001 x17: 0000000000000012
x18: 00000000002b0ab0 x19: 00000000002b02b8
x20: 0000000000000001 x21: 0000000000000000
x22: 0000000000000000 x23: 00000000002b0288
x24: 0000000000000000 x25: 0000000000000000
x26: 0000000000000000 x27: 0000000000000000
x28: 0000000000000000 x29: 00000000002b0220

Do we need any boot script for rk3399?

These versions are designed to use the system settings used by DTB and startup parameters ( uEnv file.txt), which is used in Armbian and Libreelec.

Show the launch log of the latest Armbian versions (20.05) and the log from LE 20200319

@balbes150
I flashed Armbian 20.05 from the above link
using
sudo dd if=u-boot-rk3399-khadas-edge.img of=/dev/mmcblk0 seek=16384 conv=notrunc
Log here
I think I need the right sector information to flash is correctly.

You are writing u-boot incorrectly. Write the Armbian image to the SD card using the program (not the DD command ). Configure the DTB. Show the result of running u-boot in the Armbian system.

DRAM: 2 GiB

Do you have a model with 2 GB of RAM ?

No I have 4 gb version.

Which program?

I will write armbian img to an sd and share the logs in few mins.

Libreelec works fine without any issue.

You log


U-Boot 2017.09-g0bfc064 (Dec 05 2019 - 01:59:10 +0800)

Model: Khadas-RK3399 khadas Board

PreSerial: 2

DRAM: 2 GiB

Sysmem: init

Relocation Offset is: 7dbdd000

Using default environment