Jump to content

CSC Armbian for RK322x TV box boards


jock

Recommended Posts

DISCLAIMERS (PLEASE READ):

  • Everything you can find in this thread (binaries, texts, code snippets, etc...) are provided AS-IS and are not part of official Armbian project. For this reason not people from Armbian project nor myself are responsible for misuse or loss of functionality of hardware.
  • THIS POST explains very well the troubles with TV Boxes and why they are not suitable for everyone
  • Please don't ask about support or assistance in other non-community forums nor in the official Armbian github repository, instead post your questions in this thread, in the TV Boxes forum section (hardware related) or in the Peer-to-peer support section (general linux/software related).

 

Following the recent thread on LibreElec forum about an unofficial image for rk3229 devices, I would like to make public the work made by me and @fabiobassa about bringing rk322x support to armbian.

The project is now in -> mainline Armbian <- development fork -> here <-

 

Mainline kernel is fully supported and will receive most support in the future. Legacy kernel 4.4 is deprecated, but is kept around only for special purposes.

 

What works:

  • Should boot and work flawlessy on all boards with RK3228a, RK3228b and RK3229, with either DDR2 and DDR3 memories.
  • Mainline u-boot
  • Proprietary OPTEE provided as Trusted Execution Environment (needed for DRAM frequency scaling)
  • All 4 cores are working
  • Ethernet
  • Serial UART (configured at 115200 bps, not 1.5Mbps!)
  • Thermals, CPU and DRAM frequency scaling
  • OTG USB 2.0 port (also as boot device!)
  • EHCI/OHCI USB 2.0 ports
  • MMC subsystem (including eMMC, SD and sdio devices)
  • Hardware video acceleration
  • NAND is available only on legacy kernel. To fully boot from NAND, use the Multitool and its steP-nand installation (instructions are below)
  • Various WIFI over SDIO are supported (SSV6051P, SSV6256P, ESP8089, Realtek chips, etc...), ssv6256p driver is available only on legacy kernel
  • Full GPU acceleration
  • U-boot boot order priority: first the sdcard, then the USB OTG port and eventually the internal eMMC; you can install u-boot (and the whole system) in the internal eMMC and u-boot will always check for images on external sdcard/USB first.

 

Unbrick:

Technically, rockchip devices cannot be bricked. If the internal flash does not contain a bootable system, they will always boot from the sdcard. If, for a reason, the bootable system on the internal flash is corrupted or is unable to boot correctly, you can always force the maskrom mode shorting the eMMC clock pin on the PCB. Here there is the procedure, but you can also google around if you get stuck on a faulty bootloader, the technique is pretty simple and requires a simple screwdriver.

 

There are however some unfortunate cases (expecially newer boards) where shorting the eMMC clock pin is difficult or impossibile, like eMMC or eMCP BGA chips with no exposed pins. In those cases pay double attention when burning something on the internal eMMC/eMCP and always test first the image from the sdcard to be sure it works before burning anything on eMMC/eMCP.

 

Some useful links with pins, pads or procedures for some boards:

 

NAND vs eMMC vs eMCP difference:

RK3228 and RK3229 tv boxes comes with three different flash memory chips: eMMC, NAND and eMCP.

It does not depend upon the market name of the tv box and neither the internal board; manufacturers put whatever they find cheaper when they buy the components.

 

  • NAND chip is just the non-volatile memory
  • eMMC chip contains both the non-volatile memory plus a controller.
  • eMCP chip contains the non-volatile memory, a controller for the non-volatile memory (like eMMC), but also contains a bank of DDR SDRAM memory on the same physical chip.

 

The difference is very important, because eMMC and eMCP are far easier to support at various levels: the controller deals with the physical characteristics of the non-volatile memory, so the software has no to deal with.

NAND chips instead are harder to support, because the software is required to deal with the physical characteristics and non-standard things that depends upon the NAND manufacturer.

 

If you have a NAND chips you're unlucky because mainline kernel currently cannot access it, but also because you need special care and instructions explained later.

 

You can discover if you have a NAND, eMMC or eMCP chip looking on the board are reading the signature on the flash memory chip.

The Multitool (see later) also can detect which chip you have onboard: the program will warn you at startup if you have a NAND chip.

 

NAND bootloader upgrade:

IMPORTANT: don't do this is you have an eMMC or eMCP; skip this paragraph if you are unsure too!

For very expert people who are having issues when (re)booting images, there is the chance to upgrade the bootloader on NAND.

The NAND bootloader is nothing else than a regular idbloader (see official rockchip documentation) but contains some bits to correctly access the data on your flash memory.

