Edge2 building custom uboot with fenix can't use usb

Hello,

I am trying to build an U-Boot image using fenix however, the USB controller doesn’t work. Also, how do I build a TEE I can’t seem to find any way to build it for the Edge2 on U-boot mainline

To build U-Boot I am using the docker container from a Linux host, with the following steps,

  1. set the environment
  2. make uboot-image
  3. rockchip-burn build/images/Edge2_Uboot_SD_1.6.9.1-240916.img

if rockchip-burn fails I use upgrade_tool or rkdeveloptool instead, example with rkdeveloptool,

rkdeveloptool db rk3588_spl_loader_v1.07.111.bin
rkdeveloptool wl 0 Edge2_Uboot_SD_1.6.9.1-240916.img
rkdeveloptool rd

UART when using the U-boot mainline, it stays stuck on usb@fc840000 forever

kedge2# usb start
starting USB...
Bus usb@fc800000: USB EHCI 1.00
Bus usb@fc840000: 

UART when using U-boot 2017.09

kedge2# usb start
starting USB...
No working controllers found
kedge2# 

my end goal is to edit U-boot to debug a custom image. However, I cannot load it without the USB controller running. Any idea on why the USB isn’t working and how can I fix it ?

Hello @estak

@Jacobe will help you later.

Hello @estak

We update the rockchip firmware these two days, based on the latest version, I built a mainline uboot just now and didn’t reproduce your issus. Found that the date of your image is 0916, so maybe you can update our fenix and rebuild.
My u-boot log show like followings:

U-Boot SPL 2024.07 (Sep 19 2024 - 16:29:24 +0800)
Trying to boot from MMC2
spl: partition error
## Checking hash(es) for config config-1 ... OK
## Checking hash(es) for Image atf-1 ... sha256+ OK
## Checking hash(es) for Image u-boot ... sha256+ OK
## Checking hash(es) for Image fdt-1 ... sha256+ OK
## Checking hash(es) for Image atf-2 ... sha256+ OK
## Checking hash(es) for Image atf-3 ... sha256+ OK
INFO:    Preloader serial: 2
NOTICE:  BL31: v2.3():v2.3-765-g588059758:derrick.huang, fwver: v1.46
NOTICE:  BL31: Built : 18:13:16, Apr 29 2024
INFO:    spec: 0x13
INFO:    code: 0x88
INFO:    ext 32k is valid
INFO:    ddr: stride-en 4CH
INFO:    GICv3 without legacy support detected.
INFO:    ARM GICv3 driver initialized in EL3
INFO:    valid_cpu_msk=0xff bcore0_rst = 0x0, bcore1_rst = 0x0
INFO:    l3 cache partition cfg-0
INFO:    system boots from cpu-hwid-0
INFO:    disable memory repair
INFO:    idle_st=0x21fff, pd_st=0x11fff9, repair_st=0xfff70001
INFO:    dfs DDR fsp_params[0].freq_mhz= 2112MHz
INFO:    dfs DDR fsp_params[1].freq_mhz= 528MHz
INFO:    dfs DDR fsp_params[2].freq_mhz= 1068MHz
INFO:    dfs DDR fsp_params[3].freq_mhz= 1560MHz
INFO:    BL31: Initialising Exception Handling Framework
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0xa00000
INFO:    SPSR = 0x3c9


U-Boot 2024.07 (Sep 19 2024 - 16:29:24 +0800)

Model: Khadas Edge2
DRAM:  16 GiB
Core:  338 devices, 30 uclasses, devicetree: separate
MMC:   mmc@fe2c0000: 1, mmc@fe2e0000: 0
Loading Environment from nowhere... OK
In:    serial@feb50000
Out:   serial@feb50000
Err:   serial@feb50000
Model: Khadas Edge2
Net:   No ethernet found.
Hit SPACE in 2 seconds to stop autoboot
kedge2# usb start
starting USB...
Bus usb@fc800000: USB EHCI 1.00
Bus usb@fc840000: USB OHCI 1.0
Bus usb@fc880000: USB EHCI 1.00
Bus usb@fc8c0000: USB OHCI 1.0
Bus usb@fcd00000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@fc800000 for devices... 3 USB Device(s) found
scanning bus usb@fc840000 for devices... 1 USB Device(s) found
scanning bus usb@fc880000 for devices... 1 USB Device(s) found
scanning bus usb@fc8c0000 for devices... 1 USB Device(s) found
scanning bus usb@fcd00000 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
kedge2# usb storage
  Device 0: Vendor: NORELSYS Rev: 0    Prod: 1081            
            Type: Removable Hard Disk
            Capacity: 119279.7 MB = 116.4 GB (244284927 x 512)
