EDGE-V Boot Sequence & U-Boot

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

What version of LE ? Support for launching from USB is only available in my versions. Official versions do not support launching from USB.

Start LE from SD

U-Boot 2020.01 (Mar 19 2020 - 13:39:01 +0300)

Model: FriendlyElec NanoPC-T4
DRAM: 3.9 GiB
MMC: dwmmc@fe310000: 2, dwmmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from MMCā€¦ *** Warning - bad CRC, using default environment

In: serial@ff1a0000
Out: serial@ff1a0000
Err: serial@ff1a0000
Model: FriendlyElec NanoPC-T4
rockchip_dnl_key_pressed: adc_channel_single_shot fail!
Net:
Error: ethernet@fe300000 address not set.
No ethernet found.

Hit any key to stop autoboot: 0
starting USBā€¦
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3c0000: USB EHCI 1.00
Bus dwc3: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus dwc3: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@fe380000 for devicesā€¦ 1 USB Device(s) found
scanning bus usb@fe3c0000 for devicesā€¦ 1 USB Device(s) found
scanning bus dwc3 for devicesā€¦ 1 USB Device(s) found
scanning bus dwc3 for devicesā€¦ 1 USB Device(s) found
scanning usb for storage devicesā€¦ 0 Storage Device(s) found

Device 0: unknown device
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1ā€¦
Found U-Boot script /boot.scr
896 bytes read in 10 ms (86.9 KiB/s)
Executing script at 00500000
start mainline u-boot
163 bytes read in 9 ms (17.6 KiB/s)
Error: ā€œmacā€ not defined
Error: ā€œeth_macā€ not defined
Error: ā€œethaddrā€ not defined
27303944 bytes read in 1743 ms (14.9 MiB/s)
55837 bytes read in 23 ms (2.3 MiB/s)
Flattened Device Tree blob at 01f00000
Booting using the fdt blob at 0x1f00000
Host not halted after 16000 microseconds.
Loading Device Tree to 00000000f5f13000, end 00000000f5f23a1c ā€¦ OK

Starting kernel ā€¦

Start LE from USB

U-Boot 2019.10 (Jan 16 2020 - 17:13:16 +0300)

Model: Khadas Edge-V
DRAM: 3.9 GiB
Cannot find regulator pwm init_voltage
MMC: dwmmc@fe310000: 2, dwmmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from MMCā€¦ *** Warning - bad CRC, using default environment

In: serial@ff1a0000
Out: serial@ff1a0000
Err: serial@ff1a0000
Model: Khadas Edge-V
rockchip_dnl_key_pressed: adc_channel_single_shot fail!
Net:
Warning: ethernet@fe300000 (eth0) using random MAC address - 66:88:90:ed:5b:a2
eth0: ethernet@fe300000
Hit any key to stop autoboot: 0
starting USBā€¦
Bus usb@fe380000: USB EHCI 1.00
Bus usb@fe3c0000: USB EHCI 1.00
Bus dwc3: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus dwc3: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@fe380000 for devicesā€¦ 5 USB Device(s) found
scanning bus usb@fe3c0000 for devicesā€¦ 1 USB Device(s) found
scanning bus dwc3 for devicesā€¦ 1 USB Device(s) found
scanning bus dwc3 for devicesā€¦ 1 USB Device(s) found
scanning usb for storage devicesā€¦ 1 Storage Device(s) found

Device 0: Vendor: UFD 2.0 Rev: PMAP Prod: Silicon-Power4G
Type: Removable Hard Disk
Capacity: 3784.0 MB = 3.6 GB (7749632 x 512)
ā€¦ is now current device
Scanning usb 0:1ā€¦
Found U-Boot script /boot.scr
896 bytes read in 27 ms (32.2 KiB/s)
Executing script at 00500000
start mainline u-boot
163 bytes read in 23 ms (6.8 KiB/s)
Error: ā€œmacā€ not defined
Error: ā€œeth_macā€ not defined
Error: ā€œethaddrā€ not defined
26386440 bytes read in 1444 ms (17.4 MiB/s)
55837 bytes read in 62 ms (878.9 KiB/s)
Flattened Device Tree blob at 01f00000
Booting using the fdt blob at 0x1f00000
Host not halted after 16000 microseconds.
Loading Device Tree to 00000000f5f16000, end 00000000f5f26a1c ā€¦ OK

Starting kernel ā€¦

2 Likes