Upgrading requires to erase the existing flash content, in the worst case will require you to follow the Unbrick procedure above or restore an older but more compatible bootloader.

If you are not mentally ready to overcome possible further issues, don't do this!

 

The detailed instructions and the binaries are available at this post

 

Multimedia:

 

Brief explanation about kernel naming:

  • current kernel is the mainline LTS kernel version, most maintained and tested. This is the suggested version for production devices. If you don't know what to pick, pick this.
  • legacy kernel (version 4.4) is provided by manufacturer; it is deprecated, unmaintained and not suggested.
  • edge kernel is the development mainline kernel version, with experimental features and drivers; usually stable but perhaps suitable for production devices.

 

You can switch from one kernel flavour to another using armbian-config or manually via apt.

 

Installation (via SD card):

Building:

You can build your own image follow the common steps to build armbian for other tv boxes devices: when you are in the moment to choose the target board, switch to CSC/TVB/EOL boards and select "rk322x-box" from the list.

 

Download images from the following:

 

Archived images (August 2021 and before):

https://armbian.hosthatch.com/archive/rk322x-box/archive/

 

Multitool:

The Multitool is a small but powerful tool to do quick backup/restore of internal flash, but also burn images and general system rescue and maintenance via terminal or SSH.

Compressed images will be uncompressed on fly.

 

Quick installation instructions on eMMC:

  • Build or download your preferred Armbian image and a copy of the Multitool;
  • Burn the Multitool on an SD card; once done, place the Armbian image in images folder of the SD card NTFS partition;
  • Plug the SD card in the TV box and plug in the power cord. After some seconds the blue led starts blinking and the Multitool appears;
  • OPTIONAL: you can do a backup of the existing firmware with "Backup flash" menu option;
  • Choose "Burn image to flash" from the menu, then select the destination device (usually mmcblk2) and the image to burn;
  • Wait for the process to complete, then choose "Shutdown" from main menu;
  • Unplug the power cord and the SD card, then replug the power cord;
  • Wait for 10 seconds, then the led should start blinking and HDMI will turn on. The first time the boot process will take a couple of minutes or more because the filesystem is going to be resized, so be patient and wait for the login prompt.
  • On first boot you will be asked for entering a password for root user of your choice and the name and password for a regular user
  • Run sudo rk322x-config and select your board characteristics to enable leds, wifi chips, high-speed eMMC, etc...
  • Run sudo armbian-config to configure timezone, locales and other personal options
  • Congratulations, Armbian is now installed and configured!

 

Despite the procedure above is simple and reliable, I always recommend to first test that your device boots Armbian images from SD Card.

Due to the really large hardware variety, there is the rare chance that the images proposed here may not boot. If a bad image is burned in eMMC, the box may not boot anymore forcing you to follow the unbrick section at the top of this post.

 

Quick installation instructions on NAND:

  • Build or download your preferred Armbian image and a copy of the Multitool;
  • Burn the Multitool on an SD card; once done, place the Armbian legacy kernel image in images folder of the SD card NTFS partition;
  • Plug the SD card in the TV box and plug in the power cord. After some seconds the blue led starts blinking and the Multitool appears;
  • OPTIONAL: you can do a backup of the existing firmware with "Backup flash" menu option;
  • Choose "Burn Armbian image via steP-nand" from the menu, then select the destination device (usually rknand0) and the image to burn;
  • Wait for the process to complete, then choose "Shutdown" from main menu;
  • Unplug the power cord and the SD card, then replug the power cord;
  • Wait for 10 seconds, then the led should start blinking and HDMI will turn on. The first time the boot process will take a couple of minutes or more because the filesystem is going to be resized, so be patient and wait for the login prompt.
  • On first boot you will be asked for entering a password for root user of your choice and the name and password for a regular user
  • Run sudo rk322x-config and select your board characteristics to enable leds, wifi chips, etc...
  • Run armbian-config to configure timezone, locales and other personal options
  • Congratulations, Armbian is now installed!

 

Alternative: you can install the bootloader in NAND and let it boot from SD Card or USB:

  • Download a copy of the Multitool and burn it on an SD card;
  • Plug the SD card in the TV box and plug in the power cord. After some seconds the blue led starts blinking and the Multitool appears;
  • RECOMMENDED: make a backup of the existing firmware with "Backup flash" menu option;
  • Choose "Install Jump Start for Armbian" menu option: the Jump Start uses the internal NAND to boot from external SD Card or external USB Stick;
  • Follow the general instructions to boot from SD Card below, skip the first erase eMMC step.

 