kedge2# part list usb 0

Partition Map for usb device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     2048            244282846       64d284a6-01     07
kedge2# 

Both U-boot 2017.09 and U-boot mainline work well.

Also, how do I build a TEE I can’t seem to find any way to build it for the Edge2 on U-boot mainline

Because of TEE is not required, so didn’t set it as environment variable in U-boot mainline.

1 Like

Hello @Jacobe and thank you for your quick answer

(Sorry for the lateness in my answer the wifi is quite slow here)

I have re-downloaded the fenix repo and rebuilt the Docker however I still get the same problem. Also, in the new version running make uboot-image didn’t work unless I

  • changed permissions (I did chmod 777 -R ./fenix)
  • manually added the images dir (an error would occur in config/board/Edge2.conf@line 381)
U-Boot SPL 2017.09 (May 27 2024 - 18:36:20)
Failed to set cpub01
Failed to set cpub23
I2c2 speed: 100000Hz
MCU: boot mode 0x20: 1, flag 0x92: 0
board_boot_order: /chosen found, using spl_boot_device()
!!! same-as-spl: 
!!! /mmc@fe2c0000: 
!!! /mmc@fe2e0000: 
!!! /spi@fe2b0000/flash@1: 
Trying to boot from MMC2 :: 0
Card did not respond to voltage select!
mmc_init: -95, time 12
spl: mmc init failed with error: -95
Trying to boot from MMC1 :: 1
Trying fit image at 0x4000 sector
## Verified-boot: 0
## Checking atf-1 0x00040000 ... sha256(64122e141b...) + OK
## Checking u-boot 0x00a00000 ... sha256(286e45cd3a...) + OK
## Checking fdt-1 0x00adc628 ... sha256(a66943657c...) + OK
## Checking atf-2 0x000f0000 ... sha256(ce48b69fdd...) + OK
## Checking atf-3 0xff100000 ... sha256(ce8968e34f...) + OK
Jumping to U-Boot(0x00a00000) via ARM Trusted Firmware(0x00040000)
Total: 125.488 ms

