will Ubuntu 18.04 image be made for RK3399

was wondering if any plans to release a 18.04 image for RK3399 are in the works
as 16.04 does not support this board much

I’m wondering the same.

There is also a performance concern : tests I made on diverse SBCs show a huge improvement when using 18.04.

It’s easy to update to 18.04 yourself.

sudo sed -i -- 's/xenial/bionic/g' /etc/apt/sources.list
apt update && apt full-upgrade

is perfectly fine. You are probably running out of space on the eMMC if you use the factory image, but even then,

apt -f install && apt autoremove && apt clean && apt update && apt full-upgrade

once or twice gives you a running 18.04LTS system.

First thing I did with my RK3399.

I tried so to update my firefly 3399 from 16.04 to 18.04. But in my case there is an access error

E: Could not open lock file / var / lib / dpkg / lock - open (13: Permission denied)
E: Unable to lock the administration directory (/ var / lib / dpkg /), are you root?

I also tried to enter commands through the sudo but this did not change anything.

Cherry Posted at 9/15/2018 20:14
I tried so to update my firefly 3399 from 16.04 to 18.04. But in my case there is an access error

just Delete lock-open
sudo rm -f /var/lib/dpkg/lock-open

Getting this error

Errors were encountered while processing:
/var/cache/apt/archives/libgles2_1.0.0-2ubuntu2.2_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Actually, there’s a new ubuntu 18.04 for Firefly-RK3399 in

http://www.t-firefly.com/doc/download/page/id/3.html

But it is in Baidu Pan up till now. We’re working on moving it to Google Drive.

Here comes the Ubuntu 18.04 firmware for Firefly-RK3399, with Google Drive link:

https://drive.google.com/drive/folders/1lXa_jNT58aQU_089aMAW_4cDGF11F2ou

Uncompress the downloaded file using:

unxz -k Firefly-RK3399-ubuntu18.04_20181017.img.xz

This firmware uses the gpt partition scheme. Therefore you need the latest
v3.4 upgrade_tool to upgrade the firmware. Download it from:

http://download.t-firefly.com/product/RK3399/Tools/Linux_Upgrade_Tool/Linux_Upgrade_Tool_1.34.zip

To install upgrade_tool to /usr/local/bin, run:

unzip Linux_Upgrade_Tool_1.34.zip
cd Linux_Upgrade_Tool/Linux_Upgrade_Tool/
chmod 755 upgrade_tool
mv gpt_upgrade_tool
sudo cp gpt_upgrade_tool config.ini /usr/local/bin/

Now that flashing tool gpt_upgrade_tool and firmware file are ready.
To upgrade from the old ubuntu 16.04, the board needs to enter MaskRom mode.
There’re two methods:

  1. Using the cutting edge metal tweezers following:

    http://en.t-firefly.com/index.php/doc/product/info/id/479.html

  2. Or from the running Ubuntu 16.04, unplug the SD Card, and zero head zone of the eMMC by:

    sudo dd if=/dev/zero of=/dev/mmcblk? count=$((0x2000))

    Connect the TypeC cable with PC

    sudo reboot

Flash the firmware:

cd /path/to/the/Firefly-RK3399-ubuntu18.04_20181017.img
gpt_upgrade_tool uf Firefly-RK3399-ubuntu18.04_20181017.img

Good luck. If any question, write here. I’ll try my best to help.

Dear Penguin,

How is the 4K performance of this img? Is there any problem for sound and video? Did you meet same problems? If yes pls share your steps.

Hey Penguin,
I tried installing using your steps for ROC-RK3399-PC. But the upgrade tool wasn’t detecting it.
Can you provide a direct SD Boot image for ubuntu18?
Thanks!!

@Jack_P

You can download it at:
https://drive.google.com/drive/folders/1yLZsDDjpckgTdqTpgCQiZFCmj-DUbbwb

Jack_P Posted at 1/9/2019 23:06
Hey Penguin,
I tried installing using your steps for ROC-RK3399-PC. But the upgrade tool wasn’t det …

https://drive.google.com/drive/folders/1yLZsDDjpckgTdqTpgCQiZFCmj-DUbbwb

ROC-RK3399-PC-Ubuntu18.04-SDBOOT-xxxx.img

Not sure if this works for the Firefly-RK3399 or if I made a mistake
Edit - made a mistake. Ended up using the built in ubuntu tool to copy the image to the SD card and works great. Thanks all!

I have noticed here lately that it sometimes takes several reboots to get the firefly to boot the SD card, and

df

command is showing a different mmcblkX each time. Sometimes the firefly boots to SD and emmc isn’t even detected, most of the time it boots the emmc. Is there some surefire way to have it boot SD every time?