Quick installation instructions to boot from SD Card:

  • If you are already running Armbian from eMMC, skip to the next step. Instead if you are running the original firmware you need to first erase the internal eMMC; to do so download the Multitool, burn it on an SD Card, plug the SD Card and power the TV Box. Use "Backup flash" if you want to do a backup of the existing firmware, then choose "Erase flash" menu option.
  • Build or download your preferred Armbian image;
  • Uncompress and burn the Armbian image on the SD Card;
  • Plug the SD Card in the TV Box and power it on;
  • Wait for 10 seconds, then the led should start blinking and HDMI will turn on. The first time the boot process will take a couple of minutes or more because the filesystem is going to be resized, so be patient and wait for the login prompt;
  • On first boot you will be asked for entering a password for root user of your choice and the name and password for a regular user
  • Run sudo rk322x-config and select your board characteristics to enable leds, wifi chips, high-speed eMMC or NAND, etc...
  • Run armbian-config to configure timezone, locales and other personal options, or also to transfer the SD Card installation to internal eMMC;
  • Congratulations, Armbian is running from SD Card!

 

A note about boot device order:

With Armbian also comes mainline U-boot. If you install Armbian or just the bootloader in the eMMC or the Jump Start on internal NAND, the bootloader will look for valid bootable images in this order:

  • External SD Card
  • External USB Stick in OTG Port
  • Internal eMMC

 

Installation (without SD card, board with eMMC)