INFO:    Preloader serial: 2
NOTICE:  BL31: v2.3():v2.3-765-g588059758:derrick.huang, fwver: v1.46
NOTICE:  BL31: Built : 18:13:16, Apr 29 2024
INFO:    spec: 0x13
INFO:    code: 0x88
INFO:    ext 32k is valid
INFO:    ddr: stride-en 4CH
INFO:    GICv3 without legacy support detected.
INFO:    ARM GICv3 driver initialized in EL3
INFO:    valid_cpu_msk=0xff bcore0_rst = 0x0, bcore1_rst = 0x0
INFO:    l3 cache partition cfg-0
INFO:    system boots from cpu-hwid-0
INFO:    disable memory repair
INFO:    idle_st=0x21fff, pd_st=0x11fff9, repair_st=0xfff70001
INFO:    dfs DDR fsp_params[0].freq_mhz= 2112MHz
INFO:    dfs DDR fsp_params[1].freq_mhz= 528MHz
INFO:    dfs DDR fsp_params[2].freq_mhz= 1068MHz
INFO:    dfs DDR fsp_params[3].freq_mhz= 1560MHz
INFO:    BL31: Initialising Exception Handling Framework
INFO:    BL31: Initializing runtime services
WARNING: No OPTEE provided by BL2 boot loader, Booting device without OPTEE initialization. SMC`s destined for OPTEE will return SMC_UNK
ERROR:   Error initializing runtime service opteed_fast
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0xa00000
INFO:    SPSR = 0x3c9


U-Boot 2024.07 (Sep 19 2024 - 11:58:21 +0000)

Model: Khadas Edge2
DRAM:  8 GiB
Core:  338 devices, 30 uclasses, devicetree: separate
MMC:   mmc@fe2c0000: 1, mmc@fe2e0000: 0
Loading Environment from nowhere... OK
In:    serial@feb50000
Out:   serial@feb50000
Err:   serial@feb50000
Model: Khadas Edge2
Net:   No ethernet found.
Hit SPACE in 2 seconds to stop autoboot
Scanning for bootflows in all bootdevs
Seq  Method       State   Uclass    Part  Name                      Filename
---  -----------  ------  --------  ----  ------------------------  ----------------
Scanning global bootmeth 'efi_mgr':
Card did not respond to voltage select! : -110
No EFI system partition
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
No EFI system partition
Failed to persist EFI variables
  0  efi_mgr      ready   (none)       0  <NULL>                    
** Booting bootflow '<NULL>' with efi_mgr
Loading Boot0000 'mmc 0' failed
EFI boot manager: Cannot load any image
Boot failed (err=-14)
Scanning bootdev 'mmc@fe2c0000.bootdev':
Card did not respond to voltage select! : -110
Scanning bootdev 'mmc@fe2e0000.bootdev':
Unknown uclass 'nvme' in label
Unknown uclass 'scsi' in label
Bus usb@fc800000: USB EHCI 1.00
Bus usb@fc840000: 

Also your U-boot SPL is dated to 09-19-24 however, there is no such version on http://dl.khadas.com/products/edge2/firmware/boot/. According to https://docs.khadas.com/products/sbc/edge2/development/linux/build-linux-uboot it should generate it when building U-boot but its not in my case.

Is the way I flash the U-boot image on the board wrong or its something else ?

Step into fenix and

$git pull

That will get fenix upto date

I have already git pulled, what I meant by re downloading was that I rm -rf the build directory

I’ve just tried to rebuild it from a Debian 12 computer and I still get the same error. I might be doing something wrong.

@Jacobe can you write the steps you went through from compilation to flash please ? What is your build environment so that I can replicate it.

$make uboot-clean

That will clean out the cache and you will have a fresh start on the current uboot.

It is correct on your side about the SPL version.

For Edge2, the default boot sequeue is:

DDR Loader (SPI Flash, from oowow) → SPL (SPI Flash, from oowow) → BL31 (SD card or eMMC) → BL32 (SD card or eMMC) → U-Boot (SD card or eMMC).

So if you have oowow on the SPI Flash, then it will use the DDR Loader and SPL from oowow, and then oowow SPL will select the next boot disk e.g. eMMC or SD card.

If you don’t have oowow on SPI Flash, e.g. you erase the SPI Flash, then the DDR Loder and SPL will from eMMC or SD card, so you can just take care of your U-Boot version.

Hello @estak

can you write the steps you went through from compilation to flash please ? What is your build environment so that I can replicate it.

The same as you, I also use docker on a Linux host to build the image. I tried to boot from eMMC.

eMMC:

  1. set the environment, mainline didn’t support eMMC image. So the make info shows like:
fenix$ make info

Version: 1.6.9.1
Current environment:
===========================================

#KHADAS_BOARD=Edge2
#VENDOR=Rockchip
#CHIP=RK3588S
#LINUX=6.1
#UBOOT=2017.09
#DISTRIBUTION=Ubuntu
#DISTRIB_RELEASE=noble
#DISTRIB_TYPE=gnome
#DISTRIB_ARCH=arm64
#INSTALL_TYPE=EMMC

===========================================
  1. make uboot-image
  2. rk-burn-tool -i fenix/build/images/Edge2_Uboot_EMMC_1.6.9.1-240920.img #rk-burn-tool can be download in our utils
  3. The console shows like:
U-Boot 2017.09 (Sep 20 2024 - 10:08:13 +0800)

Model: Khadas Edge2
MPIDR: 0x0
PreSerial: 2, raw, 0xfeb50000
DRAM:  16 GiB
Sysmem: init
Relocation Offset: eda08000
Relocation fdt: eb7f9c60 - eb7fece0
CR: M/C/I
Using default environment

Hotkey: ctrl+m
optee api revision: 2.0
mmc@fe2c0000: 1, mmc@fe2e0000: 0
Bootdev(atags): mmc 0
MMC0: HS400 Enhanced Strobe, 200Mhz
PartType: EFI
TEEC: Waring: Could not find security partition
DM: v2
264723 bytes read in 9 ms (28.1 MiB/s)
DTB(Distro): /dtb.img
No misc partition
boot mode: normal
usb dr_mode not found
usb dr_mode not found
I2c0 speed: 100000Hz
vsel-gpios- not found!
en-gpios- not found!
vdd_cpu_big0_s0 1000000 uV
vsel-gpios- not found!
en-gpios- not found!
vdd_cpu_big1_s0 1000000 uV
I2c2 speed: 100000Hz
vsel-gpios- not found!
en-gpios- not found!
vdd_npu_s0 825000 uV
gpio: pin 130 (gpio 130) value is 1
I2c6 speed: 100000Hz
Warn: can't find connect driver
Warn: can't get connect driver
get vp0 plane mask:0x5, primary id:2, cursor_plane:-1, from dts
get vp1 plane mask:0xa, primary id:3, cursor_plane:-1, from dts
get vp2 plane mask:0x140, primary id:8, cursor_plane:-1, from dts
get vp3 plane mask:0x280, primary id:9, cursor_plane:-1, from dts
Could not find baseparameter partition
Model: Khadas Edge2
spi2: RK806: 2
ON=0x40, OFF=0x00
FIT: No boot partition
No resource file: logo.bmp
failed to display uboot logo
CLK: (sync kernel. arm: enter 1008000 KHz, init 1008000 KHz, kernel 0N/A)
  b0pll 24000 KHz
  b1pll 24000 KHz
  lpll 24000 KHz
  v0pll 24000 KHz
  aupll 786431 KHz
  cpll 1500000 KHz
  gpll 1188000 KHz
  npll 850000 KHz
  ppll 1100000 KHz
  aclk_center_root 702000 KHz
  pclk_center_root 100000 KHz
  hclk_center_root 396000 KHz
  aclk_center_low_root 500000 KHz
  aclk_top_root 750000 KHz
  pclk_top_root 100000 KHz
  aclk_low_top_root 396000 KHz
Setting bus to 2
gpio: pin 138 (gpio 138) value is 1
gpio: pin 139 (gpio 139) value is 0
gpio: pin 140 (gpio 140) value is 0
Net:   No ethernet found.
Hit SPACE in 3 seconds to stop autoboot
kedge2# 
kedge2# 
kedge2# VERSION
Unknown command 'VERSION' - try 'help'
kedge2# version
U-Boot 2017.09 (Sep 20 2024 - 10:08:13 +0800)

aarch64-linux-gnu-gcc (Linaro GCC 7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]
GNU ld (Linaro_Binutils-2018.05) 2.28.2.20170706
kedge2# usb start
starting USB...
Bus usb@fc000000: usb maximum-speed not found
Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@fc800000: USB EHCI 1.00
Bus usb@fc840000: USB OHCI 1.0
Bus usb@fc880000: USB EHCI 1.00
Bus usb@fc8c0000: USB OHCI 1.0
Bus usb@fcd00000: usb maximum-speed not found
Failed to get USB PHY0 for usb@fcd00000
Port not available.
scanning bus usb@fc000000 for devices... 1 USB Device(s) found
scanning bus usb@fc800000 for devices... 3 USB Device(s) found
scanning bus usb@fc840000 for devices... 1 USB Device(s) found
scanning bus usb@fc880000 for devices... 1 USB Device(s) found
scanning bus usb@fc8c0000 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
kedge2# usb storage
  Device 0: Vendor: NORELSYS Rev: 0    Prod: 1081            
            Type: Removable Hard Disk
            Capacity: 119279.7 MB = 116.4 GB (244284927 x 512)
kedge2# 

And I reproduced the issus in mainline

UART when using the U-boot mainline, it stays stuck on usb@fc840000 forever

But I am little confused that why yesterday I can use usb start in mainline… I will recheck. Anyway, you can use U-boot 2017 first :wink:

I am still getting the same error as mentioned above : No working controllers found for the 2017 version. I’ve also tried on Ubuntu 24.04 with the same results.

Here are the build logs and the resulting image (Linux host, Docker),

for convenience sake i made a repo with the .img and the above dump https://github.com/EstAK/effective-octo-invention

What do you think is the issue ?

for convenience sake i made a repo with the .img and the above dump https://github.com/EstAK/effective-octo-invention

I used image in this repo, usb works well. Please post your log. This is my console log

U-Boot 2017.09 (Sep 20 2024 - 13:46:16 +0000)

Model: Khadas Edge2
MPIDR: 0x0
PreSerial: 2, raw, 0xfeb50000
DRAM:  16 GiB
Sysmem: init
Relocation Offset: eda08000
Relocation fdt: eb7f9c60 - eb7fece0
CR: M/C/I
Using default environment

optee api revision: 2.0
mmc@fe2c0000: 1, mmc@fe2e0000: 0
Bootdev(atags): mmc 0
MMC0: HS400 Enhanced Strobe, 200Mhz
PartType: EFI
TEEC: Waring: Could not find security partition
DM: v2
264723 bytes read in 9 ms (28.1 MiB/s)
DTB(Distro): /dtb.img
No misc partition
boot mode: normal
usb dr_mode not found
usb dr_mode not found
I2c0 speed: 100000Hz
vsel-gpios- not found!
en-gpios- not found!
vdd_cpu_big0_s0 675000 uV
vsel-gpios- not found!
en-gpios- not found!
vdd_cpu_big1_s0 675000 uV
I2c2 speed: 100000Hz
vsel-gpios- not found!
en-gpios- not found!
vdd_npu_s0 825000 uV
gpio: pin 130 (gpio 130) value is 1
I2c6 speed: 100000Hz
Warn: can't find connect driver
Warn: can't get connect driver
get vp0 plane mask:0x5, primary id:2, cursor_plane:-1, from dts
get vp1 plane mask:0xa, primary id:3, cursor_plane:-1, from dts
get vp2 plane mask:0x140, primary id:8, cursor_plane:-1, from dts
get vp3 plane mask:0x280, primary id:9, cursor_plane:-1, from dts
Could not find baseparameter partition
Model: Khadas Edge2
spi2: RK806: 2
ON=0x20, OFF=0x02
FIT: No boot partition
No resource file: logo.bmp
failed to display uboot logo
CLK: (sync kernel. arm: enter 1008000 KHz, init 1008000 KHz, kernel 0N/A)
  b0pll 24000 KHz
  b1pll 24000 KHz
  lpll 24000 KHz
  v0pll 24000 KHz
  aupll 786431 KHz
  cpll 1500000 KHz
  gpll 1188000 KHz
  npll 850000 KHz
  ppll 1100000 KHz
  aclk_center_root 702000 KHz
  pclk_center_root 100000 KHz
  hclk_center_root 396000 KHz
  aclk_center_low_root 500000 KHz
  aclk_top_root 750000 KHz
  pclk_top_root 100000 KHz
  aclk_low_top_root 396000 KHz
Setting bus to 2
gpio: pin 138 (gpio 138) value is 1
gpio: pin 139 (gpio 139) value is 0
gpio: pin 140 (gpio 140) value is 0
Net:   No ethernet found.
Hit SPACE in 3 seconds to stop autoboot
kedge2# usb start
starting USB...
Bus usb@fc000000: usb maximum-speed not found
Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@fc800000: USB EHCI 1.00
Bus usb@fc840000: USB OHCI 1.0
Bus usb@fc880000: USB EHCI 1.00
Bus usb@fc8c0000: USB OHCI 1.0
Bus usb@fcd00000: usb maximum-speed not found
Failed to get USB PHY0 for usb@fcd00000
Port not available.
scanning bus usb@fc000000 for devices... 1 USB Device(s) found
scanning bus usb@fc800000 for devices... 2 USB Device(s) found
scanning bus usb@fc840000 for devices... 1 USB Device(s) found
scanning bus usb@fc880000 for devices... 2 USB Device(s) found
scanning bus usb@fc8c0000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
kedge2# usb storage
  Device 0: Vendor: NORELSYS Rev: 0    Prod: 1081            
            Type: Removable Hard Disk
            Capacity: 119279.7 MB = 116.4 GB (244284927 x 512)
kedge2# 

Hello this is my log with the same image

U-Boot 2017.09 (Sep 20 2024 - 13:46:16 +0000)

Model: Khadas Edge2
MPIDR: 0x0
PreSerial: 2, raw, 0xfeb50000
DRAM:  8 GiB
Sysmem: init
Relocation Offset: eda08000
Relocation fdt: eb7f9c60 - eb7fece0
CR: M/C/I
Using default environment

optee api revision: 2.0
mmc@fe2c0000: 1, mmc@fe2e0000: 0
Bootdev(atags): mmc 0
MMC0: HS400 Enhanced Strobe, 200Mhz
PartType: EFI
TEEC: Waring: Could not find security partition
DM: v2
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
No misc partition
boot mode: normal
FIT: No boot partition
Failed to load DTB, ret=-2
No valid DTB, ret=-22
Failed to get kernel dtb, ret=-22
gpio: pin 130 (gpio 130) value is 1
rk_board_init: No bus 6
Model: Khadas Edge2
rockchip_set_serialno: could not find efuse/otp device
CLK: (sync kernel. arm: enter 1008000 KHz, init 1008000 KHz, kernel 0N/A)
  b0pll 24000 KHz
  b1pll 24000 KHz
  lpll 24000 KHz
  v0pll 24000 KHz
  aupll 24000 KHz
  cpll 1500000 KHz
  gpll 1188000 KHz
  npll 24000 KHz
  ppll 100000 KHz
  aclk_center_root 702000 KHz
  pclk_center_root 100000 KHz
  hclk_center_root 396000 KHz
  aclk_center_low_root 500000 KHz
  aclk_top_root 750000 KHz
  pclk_top_root 100000 KHz
  aclk_low_top_root 396000 KHz
Setting bus to 2
Failure changing bus number (-19)
No I2C bus selected
Error writing the chip: -19
gpio: pin 138 (gpio 138) value is 1
gpio: pin 139 (gpio 139) value is 0
gpio: pin 140 (gpio 140) value is 0
Net:   No ethernet found.
Hit SPACE in 3 seconds to stop autoboot
kedge2#            ver
U-Boot 2017.09 (Sep 20 2024 - 13:46:16 +0000)

aarch64-linux-gnu-gcc (Linaro GCC 7.3-2018.05) 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701]
GNU ld (Linaro_Binutils-2018.05) 2.28.2.20170706
kedge2# usb start
starting USB...
No working controllers found

Hello @estak

I reproduced all the issuses.

For U-boot v2017
U-boot v2017 used the dtb from kernel, we can found that in your log

DM: v2
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
No misc partition
boot mode: normal
FIT: No boot partition
Failed to load DTB, ret=-2
No valid DTB, ret=-22
Failed to get kernel dtb, ret=-22

So you can burn a complete image from here, and Hit SPACE at the boot-delay section. Usb should work well.

For mainline U-boot

Make sure all storage device are empty, both eMMC and SPI flash. Otherwise, after inputting usb start, the console stuck all the time. OOWOW stored in SPI flash, you can erase it in OOWOW=>Advanced=>SPI Flash options=>Erase SPI Flash Full.

Finally, use the mainline U-boot which is stored in SD card. Usb also works well :wink:

I have burned an Ubuntu server image however I don’t understand how you flash a new u-boot image on top of it ? If i use rk-burn-tool -i <uboot image> after burning the ubuntu image i still get the problem with the usb controller.

How did you burn the new uboot image ? What steps did you follow ?

Also I have the edge2 with the case therefore using the SD is quite unpractical in my case.

Furthermore, there is nothing clear on the wiki on how to do that maybe adding it would be nice.

I have burned an Ubuntu server image however I don’t understand how you flash a new u-boot image on top of it ?

After burning a Ubuntu server, if you burn a new U-boot image, the new one will overwrite the previous U-boot only. It will not affect the kernel part.

If i use rk-burn-tool -i <uboot image> after burning the ubuntu image i still get the problem with the usb controller.
How did you burn the new uboot image ? What steps did you follow ?

I usb burn-tool -v rk -i <complete image> to burn a desktop image, at U-boot stage, Usb works well. Then I use rk-burn-tool -i <uboot image> to overwrite the U-boot in previous complete image, usb also works well.

You said that still get the problem with the usb controller, so I hope you post the log to find out the reason :man_technologist:

1 Like

Hello,

when I flash Ubuntu from the link you sent,

burn-tool -v rk -i edge2-ubuntu-24.04-gnome-linux-6.1-fenix-1.6.8-240605-emmc.img

I have the following partition table,

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000040      0x00001fbf      loader1
        attrs:  0x0000000000000000
        type:   67ad7741-4638-47c6-a488-d396583e582a
        guid:   fbd4486a-e42c-448d-d4e9-7f5c324a7843
  2     0x00004000      0x00005fff      uboot
        attrs:  0x0000000000000000
        type:   3adea03d-c612-46ed-cff9-b79439f11561
        guid:   bbaf4f47-230d-45b6-feae-e4b35f300b00
  3     0x00006000      0x03a3dfbf      rootfs
        attrs:  0x0000000000000004
        type:   e582484a-9010-404a-899d-47bd16ba3fa8
        guid:   614e0000-0000-4b53-8000-1d28000054a9

after flashing my image of U-boot,

rk-burn-tool -i Edge2_Uboot_EMMC_1.6.9.1-240920.img   

I get the following partition table,

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00000040      0x00001fbf      loader1
        attrs:  0x0000000000000000
        type:   67ad7741-4638-47c6-a488-d396583e582a
        guid:   fbd4486a-e42c-448d-d4e9-7f5c324a7843
  2     0x00004000      0x0000bfff      uboot
        attrs:  0x0000000000000000
        type:   3adea03d-c612-46ed-cff9-b79439f11561
        guid:   bbaf4f47-230d-45b6-feae-e4b35f300b00
  3     0x0000c000      0x03a3dfbf      rootfs
        attrs:  0x0000000000000004
        type:   e582484a-9010-404a-899d-47bd16ba3fa8
        guid:   614e0000-0000-4b53-8000-1d28000054a9

Also, I tried to ext4ls mmc 0:3 / and I got,

  • after burning ubuntu → the root directory
  • after burning U-boot →
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **

it seems like whenever I burn the U-boot image I overwrite the kernel. Did you flash an Ubuntu image from the link you sent or did you build it yourself ?

The U-boot image that I have built is ~9MiB, it seems too big.

the log its about the same as before,

U-Boot 2017.09 (Sep 20 2024 - 13:46:16 +0000)

Model: Khadas Edge2
MPIDR: 0x0
PreSerial: 2, raw, 0xfeb50000
DRAM:  8 GiB
Sysmem: init
Relocation Offset: eda08000
Relocation fdt: eb7f9c60 - eb7fece0
CR: M/C/I
Using default environment

optee api revision: 2.0
mmc@fe2c0000: 1, mmc@fe2e0000: 0
Bootdev(atags): mmc 0
MMC0: HS400 Enhanced Strobe, 200Mhz
PartType: EFI
TEEC: Waring: Could not find security partition
DM: v2
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
No misc partition
boot mode: None
FIT: No boot partition
Failed to load DTB, ret=-2
No valid DTB, ret=-22
Failed to get kernel dtb, ret=-22
gpio: pin 130 (gpio 130) value is 1
rk_board_init: No bus 6
Model: Khadas Edge2
rockchip_set_serialno: could not find efuse/otp device
CLK: (sync kernel. arm: enter 1008000 KHz, init 1008000 KHz, kernel 0N/A)
  b0pll 24000 KHz
  b1pll 24000 KHz
  lpll 24000 KHz
  v0pll 24000 KHz
  aupll 24000 KHz
  cpll 1500000 KHz
  gpll 1188000 KHz
  npll 24000 KHz
  ppll 100000 KHz
  aclk_center_root 702000 KHz
  pclk_center_root 100000 KHz
  hclk_center_root 396000 KHz
  aclk_center_low_root 500000 KHz
  aclk_top_root 750000 KHz
  pclk_top_root 100000 KHz
  aclk_low_top_root 396000 KHz
Setting bus to 2
Failure changing bus number (-19)
No I2C bus selected
Error writing the chip: -19
gpio: pin 138 (gpio 138) value is 1
gpio: pin 139 (gpio 139) value is 0
gpio: pin 140 (gpio 140) value is 0
Net:   No ethernet found.
Hit SPACE in 3 seconds to stop autoboot
kedge2#         usb start
starting USB...
No working controllers found

I made an ext4 file system as a file and burned it in place of the rootfs partition with a dtb.img (extracted from the ubuntu image) at its root and the dtb error from uboot has disappeared. However, I still can’t start the USB.

process

to create the new rootfs (in linux),

dd if=/dev/zero of=<fs filename> bs=1 count=<size of the dtb.img + some margin>
mkfs.ext4 <fs filename>
mount <fs filename> /mnt
cp <extracted dtb.img> /mnt/dtb.img

flash it to the corresponding sector (in my case 0x6000 as shown in the above partition table),

rkdeveloptool db <spl loader>
rkdeveloptool wl 0x6000
rkdeveloptool rd

now, the file system at rootfs works

Hello @estak

Thanks for the partition table information. Due to we update the parameter for next version, so the address and offset of Uboot and rootfs have changed.

And my image is built by myself, that’s why we didn’t get the same error. I use the image from link has the same error with yours.

Anyway, U-boot USB can work well with buring a whole image, right? :wink:

1 Like

Hello @Jacobe

yes the usb works well when burning a whole image

1 Like