Edit - I suppose the obvious solution is to blank the emmc forcing the SD boot 100% of the time but it would be nice to have the option to fallback to emmc when the SD card is removed. Maybe this is just a quirk with my board, I can get it to boot the SD card pretty consistently with 3 reboots

Hi, @KD0OHR , do you have the serial adapter to access the log of u-boot?
That helps to identify the problem. Thanks!

penguin Posted at 2/20/2019 17:05
Hi, @KD0OHR , do you have the serial adapter to access the log of u-boot?
That helps to identify th …

What seems to be happening is that the SD controller under linux isn’t coming up right. What I see is the Ubuntu kernel boots, but the system ends up with the filesystem from the eMMC.

the full console logs are long, here’s a diff of the two in the interesting areas:

=====

— ubuntu_boot_worked_2_strip.txt 2019-03-05 14:18:47.228640500 -0500
+++ ubuntu_boot_right_kernel_wrong_fs_strip.txt 2019-03-05 14:12:44.554786500 -0500
@@ -1,6 +1,8 @@
+DDR Version 1.14 20180803
+In
Channel 0: DDR3, 800MHz
Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=1024MB
Channel 1: DDR3, 800MHz
Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=1024MB
256B stride
ch 0 ddrconfig = 0x101, ddrsize = 0x20
@@ -16,13 +18,13 @@
FwPartOffset=2000 , 100000
mmc0:cmd5,20
SdmmcInit=0 0
BootCapSize=0
UserCapSize=30528MB
FwPartOffset=2000 , 0
-StorageInit ok = 66344
+StorageInit ok = 233290
SecureMode = 0
SecureInit read PBA: 0x4
SecureInit read PBA: 0x404
SecureInit read PBA: 0x804
SecureInit read PBA: 0xc04
SecureInit read PBA: 0x1004
@@ -509,32 +511,31 @@
rockchip-iodomain ff770000.syscon:io-domains: Setting to 3300000 done
mmc_host mmc0: Bus speed (slot 0) = 400000Hz (slot req 400000Hz, actual 400000HZ div = 0)
dwmmc_rockchip fe320000.dwmmc: 1 slots initialized
sdhci-pltfm: SDHCI platform and OF driver helper
sdhci-arasan fe330000.sdhci: No vmmc regulator found
sdhci-arasan fe330000.sdhci: No vqmmc regulator found

  • rockchip-iodomain ff770000.syscon:io-domains: Setting to 3300000 done
  • rockchip-iodomain ff770000.syscon:io-domains: Setting to 1800000 done
    mmc1: SDHCI controller on fe330000.sdhci [fe330000.sdhci] using ADMA
    hidraw: raw HID events driver (C) Jiri Kosina
    usbcore: registered new interface driver usbhid
    usbhid: USB HID core driver
  • mmc_host mmc0: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
  • mmc0: new high speed SDHC card at address 0001
  • mmcblk0: mmc0:0001 EB1QT 29.8 GiB
    inv_mpu_iio: inv_mpu_init:746
    ff100000.saradc supply vref not found, using dummy regulator
    usbcore: registered new interface driver snd-usb-audio
  • mmcblk0: p1 p2 p3 p4 p5
    Initializing XFRM netlink socket
    NET: Registered protocol family 10
    NET: Registered protocol family 17
    NET: Registered protocol family 15
    Bluetooth: RFCOMM socket layer initialized
    Bluetooth: RFCOMM ver 1.11
    Bluetooth: HIDP (Human Interface Emulation) ver 1.2
    Bluetooth: HIDP socket layer initialized
    [WLAN_RFKILL]: Enter rfkill_wlan_init
  • mmc_host mmc0: Bus speed (slot 0) = 150000000Hz (slot req 150000000Hz, actual 150000000HZ div = 0)
    [BT_RFKILL]: Enter rfkill_rk_init
    Key type dns_resolver registered
    sensor_register_slave:mpu6880_gyro,id=50
    Error: Driver ‘ov4689’ is already registered, aborting…
    Error: Driver ‘ov13850’ is already registered, aborting…
    Registered cp15_barrier emulation handler
    @@ -548,50 +549,54 @@
    rockchip-drm display-subsystem: bound ff900000.vop (ops 0xffffff8008ce0b58)
    rockchip-vop ff8f0000.vop: missing rockchip,grf property
    [drm] no mcu-timing node found in /vop@ff8f0000
    rockchip-drm display-subsystem: bound ff8f0000.vop (ops 0xffffff8008ce0b58)
    i2c i2c-9: of_i2c: modalias failure on /hdmi@ff940000/ports
    dwhdmi-rockchip ff940000.hdmi: registered DesignWare HDMI I2C bus driver
  • mmc1: MAN_BKOPS_EN bit is not set
    dwhdmi-rockchip ff940000.hdmi: Detected HDMI TX controller v2.11a with HDCP (DWC HDMI 2.0 TX PHY)
    rockchip-drm display-subsystem: bound ff940000.hdmi (ops 0xffffff8008cd5ef8)
  • mmc1: MAN_BKOPS_EN bit is not set
    i2c i2c-10: of_i2c: modalias failure on /dp@fec00000/ports
    cdn-dp fec00000.dp: Direct firmware load for rockchip/dptx.bin failed with error -2
    rockchip-drm display-subsystem: bound fec00000.dp (ops 0xffffff8008cd6f18)
    [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
    [drm] No driver support for vblank timestamp query.
    mmc1: new HS400 Enhanced strobe MMC card at address 0001
    mmcblk1: mmc1:0001 AJTD4R 14.6 GiB
    mmcblk1boot0: mmc1:0001 AJTD4R partition 1 4.00 MiB
    mmcblk1boot1: mmc1:0001 AJTD4R partition 2 4.00 MiB
    mmcblk1rpmb: mmc1:0001 AJTD4R partition 3 4.00 MiB
    mmcblk1: p1 p2 p3 p4 p5
  • dwmmc_rockchip fe320000.dwmmc: Successfully tuned phase to 238
  • mmc0: new ultra high speed SDR104 SDHC card at address 0001
  • mmcblk0: mmc0:0001 EB1QT 29.8 GiB
  • mmcblk0: p1 p2 p3 p4 p5
    rockchip-vop ff900000.vop: [drm:vop_crtc_enable] Update mode to 1920x1200p60, type: 11
    Freeing drm_logo memory: 616K
    Console: switching to colour frame buffer device 240x75
    rockchip-drm display-subsystem: fb0: frame buffer device
    mali ff9a0000.gpu: GPU identified as 0x0860 r2p0 status 0
    mali ff9a0000.gpu: Protected mode not available
    mali ff9a0000.gpu: l=0 h=2147483647 hyst=5000 l_limit=0 h_limit=0
    mali ff9a0000.gpu: Using configured power model mali-simple-power-model, and fallback mali-simple-power-model
    mali ff9a0000.gpu: Probed as mali0
    xhci-hcd xhci-hcd.8.auto: xHCI Host Controller
    xhci-hcd xhci-hcd.8.auto: new USB bus registered, assigned bus number 1
  • vendor storage:20160801 ret = 0
    xhci-hcd xhci-hcd.8.auto: hcc params 0x0220fe64 hci version 0x110 quirks 0x02030010
    xhci-hcd xhci-hcd.8.auto: irq 225, io mem 0xfe800000
    usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb1: Product: xHCI Host Controller
    usb usb1: Manufacturer: Linux 4.4.154 xhci-hcd
    usb usb1: SerialNumber: xhci-hcd.8.auto
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    xhci-hcd xhci-hcd.8.auto: xHCI Host Controller
    xhci-hcd xhci-hcd.8.auto: new USB bus registered, assigned bus number 2
    usb usb2: We don’t know the algorithms for LPM for this host, disabling LPM.
  • vendor storage:20160801 ret = 0
    usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
    usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb2: Product: xHCI Host Controller
    usb usb2: Manufacturer: Linux 4.4.154 xhci-hcd
    usb usb2: SerialNumber: xhci-hcd.8.auto
    hub 2-0:1.0: USB hub found
    @@ -714,13 +719,13 @@
    [WLAN_RFKILL]: rockchip_wifi_get_oob_irq: rfkill-wlan driver has not Successful initialized
    usbcore: registered new interface driver rtl8188eu
    RTW: module init ret=0
    input: gpio-keys as /devices/platform/gpio-keys/input/input0
    ==gsl_ts_init==
    ret=0
  • rk808-rtc rk808-rtc: setting system clock to 2013-01-18 09:04:22 UTC (1358499862)
  • rk808-rtc rk808-rtc: setting system clock to 2013-01-18 08:50:24 UTC (1358499024)
    mmc2: queuing unknown CIS tuple 0x80 (2 bytes)
    mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
    mmc2: queuing unknown CIS tuple 0x80 (3 bytes)
    mmc2: queuing unknown CIS tuple 0x80 (7 bytes)
    ret 1024
    I : [File] : drivers/gpu/arm/mali400/mali/linux/mali_kernel_linux.c; [Line] : 417; [Func] : mali_module_init(); svn_rev_string_from_arm of this mali_ko is ‘’, rk_ko_ver is ‘5’, built at ‘11:19:13’, on ‘Feb 16 2019’.
    @@ -728,61 +733,335 @@
    ALSA device list:
    #0: rk-hdmi-dp-sound
    mmc_host mmc2: Bus speed (slot 0) = 100000000Hz (slot req 100000000Hz, actual 100000000HZ div = 0)
    dwmmc_rockchip fe310000.dwmmc: All phases work, using default phase 0.
    mmc2: queuing unknown CIS tuple 0x91 (3 bytes)
    mmc2: new ultra high speed SDR104 SDIO card at address 0001
  • EXT4-fs (mmcblk1p5): recovery complete
  • EXT4-fs (mmcblk1p5): mounted filesystem with ordered data mode. Opts: (null)
  • VFS: Mounted root (ext4 filesystem) on device 179:5.
  • devtmpfs: mounted
  • Freeing unused kernel memory: 1152K
    usb 2-1: new high-speed USB device number 2 using ehci-platform
  • cdn-dp fec00000.dp: Direct firmware load for rockchip/dptx.bin failed with error -2
  • EXT4-fs (mmcblk1p5): re-mounted. Opts: data=ordered
    +ng: OK
    +kchip Linux SDK
    +v using udev: [ 20.229077] udevd[186]: starting version 3.2.5
  • random: udevd: uninitialized urandom read (16 bytes read, 60 bits of entropy available)
  • random: udevd: uninitialized urandom read (16 bytes read, 60 bits of entropy available)
  • random: udevd: uninitialized urandom read (16 bytes read, 60 bits of entropy available)
  • random: udevd: uninitialized urandom read (16 bytes read, 60 bits of entropy available)
  • random: udevd: uninitialized urandom read (16 bytes read, 60 bits of entropy available)
  • cdn-dp fec00000.dp: [drm:cdn_dp_pd_event_work] Not connected. Disabling cdn
  • usb 2-1: New USB device found, idVendor=1a40, idProduct=0201
  • udevd[187]: starting eudev-3.2.5
  • usb 2-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
  • usb 2-1: Product: USB 2.0 Hub [MTT]
  • hub 2-1:1.0: USB hub found
  • hub 2-1:1.0: 7 ports detected
  • random: udevd: uninitialized urandom read (16 bytes read, 64 bits of entropy available)
    wifi_platform_bus_enumerate device present 1
    ======== Card detection to detect SDIO card! ========
    mmc2:mmc host rescan start!
    bcmsdh_register: register client driver
  • usb 2-1: New USB device found, idVendor=1a40, idProduct=0201
    bcmsdh_sdmmc_probe: Enter num=1
    bcmsdh_sdmmc_probe: Enter num=2
    bus num (host idx)=2, slot num (rca)=1
    found adapter info ‘DHD generic adapter’
    sdioh_attach: set sd_f2_blocksize 256
    sdioh_attach: sd clock rate = 0
    bcmsdh_probe: Host OOB irq is not defined
    sdioh_probe: bcmsdh_probe failed
    bcmsdh_sdmmc: probe of mmc2:0001:2 failed with error -12
  • usb 2-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
  • usb 2-1: Product: USB 2.0 Hub [MTT]
  • hub 2-1:1.0: USB hub found
  • hub 2-1:1.0: 7 ports detected
  • EXT4-fs (mmcblk0p5): recovery complete
  • EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Opts: (null)
  • VFS: Mounted root (ext4 filesystem) on device 179:5.
  • devtmpfs: mounted
  • Freeing unused kernel memory: 1152K

Hi @tek ,
From the log, eMMC is fixed to mmcblk1 and SD card is fixed to mmcblk0. Both are correct.

The rootfs is chosen from either mmcblk0p5 or mmcblk1p5.
What’s the root= parameter in the kernel cmdline?

plz paste result of: cat /proc/cmdline

Right. But what is happening is that the SD seems to intermittently not come up consistently (sometimes as 50MHz, sometimes as 150MHZ, sometimes as “high speed” and sometimes as “ultra speed”) , causing the OS to use the rootfs from the eMMC.

More important: it appears that both the eMMC image (built from the “linux SDK”) and the Ubuntu 18.04 SD image have the same PARTUUID (614e0000-0000-4b53-8000-1d28000054a9) - which is A Bad Thing.

I edited partition 3 of the Ubuntu SD image to put a unique PARTUUID in the kernel command line inside that partition, and then changed the PARTUUID of partition 5 to match.

The SD now boots correctly every time.

So: the different images should be generated with different rootfs PARTUUIDs and the kernel command lines modified to match.

@tek

You are right. Using the same PARTUUID is the culprit.

SD seems to intermittently not come up consistently (sometimes as 50MHz, sometimes as 150MHZ, sometimes as “high speed” and sometimes as “ultra speed”)

This needs further investigation. What sd card do you use?