If you have no sd card slot and your board has an eMMC, you can burn the armbian image directly on the internal eMMC using rkdeveloptool and a male-to-male USB cable:

 

  • Download your preferred Armbian image from Armbian download page and decompress it.
  • Download the rk322x bootloader: rk322x_loader_v1.10.238_256.bin
  • Download a copy of rkdeveloptool: a compiled binary is available in the official rockchip-linux rkbin github repository.
  • Unplug the power cord from the tv box
  • Plug an end of an USB Male-to-male cable into the OTG port (normally it is the lone USB port on the same side of the Ethernet, HDMI, analog AV connectors) while pressing the reset microbutton with a toothpick. You can find the reset microbutton in a hole in the back of the box, but sometimes it is hidden into the AV analog jack
  • Plug the other end of the USB Male-to-male cable into an USB port of your computer
  • If everything went well, run lsusb: you should see a device with ID 2207:320b
  • Run sudo rkdeveloptool rd 3 (if this fails don't worry and proceed to next step)
  • Run sudo rkdeveloptool db rk322x_loader_v1.10.238_256.bin
  • Run sudo rkdeveloptool wl 0x0 image.img (change image.img this with the real Armbian image filename)
  • Unplug the power cord
  • Done!

 

Installation (without SD card, board with NAND)

If you are in the unfortunate case you can't use an SD card for installation and your board has a NAND chip, you still have an option to use the quick Multitool installation steps via USB.

 

  • Obtain a copy of rkdeveloptool: a compiled binary is available in the official rockchip-linux rkbin github repository.
  • Unplug the power cord from the tv box
  • Plug an end of an USB Male-to-male cable into the OTG port (normally it is the lone USB port on the same side of the Ethernet, HDMI, analog AV connectors) while pressing the reset microbutton with a toothpick. You can find the reset microbutton in a hole in the back of the box, but sometimes it is hidden into the AV analog jack
  • Plug the other end of the USB Male-to-male cable into an USB port of your computer
  • If everyting went well, using lsusb you should see a device with ID 2207:320b
  • Run sudo rkdeveloptool wl 0x4000 u-boot-main.img (download u-boot-main.img.xz , don't forget to decompress it!)
  • Unplug the power cord

 

Now you can follow the instructions on how to install on eMMC/NAND via SD card, just use instead an USB stick to do all the operations and plug it into the USB OTG port. Once you reboot, USB OTG port will be used as a boot device.

 

NOTE: NAND users without SD slot may be unhappy to know that it will be difficult to do extra maintenance with Multitool in case something breaks in the installed Armbian system: installing u-boot-main.img makes the installed system unbootable because it is missing the NAND driver.

 

 

Alternative backup, restore and erase flash for EXPERTS:

These backup, restore and erase flash procedures are for experts only. They are kept here mostly for reference, since the Multitool is perfectly able to do same from a very comfy interface and is the suggested way to do maintenance.

 

Backup:

  • Obtain a copy of rkdeveloptool: a compiled binary is available in the official rockchip-linux rkbin github repository. If you prefer, you can compile it yourself from the sources available at official rockchip repository
  • Unplug the power cord from the tv box
  • Plug an end of an USB Male-to-male cable into the OTG port (normally it is the lone USB port on the same side of the Ethernet, HDMI, analog AV connectors) while pressing the reset microbutton with a toothpick. You can find the reset microbutton in a hole in the back of the box, but sometimes it is hidden into the AV analog jack
  • Plug the other end of the USB Male-to-male cable into an USB port of your computer
  • If everyting went well, using lsusb you should see a device with ID 2207:320b
  • change directory and move into rkbin/tools directory, run ./rkdeveloptool rfi then take note of the FLASH SIZE megabytes (my eMMC is 8Gb, rkdeveloptool reports 7393 megabytes)
  • run ./rkdeveloptool rl 0x0 $((FLASH_SIZE * 2048)) backup.data (change FLASH_SIZE with the value you obtained the step before)
  • once done, the internal eMMC is backed up to backup.data file

 

Restore: first we have to restore the original bootloader, then restore the original firmware.
Running rkdeveloptool with these switches will accomplish both the jobs:

./rkdeveloptool db rk322x_loader_v1.10.238_256.bin
Downloading bootloader succeeded.

./rkdeveloptool ul rk322x_loader_v1.10.238_256.bin
Upgrading loader succeeded.

./rkdeveloptool wl 0x0 backup.data
Write LBA from file (100%)

Download here:

 

Erase the flash memory: clearing the internal eMMC/NAND memory makes the SoC look for external SD Card as first boot option.

If there isn't any suitable SD Card, the SoC enters maskrom mode, which can then be used for full eMMC/NAND access using rkdeveloptool. This is perfectly fine if your box has an eMMC flash memory.

NOTE: In case you have a NAND flash memory this option is however discouraged. The original bootloader contains some special parameters to correctly access the data. Clearing the flash memory will probably garbage the NAND data and restoring the bootloader may require some special instructions.

 

  • Obtain a copy of rkdeveloptool: a compiled binary is available in the official rockchip-linux rkbin github repository. If you prefer, you can compile it yourself from the sources available at official rockchip repository
  • Unplug the power cord from the board
  • Plug an end of an USB Male-to-male cable into the OTG port (normally it is the lone USB port on the same side of the Ethernet, HDMI, analog AV connectors) while pressing the reset microbutton with a toothpick. You can find the reset microbutton in a hole in the back of the box, but sometimes it is hidden into the AV analog jack
  • Plug the other end of the USB Male-to-male cable into an USB port of your computer
  • If everyting went well, using lsusb you should see a device with ID 2207:320b
  • run ./rkdeveloptool ef and wait a few seconds
  • once done, the internal eMMC is erased and the device will boot from the sdcard from now on

 

Partecipation and debugging:

If you want to partecipate or need help debugging issues, do not hesitate to share your experience with the installation procedure of the boxes.

In case of issues and missed support, provide as many as possible of these things is very useful to try and bring support for an unsupported board:

 

  • some photos of both sides of the board. Details of the eMMC, DDR and Wifi chips are very useful!
  • upload the device tree binary (dtb) of your device. We can understand a lot of things of the hardware from that small piece of data; and alternative is a link to the original firmware (you can do a full backup with the Multitool);
  • dmesg and other logs (use armbianmonitor -u that automatically collects and uploads the logs online)
  • attach a serial converter to the device and provide the output of the serial port;

 

Critics, suggestions and contributions are welcome!

 

Credits:

  • @fabiobassa for his ideas, inspiration, great generosity in giving the boards for development and testing. The project of bringing rk322x into armbian would not have begun without his support!
  • Justin Swartz, for his work and research to bring mainline linux on rk3229 (repository here)
  • @knaerzche for his great contribution to libreelec support and mainline patches
  • @Alex83 for his patience in testing the NAND bootloader upgrade procedure on his board
  • @Jason Duhamell for his generous donation that allowed researching eMCP boards and esp8089 wifi chip
Link to comment
Share on other sites

Hey,

great - somebody else is working on this too - just talked about adding an armbian recpie in LE forums. I will look deeper in your work the next days (and armbian in general) - and maybe add some contribs.

Some question beforehand:
1. How far is mainline kernel support? (Saw some commits in your repo)

2. How about using wayland instead of X?

Link to comment
Share on other sites

23 hours ago, knaerzche said:

Hey,

great - somebody else is working on this too - just talked about adding an armbian recpie in LE forums. I will look deeper in your work the next days (and armbian in general) - and maybe add some contribs.

Some question beforehand:
1. How far is mainline kernel support? (Saw some commits in your repo)

2. How about using wayland instead of X?

Mainline kernel is working mostly well for headless or simple terminal-based jobs. HDMI and DRM have some issues and probably the device tree is not complete: some video-related IRQs are not caught and the kernel blames for that.

I didn't test it very much, but other devices like ethernet, mmc and USB subsystems seems to be already stable enough.

Wayland would be great and would avoid dealing with mali blobs, but at the moment just inserting the lima module causes the kernel to issue a stack dump. DRM also is not in a very usable state.

 

I can't give many more details about mainline because at the moment the focus is on the legacy kernel to see what we can get from the SoC and boards; once the situation stabilizes on the legacy 4.4 kernel I'll happily give more love to mainline.

 

Mainline u-boot instead is in good shape for rk3229, I just recently added support for USB booting from the OTG port, but it still requires some fine-tuning to be really usable.

Link to comment
Share on other sites

@jock - i think at least on newer rk3229 boxes (with a newer boot loader) you seem to be able to boot from sd card without having to erase the emmc content. i just did an experiment on my r394k rk3229 box: i took your ubuntu image and later took the root fs from it, then dd'ed the first 16mb (boot stuff) from a working libreelec build (https://github.com/knaerzche/LibreELEC.tv/releases/tag/RK322x-le92-0bca75f and https://forum.libreelec.tv/thread/21117-unoffical-le-9-2-images-for-rk3229-rk3228/?pageNo=1) to a fresh sd card, created a partition on it starting at sector 32768 (to not overwrite the boot stuff), made that active in fdisk (not sure if this is really required for u-boot to search for its extlinux there), created an ext4 fs on it, rsynced your image root fs to it, created an /extlinux/extlinux.conf with the following content:

TIMEOUT 30
DEFAULT rk3229

MENU TITLE rk3229 boot options

LABEL rk3229
      MENU LABEL rk3229 kernel
      LINUX ../boot/vmlinuz-4.4.189-rk322x
      FDT ../boot/dtb-4.4.189-rk322x/rk3229-r329q.dtb
      INITRD ../boot/initrd.img-4.4.189-rk322x
      APPEND earlyprintk root=UUID=<put-your-root-fs-uuid-here> console=ttyS2,115200n8 console=tty0 rootwait rootfstype=ext4 consoleblank=0 loglevel=8

adjusted the root fs uuid accordingly, put the sd card into the box and powered it on ... and it booted fine from the sd card although the android on the internal emmc is still there. i noticed something similar on a rk3318 box too: the rockchip bootloader initial stages seem to load a u-boot.img from the sd card if there is one there (i think it was at sector 16384 offset) and i think this is how it works here: emmc boot loader starts with its first stage and sees that there is a u-boot.img stage on the sd-card and starts this one and from there it goes on.

 

with my box the system boots to a login prompt and then i think tries to start x11 - there it seems to hang and the keyboard got dead (num lock which is working fine during boot does not respond anymore - i tried all usb ports etc., mouse is still fine though, i.e. it got power still and its led was on) so that i cannot switch back to the console. i tried to disable the x11 startup on the root fs of the image but failed - do you know a quick way to disable it directly on the filesystem? do you have an idea why the system locks up? sadly this box does not seem to have serial console connectors :(

 

is your kernel supposed to work on rk3228a too? if yes, then i might give it a try on my mk809iv as well ...

 

a lot of thanks for your work on getting armbian working on those boxes and best wishes - hexdump

Link to comment
Share on other sites

update: i just tried the same with my own ubuntu root fs and got it booting to modesetting x11 fine - but always, be it in x11 or on the console, after nearly exactly 1 minute after powering on the system the screen goes black and the system hangs ... i think i read something about that and that there was a fix for that - do you maybe know the fix? looks a bit like some watchdog thing or something similar ...

 

a lot of thanks in advance and best wishes - hexdump

Link to comment
Share on other sites

@hexdump 

In my case study ( and I own many different boards)I always found a uart somewhere, maybe little copper pads but always I found a uart for debugging
if you post a photo of your board up/down maybe we can identify them

I can confirm that the buildings from @jock are working fine and never happened that boots and hangs: if boot it works, otherwise no boot occurs, because of 1) wrong ddr settings 2) wrong trust OS but this is easily debugged by uart

we can summarise 3 BIG categories of boards:
3228 ddr 2 ( NO dinamic frequency scaling of ddr speed DMC)
3228 ddr 3 ( DMC is working fine)

3229 ( well exactly even here ddr2 and ddr3 but.... let's assume newer 3229 have only ddr3)

3229images will not boot on 3228 because different trst OS (thanks @knaerzche for all those USEFULL infos)

 

and yes if on the original emmc/nand is present the loader and some other little stuffs then the board looks for uboot on sd , without touching the internal process and the boot occurs from external SD

Just to be complete, give a try to  this rootfs :

https://drive.google.com/open?id=1jmtwGs88iXfCs7UtaEv1d5h7C9-9KGFg

 

EDIT : if we find the UART put the command line to both ttyS2

Link to comment
Share on other sites

here are some images of the board ... i think i just fried a serial to usb converter while testing the three copper pins on the back side a few minutes ago ... in general: the box is booting perfectly fine, its just that it hangs / shuts down or whatever exactly one minute after the box was powered up for any kind of image i try (libreelec, armbian) ... i also tried to extract the trust.img via rkdeveloptool from emmc (rkdeveloptool rl 0x4000 0x2000 rl-0x4000-0x2000.out) and wrote it to the proper position on the sd card (dd if=rl-0x4000-0x2000.out of=/dev/sdx bs=512 seek=12288) but it did not make any difference in the end ...

 

update: the offset for writing it to the sd card was wrong above - here are the proper commands and now the box is working fine :)

rkdeveloptool rl 0x4000 0x2000 rl-0x4000-0x2000.out

dd if=rl-0x4000-0x2000.out of=/dev/sdx bs=512 seek=24576

 

but if the board looks familiar to you and you know where the serial port connectors are, i would still be interested to know that ...

 

r39-4k-01.jpg

r39-4k-02.jpg

Link to comment
Share on other sites

no this board isn't familiar to me (this lovely chinese producters ) and yes I told you that if booting then the board will work smoothless

Looks interesting the 3 pads on the right of white led and, if you manage to program the internal emmc/nand, then you will have uart even on one of the pads of SD reader ( of course you soul'dnt insert sd )

Link to comment
Share on other sites

one thing is a bit strange: the box is supposed to have 2gb of ram and even the android dmesg shows 2gb of ram which usually can be trusted quite well but with linux i only see 1 gb and some strange high memory remarks:

[    0.000000] Truncating RAM at 0x60000000-0xe0000000 to -0xa0000000
[    0.000000] Consider using a HIGHMEM enabled kernel.
...
[    0.000000] On node 0 totalpages: 258560
[    0.000000] free_area_init_node: node 0, pgdat b1228ec0, node_mem_map e76ba000
[    0.000000]   Normal zone: 2304 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 258560 pages, LIFO batch:31
...
[    0.000000] Memory: 866500K/1034240K available (12835K kernel code, 867K rwdata, 3160K rodata, 800K init, 580K bss, 36668K reserved, 131072K cma-reserved)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
                   lowmem  : 0xb0000000 - 0xf0000000   (1024 MB)
                   modules : 0xaf000000 - 0xb0000000   (  16 MB)
                     .text : 0xb0008000 - 0xb0c910dc   (12837 kB)
                     .init : 0xb1094000 - 0xb115c000   ( 800 kB)
                     .data : 0xb115c000 - 0xb1234da4   ( 868 kB)
                      .bss : 0xb1236000 - 0xb12c7174   ( 581 kB)

does the rk3229 support 2gb of ram natively without any tricks?

 

and another question: are there any mali blobs (x11, fbdev, wayland) available or working for rk3229?

 

best wishes - hexdump

Link to comment
Share on other sites

about the memory, yes my board has 2 giga and I see all 2 giga without problems but maybe @jock will answer better to this question

about mali &co :D if you use the linaro rootfs ALL is already included, otherwise the mali.ko is already compiled in kernel, the userspace *.so you can download from here

https://github.com/rockchip-linux/libmali/tree/29mirror/lib/arm-linux-gnueabihf

 

of course choose the one fro your use ( utgard mali 400 and then choose fb or gbm or what you need)

Link to comment
Share on other sites

1 hour ago, hexdump said:

one thing is a bit strange: the box is supposed to have 2gb of ram and even the android dmesg shows 2gb of ram which usually can be trusted quite well but with linux i only see 1 gb and some strange high memory remarks:


[    0.000000] Truncating RAM at 0x60000000-0xe0000000 to -0xa0000000
[    0.000000] Consider using a HIGHMEM enabled kernel.
...
[    0.000000] On node 0 totalpages: 258560
[    0.000000] free_area_init_node: node 0, pgdat b1228ec0, node_mem_map e76ba000
[    0.000000]   Normal zone: 2304 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 258560 pages, LIFO batch:31
...
[    0.000000] Memory: 866500K/1034240K available (12835K kernel code, 867K rwdata, 3160K rodata, 800K init, 580K bss, 36668K reserved, 131072K cma-reserved)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
                   lowmem  : 0xb0000000 - 0xf0000000   (1024 MB)
                   modules : 0xaf000000 - 0xb0000000   (  16 MB)
                     .text : 0xb0008000 - 0xb0c910dc   (12837 kB)
                     .init : 0xb1094000 - 0xb115c000   ( 800 kB)
                     .data : 0xb115c000 - 0xb1234da4   ( 868 kB)
                      .bss : 0xb1236000 - 0xb12c7174   ( 581 kB)

does the rk3229 support 2gb of ram natively without any tricks?

 

and another question: are there any mali blobs (x11, fbdev, wayland) available or working for rk3229?

 

best wishes - hexdump

About the memory issues, that's because I disabled the HIGHMEM option in the kernel because in the early kernel is was crashing the system at boot, so anything above 1G of memory is discarded. I turned on the option very long ago, but I didn't post newer images with the option enabled recently.

 

Just now I'm builing some new unofficial images with latest bits. I will post them in the thread hopefully later ;)

 

About the mali blobs, they are available on the rockchip opensource github account, specifically the "libmali" repository. There's the r7p0 revision for X11 which I tested and it works

Link to comment
Share on other sites

@hexdump

I reply separately about the bootstrap process on newer images: if I understand correctly, you used the boot things from librelec images from @knaerzche. That's true, it boots without erasing the internal eMMC because he used the rockchip tools and the rockchip proprietary loaders to build the image, so the "internal" u-boot detects u-boot un the sdcard and boots from there.

 

If you use the proprietary bootloader chain, the hanging issues you are experiencing may be related to the trust OS (TEE) but it is just an hypothesis with no real evidences.

Armbian images instead use the mainline u-boot with the opensource OP-TEE trust OS. This difference in boot software proved to affect the linux system in various ways and mixing the things may result in unpredictable behavior.

 

about rk3228a, it *should* work, but yet I don't provide a specific device tree for rk3228a. It should be trivial to adjust it anyway: just remove the cpu frequencies above 1.2ghz and set the maximum frequency of the gpu to 400 Mhz instead of 500Mhz. There's a lot of confusion about rk3228a, rk3228b and rk3229 socs and seems to be no real reliable way to detect it:  @fabiobassa spotted a board with a soc marked as "RK3229", the SOC efuse also says "RK3229" but only boots on RK3228a libreelec images :unsure:

Link to comment
Share on other sites

@jock - thanks a lot for the info - looking forward to your new build and images ... meanwhile i got my mk809iv working too in the same way without having to erase anything on it using the liberelec mk809iv dtb ... btw. does anyone of you know how to switch those hdmi sticks into update/loader mode? i so far did not find any switch yet ... is there an easy way to open those devices?

 

a lot of thanks and best wishes - hexdump

Link to comment
Share on other sites

Hi Fabio and all. I am struggling to the RK3229 power off after 30s...

 

I am able to boot on SD my fake S905X android TV box (MXQ Pro 4K...) by using both the LibreELEC img (0bca75f image for ntn8 tv box w/rk3229) and ReSpeaker img (debian-9-lxqt or iot).

BUT the TV box shut down after few seconds, even is everithing is apparantly perfect...

 

I see that this issue is mentioned some time...

Could you please help me in fixing that?

Thanks!!! Alessandro

Link to comment
Share on other sites

if you are able to boot in linux starting by sd you can easily erase then the first sector of the internal emmc/nand and in this way FOR SURE you will be in maskrom mode ( a simple dd of a certain amount of zeroes on the first 8 mega will do the job )

A bit risky but it should work .

In the same manner you could restore the original boot loader on internal storage

your decison thought B)

Link to comment
Share on other sites

@hexdump I just updated the ubuntu bionic images with the legacy 4.4.194 kernel. I'm building a couple of debian buster images with the mainline kernel I will put on as soon as they will be ready ;)

 

edit: mainline images added to the initial post

Link to comment
Share on other sites

@jock - thanks a lot - i'll give them a try soon ...

 

update: i gave the 4.4 versions (both)  a try on the 2gb ram r39-4k and they hang at some point - retried the old kernel and that one still works (but only exposes 1gb ram) ... could this be the himem instability you mentioned?

 

will have to check in more detail in the next days ... sadly without a working serial console its hard really see where it hangs (screen goes black and keyboard is dead)

 

best wishes - hexdump

Link to comment
Share on other sites

@Alessandro

 

I truly would explain that even if we have great knowledge of those board, is terribly hard to do a diagnostic without even a uart log or dmesg log.

 

Is like to say the car doesn't go !!!

Yes but :

1) battery ?

2) gasoline ?

3) tyres ?

4) the driver is sleeping ? 

 

if you haven't a uart at least give more details : photos of board, any marks on board , anything that could help in tracing the problem

Link to comment
Share on other sites

@jock - i just tried 4.4.194 on the mk809iv too now and there it works, but the mouse cursor is gone in xorg armsoc, which ist still there with 4.4.189.

 

@Alessandro - can you please measure the time between power-on and the self-shutdown of the box? - maybe its like with my r39-4k a problem with the trust.img? for me that time was exactly one minute each time ...

 

best wishes - hexdump

Link to comment
Share on other sites

46 minutes ago, hexdump said:

@jock - i just tried 4.4.194 on the mk809iv too now and there it works, but the mouse cursor is gone in xorg armsoc, which ist still there with 4.4.189.

 

 

 

best wishes - hexdump

 

Are you using "my" armsoc driver? In this latest kernel I imported the libreelec patches and one of the patches gives the hardware plane which was of the cursor to an overlay layer, so the cursor now has to be rendered in software.

You can change this line to HWCURSOR_API_NONE, recompile, and get a software cursor.

Normally rockchip SoCs have a special separate hardware plane for the cursor, but I don't know if the necessary bits are implemented in the kernel DRM. I got to take a look into.

Link to comment
Share on other sites

Hi Fabio, thanks for the reply.

please find attached the photo of my “beast”...

 

I found today that LibreELEC RK3238b is working without Shunt Down after a while... the workin image is:

LibreELEC-RK322x.arm-9.2-devel-20200114144630-0bca75f-rk3228b-mk809iv.img.gz

 

LibreELEC start and everything is working (WiFi, usb, hdmi...).

52AE471E-0D3E-4DAC-A93D-4A1B1A1ADCFD.jpeg

77FC6AA1-87E5-4C81-96FA-9F838BA127A8.jpeg

7EE46834-7370-4330-A6A1-FF7C0D60CF6E.jpeg

B90E8B44-1EAE-4274-95B3-EEFCDFE98EDA.jpeg

Link to comment
Share on other sites

so Alessandro this board is well supported by armbian since me and @jock have worked exactly on one of those 

 

Actually Jock has this and should be a 3228b with ddr3 but le't s wait what jock can confirm

 

But if goes off after 30 seconds i suspect more power failure than software problems since trust os will die in few seconds and kernel panic will occur in 10/15 seconds

is working with original Android rom ?

 

Quote

I found today that LibreELEC RK3238b is working without Shunt Down after a while

sorry just realized with libreelec is working
 

let' wait jock's suggenstions

Link to comment
Share on other sites

i think it could still be trust.img related: my box absolutely reliably shut down after exactly 60 seconds each time (and in those 60 seconds booted fine up until x11) before i wrote the proper trust.img file obtained from the emmc to the sd card - since then it is working perfectly fine ...

Link to comment
Share on other sites

@Alessandro - you may try the following on a linux system, assuming your sdcard is in /dev/mysdcard (whichever device this might be in your case):

"zcat working Librelec-xyz.img.gz | dd of=/dev/mysdcard bs=512 count=32768 status=progress"

then use "fdisk /dev/mysdcard" to create a partition starting at sector 32768 (something like o, n, p, 1, 32768, enter, w, q - might be wrong - all off mind) and then dump the armbian image to it:

"xzcat Armbian-xyz.img.xz | dd of=/dev/mysdcard bs=512 skip=8192 seek=32768 status=progress"

and then try to boot that sd card - i think the armbian image uses an offset of 8192 sectors (@jock please correct me if i'm wrong here) - i never tried it this way, but in theory it should work and maybe be the fastest way to get libreelec boot and armbian rootfs combined :)

 

good luck and best wishes - hexdump

Link to comment
Share on other sites

16 minutes ago, hexdump said:

@Alessandro - you may try the following on a linux system, assuming your sdcard is in /dev/mysdcard (whichever device this might be in your case):

"zcat working Librelec-xyz.img.gz | dd of=/dev/mysdcard bs=512 count=32768 status=progress"

then use "fdisk /dev/mysdcard" to create a partition starting at sector 32768 (something like o, n, p, 1, 32768, enter, w, q - might be wrong - all off mind) and then dump the armbian image to it:

"xzcat Armbian-xyz.img.xz | dd of=/dev/mysdcard bs=512 skip=8192 seek=32768 status=progress"

and then try to boot that sd card - i think the armbian image uses an offset of 8192 sectors (@jock please correct me if i'm wrong here) - i never tried it this way, but in theory it should work and maybe be the fastest way to get libreelec boot and armbian rootfs combined :)

 

good luck and best wishes - hexdump


thanks! I’ll try.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines