-
Posts
2162 -
Joined
-
Last visited
Reputation Activity
-
jock got a reaction from Alexander Polko in H96 Max RK3528 - Cannot boot Armbian from TF/SD card
Hello, you can only boot from sdcard with that device if you follow the rockchip boot sequence, ie: you have to pack u-boot and trust.img using loaderimage tool from rockchip rkbin repository.
That tools decorates the uboot/trust.img binaries with some signature and checksum, then you have to put on specific positions on your sdcard and the miniloader, residing in the emmc, will boot from sdcard once it validates correctly the binaries you supplied.
You may take a look to my multitool github project for some reference. I have you same box and it boots on mine.
Unfortunately on this particular box, the manufacturer disabled the sdcard boot at SoC/hardware level: this means that the trick to erase the internal flash to boot from sdcard, which worked fine for older SoCs, does not always work with rk3528-based (and probably other rk35xx) boards
-
jock reacted to Chiều Nhạt Nắng in Armbian for RK3128 TVBox board
DISCLAIMERS (PLEASE READ):
- Everything in this post is provided AS-IS. This is not an official Armbian-supported target, and neither the Armbian project nor I am responsible for any damage, data loss, or broken devices caused by flashing or testing these images.
- As with other TV boxes, please assume there may be board variants, undocumented hardware changes, weak power supplies, and marginal NAND/eMMC chips. Test carefully before writing anything to internal storage.
- Please keep discussion and support in the forum thread, not in the official Armbian issue tracker.
Hi all,
I would like to share my work on bringing Armbian to Rockchip RK3128 TV boxes.
These boxes are quite old now, and I do not think they are especially common anymore. Still, I suspect a lot of people may have one lying around somewhere in a drawer, unused after Android updates stopped or the original firmware became too slow to care about. I also had several of them lying around at home, which is what pushed me to start this project in the first place. Since I could not find an RK3128 Armbian effort comparable to the RK322x one, I decided to try doing the port myself. Another important motivation was simply to reduce e-waste: if even some of these old boxes can be turned into usable Linux machines again instead of being thrown away, that already feels worthwhile to me.
First and foremost, I want to send special thanks to @jock and @fabiobassa for their RK322x TV box work on this forum. Their work was the foundation that made this RK3128 effort much easier to start from.
1. Main references and source code:
Blog post with the full write-up: https://chieunhatnang.de/p/building-armbian-for-rockchip-rk3128/ Follow-up post for kernel 6.6.89 work: https://chieunhatnang.de/p/building-armbian-for-rockchip-rk3128-part-2/ Build scripts and releases: https://github.com/chieunhatnang-personal/RK3128-Linux-SupportingScripts RK3128 kernel 4.4 tree: https://github.com/chieunhatnang-personal/linux-kernel-4.4-rk3128-tvbox RK3128 kernel 6.6 tree: https://github.com/chieunhatnang-personal/linux-kernel-6.6-rk3128-tvbox
2. Current status
At the moment I have two kernel lines:
`4.4.194`, the older vendor-based line, which is already usable in practice `6.6.89`, the newer line, which allows these boxes to run a more up-to-date Armbian userspace
What works in the current build:
Custom U-Boot based on Rockchip U-Boot 2017.09 All four CPU cores, up to 1.2 GHz CPU frequency scaling and governors DRAM frequency control, both dynamic and fixed NAND, eMMC, SD card, and USB booting. The booting order is: USB >> SD Card >> NAND/eMMC (NAND and eMMC cannot be enabled at the same time because they share pins) OTG and EHCI/OHCI USB support Ethernet Wi-Fi support for SSV6051P, ESP8089, and several Realtek chips GPU acceleration UART1 and UART2, configurable
Kernel `6.6.89` status in a bit more detail:
CPU DVFS is stable after replacing the inherited/leakage-based OPP assumptions with a board-specific RK3128-safe table. The stable points I ended up using are `216 / 408 / 600 / 816 / 1008 / 1200 MHz` DMC / RAM devfreq works. In practice, simply enabling `dmc` works much better than I first expected, and boards can settle at different normal rates such as `396 MHz` or `456 MHz` GPU on `6.6.89` uses `Lima`, not the old Mali blob stack. That gives a maintainable Mesa/DRM path and hardware-accelerated OpenGL ES instead of depending on a legacy userspace blob VPU/video decode is still the weak point. I tried both `RKMPP` and `Hantro/V4L2` directions, but video processing is still limited, so I do not consider this a polished media-playback setup yet
What does not work yet / known limitations:
Bluetooth: not implemented or at least not validated, because I do not have a board with Bluetooth to test VPU / hardware video decoding is not in good shape yet SD card and SDIO Wi-Fi are currently using PIO mode on both kernel lines. This is slower than DMA, but stable enough for normal use
3. Image implementation
I also made two RK3128 Armbian images based on existing RK322x Armbian images rather than building everything from scratch:
Armbian 22.02: Based on the build provided by @jock, running kernel 4.4.189 Armbian 26.02: Based on the official Armbian build for rk322x, running kernel 6.6.89
In both cases, the idea was the same: keep the working RK322x Armbian userspace as a base, then replace the RK322x-specific parts with RK3128 ones, while the kernels themselves are based on Rockchip kernel sources.
Compared with the original RK322x images, the RK3128 work mainly replaces or adds:
boot.cmd / boot.scr changes so the boot flow can handle NAND and USB properly RK3128-specific Wi-Fi drivers and boot-time module loading logic rk3128-config a delayed Wi-Fi loader service RK3128-specific motd information the RK3128 kernel, DTB, and overlays
For the `6.6.89` image specifically, there is some extra image-level cleanup and repackaging:
remove the RK322x kernel / dtb / u-boot / BSP packages from the donor image pin those RK322x packages so they do not come back on upgrade install the RK3128 `6.6.89` Debian kernel packages rebuild the BSP package under the RK3128 name
4. Quick installation notes
All required files are available from the releases page:
The releaes page: https://github.com/chieunhatnang-personal/RK3128-Linux-SupportingScripts/releases Armbian 26.02 image: https://github.com/chieunhatnang-personal/RK3128-Linux-SupportingScripts/releases/download/kernel-6.6-armbian-26-v1.0/A26-release-20260415.zip Armbian 22.02 image: https://github.com/chieunhatnang-personal/RK3128-Linux-SupportingScripts/releases/download/kernel-4.4-armbian-22-v1.1/release-20260412.zip
There are three installation layouts that are currently supported:
1. SD card only Pros: safest option, does not touch internal storage, easy to test and easy to remove, and if a board has an SD slot it can still be useful even when NAND/eMMC is completely dead Cons: slower than internal storage, and not every board has an SD slot Best for: first boot, testing, and boards where you want to keep the original Android install untouched 2. Full install to NAND / eMMC Pros: fastest and cleanest setup, uses the internal storage already present on the board Cons: overwrites the original Android install, and old NAND/eMMC may already be unreliable Best for: boards with healthy internal storage when you want a fully self-contained install 3. Hybrid install: bootloader on NAND / eMMC, rootfs on USB or SD card Pros: usually the most practical option for old TV boxes, works well when internal storage is only reliable enough for bootloader pieces, and can also help on boxes with problematic Android boot behavior Cons: more manual than the other methods, still depends on internal storage for the bootloader, and performance depends on the USB drive or SD card used Best for: boxes with weak or aging internal NAND/eMMC, or boxes where you want to avoid a full install to internal storage
I describe each method in more detail below.
4.1. Install and boot from SD card
Prepare:
idbloader.img uboot.img trust.img rootfs.img Create an MBR partition table on the SD card, leave the first 16 MB empty, create one Linux partition, then write:
idbloader.img to the raw device at seek=64 uboot.img to the raw device at seek=16384 trust.img to the raw device at seek=24576 rootfs.img to the first partition, not to the whole disk
Example:
DEV=/dev/sdX sudo parted -s "$DEV" mklabel msdos sudo parted -s "$DEV" mkpart primary ext4 16MB 100% sudo partprobe "$DEV" sudo dd if=idbloader.img of="$DEV" seek=64 conv=fsync sudo dd if=uboot.img of="$DEV" seek=16384 conv=fsync sudo dd if=trust.img of="$DEV" seek=24576 conv=fsync sudo dd if=rootfs.img of="${DEV}1" bs=4M status=progress conv=fsync sync I also provide a bootcardmaker.sh helper script in the same release directory to simplify this process.
4. 2. Full install to NAND / eMMC
Prepare:
rkxx_loader_vx.xx.xxx.bin parameter.txt uboot.img trust.img rootfs.img
Then:
Boot the board normally Connect a USB cable to the OTG port Open RKDevTool v2.69 In Advanced Function, erase the first 0x10000 sectors with Start LBA = 0x0 and Count = 0x10000 Press ResetDevice Wait for the board to return in MaskROM mode Go to Download Image Flash Loader, parameter, U-Boot, Trust, and rootfs
4. 3. Hybrid install: bootloader on NAND / eMMC, rootfs on USB or SD card
This is the layout I use most often, and in practice it is probably the most useful one for old TV boxes.
It is especially useful when internal NAND/eMMC is still good enough for Loader / parameter / U-Boot / Trust, but not reliable enough for a full root filesystem. A common symptom on these old boxes is that Android starts to boot and then hangs, or that the internal storage is simply too unreliable to trust with a full install.
In this hybrid layout:
Internal NAND/eMMC stores Loader, parameter, U-Boot, and Trust The root filesystem lives on USB or SD card Important:
rootfs.img is a filesystem image, not a full disk image Write rootfs.img to a partition such as /dev/sdX1, not to the whole device Tools like BalenaEtcher are the wrong fit for this particular image layout Example:
sudo dd if=rootfs.img of=/dev/sdX1 bs=4M status=progress conv=fsync sync
4.4. Post-install configuration
After the board boots successfully, you can configure it either from the local console over HDMI or remotely over SSH if Ethernet is connected.
Default login:
user: root password: 1234 The first login will ask you to change the password.
After that, run:
rk3128-config This is the board-specific configuration tool for enabling and adjusting hardware features that may differ between RK3128 boxes.
The most important options are:
Wi-Fi chip selection RAM dynamic frequency: disabled by default. Enabling it can improve performance, but on some boards it may cause kernel hangs. If that happens, switch it back to disabled SD card storage enablement when booting from another device Display resolution OTG mode selection
5. Testing feedback is welcome
If anyone here has RK3128 boards and wants to test, feedback would be very useful, especially for:
Board photos and PCB markings Whether the board uses NAND or eMMC Boot method that works: SD, USB, NAND, eMMC Which Wi-Fi chip is present Serial logs, dmesg, and failure reports If there is enough interest and enough board coverage, I would be happy to keep improving this, cleaning it up further, and making it easier for other people to test.
6. Credits
- @jock and @fabiobassa for the RK322x TV box work on the Armbian forum, which provided the main starting point, the images and practical reference for this RK3128 effort
- Rockchip for the original kernel code base used as the foundation for both kernel lines
-
jock got a reaction from andrey.lobov in CSC Armbian for RK3318/RK3328 TV box boards
@andrey.lobov openvfd is a badly written old driver, currently there is already tm16xx driver in the kernel for led front panels. You should configure your board appropriately with rk3318x-config and will enable the front panel. If your board is not in the list, please provide photos of the board (back and front) and the dtb
-
jock got a reaction from vengeancexyz in CSC Armbian for RK322x TV box boards
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 <-
This first page and the last 3 or 4 pages of the thread are enough to get up to date with recent developments.
Many useful experiences are scattered through the thread, but the most important things are collected here in the first page, so please read it carefully!
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:
Generic procedure for boards with non-BGA eMMC MXQPRO_V71 - eMCP H20 - eMCP ZQ01 - eMCP
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:
Mainline kernel: 3D acceleration is provided by Lima driver and is already enabled. Hardware video decoding: https://forum.armbian.com/topic/19258-testing-hardware-video-decoding-rockchip-allwinner/ Deprecated legacy kernel: multimedia features, like OpenGL/OpenGL ES acceleration, hardware accelerated Kodi, ffmpeg and mpv you can take a look to this post An effective tutorial from @Hai Nguyen on how to configure a box as a hi-quality music player using an USB audio card, and controlling it via remote control is available in this post
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 prebuilt images from the following links:
Archive builds (GPG-signed) - https://imola.armbian.com/dl/rk322x-box/archive/ SUGGESTED - Nightly built from trunk each week by Armbian servers (GPG-signed) - https://github.com/armbian/community Old images provided by me (unsigned and outdated) - https://users.armbian.com/jock/rk322x/armbian/stable
Archived/older images:
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.
Multitool - A small but powerful image for RK322x TV Box maintenance (instructions to access via network here)
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 -
jock got a reaction from Dangrain in CSC Armbian for RK322x TV box boards
UPDATE for Multitool
Finally I managed to let the Opensource OP-TEE work with the rockchip miniloader!
This means that the Multitool should now work on any board, without freezes and booting issues!
The new version can be downloaded from the first page of this thread.
Please report if it works for you, thanks!
-
jock got a reaction from MattWestB in CSC Armbian for RK322x TV box boards
UPDATE for Multitool
Finally I managed to let the Opensource OP-TEE work with the rockchip miniloader!
This means that the Multitool should now work on any board, without freezes and booting issues!
The new version can be downloaded from the first page of this thread.
Please report if it works for you, thanks!
-
jock got a reaction from Алексей Куренков in CSC Armbian for RK3318/RK3328 TV box boards
Updated images!
Armbian and Multitool images have been updated with various enhancements:
Multitool compatibility has been increased Split single device tree in base and overlays: each board can activate different device tree overlays to fit the specific configuration (eMMC DDR/HS200, alternate SDIO bus for Wifi, etc...) Add rk3318-config script to easily configure options via menus; just run it as sudo rk3318-config Add full support for AP6334 (and various clones) Wifi and Bluetooth Add support for AP6330 Wifi and Bluetooth (yet untested) Issues so far:
Lima driver acceleration has been disabled in X.org for the moment. It gave issues I need to investigate I2S subsystem has some problems that needs to be fixed, as result no sound can be produced for both HDMI and Analog outputs -
jock got a reaction from digital in CSC Armbian for RK322x TV box boards
UPDATE for Multitool
Finally I managed to let the Opensource OP-TEE work with the rockchip miniloader!
This means that the Multitool should now work on any board, without freezes and booting issues!
The new version can be downloaded from the first page of this thread.
Please report if it works for you, thanks!
-
jock got a reaction from Harleyyyu in CSC Armbian for RK322x TV box boards
@ArturHey you did a lot of experimentation, but actually I think you are stuck on something different. GPT partition error message is something you can totally ignore, either because stock firmware usually don't provide a GPT partition, and armbian images neither do.
The rockchip miniloader supports GPT partition table, but it is not mandatory to work. If there's a GPT partition, the miniloader searches for "uboot" and "trust" partitions to use them as hints for the base addresses. If there's no GPT partition, it will just use default base addresses and look for the LOADER and TRUST signatures.
Anyway, armbian does not use anything from that: there is no rockchip miniloader, neither are GPT partitions or other proprietary code, except for the Trust OS, which is embedded into u-boot. The boot process is totally different on armbian.
Now, the issue you have with flash not being recognized by rkdeveloptool makes me think about three possibile situations:
a bug in rkdeveloptool you are still in maskrom mode and did not upload the usbplug firmware with rkdeveloptool db (ie: the board is not yet initialized) a broken flash in the eMCP part
You can, for example, refer to the procedure Installation (without SD card, board with eMMC) described in the first post of this thread if you want to write a raw image in the flash memory but I always suggest to erase the flash memory and test the image via sdcard first, rather than installing the image immediately, because you can softbrick the board.
About the non-booting multitool, you should post some logs from the serial uart, but probably the main issue is related to the trust os which freezes the board after few seconds.
-
jock got a reaction from Harleyyyu in [Project] OpenAuto RK322x (Alpha) : Android Auto Running on Rockchip SOCs
Technically CMA is not needed at all for the VOP. Rockchip VOP has its own MMU, it is not like raspberry pi or amlogic devices. It should not require to reserve and map memory by the kernel for the VOP as long as the MMU is enabled in the device tree and it is working correctly.
-
jock got a reaction from Harleyyyu in [Project] OpenAuto RK322x (Alpha) : Android Auto Running on Rockchip SOCs
Nice, congratulations!
I wonder why cursor does not show when video is playing by the way: there has always been a patch in the armbian code to support hardware cursor, in fact in X11/Wayland the cursor is handled in hardware and it is perfectly visible and usable when a hardware accelerated video is playing.
Also I wonder why you need CMA=256M; normally rk322x VPU has its own MMU that is capable to handle direct to memory access without the need of CMA.
-
jock reacted to Harleyyyu in [Project] OpenAuto RK322x (Alpha) : Android Auto Running on Rockchip SOCs
Inspired by the incredible work @jock and @ilmich have done to make the RK322x platform stable on mainline Linux, I decided to tackle the application side of things. My goal was to turn these "e-waste" TV boxes into fully functional, low-latency Android Auto head units for our cars.
This fork of OpenAuto is built as one of my "Is it possible to turn this into that?" projects. It turned out to be one heck of a nightmare to pull off, but at the same time a lot of fun because I can see the potential of these TV Boxes as something you can actually put in your car and turn into a usable head unit!
System Requirements
Target Device: RK322x TV Box (e.g., MXQ Pro 4K). OS: Armbian Bookworm or Trixie (Kernel 6.1+ recommended). RAM: 1GB recommended. FFMPEG Installed: This build requires a specific build of ffmpeg that can be found here.
Release: v2.0.0-alpha
This release represents a major architectural overhaul. I have removed heavy dependencies (PulseAudio, QtAudio, GStreamer) in favor of a lean, direct-to-hardware pipeline using RtAudio (ALSA) and FFmpeg v4l2_request.
Download:
https://github.com/Harleythetech/openauto-rk3229-armbian/releases
Technical Details
Video Engine: Switched from GStreamer to a custom FFmpeg + V4L2-Request backend. Leverages the v4l2drmprime patch set for Zero-Copy rendering. Enables full hardware H.264 decoding on Rockchip stateless decoders. Result: Stable 1080p 60fps stream on a 1GB RAM device. Audio Overhaul: Replaced PulseAudio and QtAudio with RtAudio. This creates a direct, low-latency path to the ALSA hardware driver. Display: Targets linuxfb (Framebuffer) by default instead (eglfs and ffmpeg have issues when you run them together due to DRM master lock)
Configuration
This release requires a specific ALSA configuration to allow audio mixing (dmix) without PulseAudio. Create/Edit /etc/asound.conf:
pcm.!default { type asym playback.pcm "dmix_hdmi" capture.pcm "plug_null" } ctl.!default { type hw card 0 } pcm.plug_null { type plug slave.pcm "null" } pcm.dmix_hdmi { type dmix ipc_key 1024 ipc_perm 0666 slave { pcm { type hw card 0 device 0 } format S16_LE rate 48000 channels 2 period_size 512 buffer_size 4096 } bindings { 0 0 1 1 } }
Known Issues
Invisible Cursor: The mouse cursor works but is currently invisible when the FFmpeg video backend is active (rendering layer order issue). Backend Fallback: In rare edge cases where DRM initialization fails, the app may incorrectly default to Qt software output. Probably more, i haven't tested it that much
Development Status: Active & Seeking Contributors Currently, I am the sole maintainer focusing on the RK322x platform (specifically the RK3229).
I am actively looking for developers interested in expanding support to other devices (such as RK3328, RK3399, or Allwinner H3/H6). If you have experience with C++, Qt, or V4L2/DRM and want to help turn these TV boxes into capable head units, contributions are highly welcome!
Repository: https://github.com/Harleythetech/openauto-rk3229-armbian
Credits:
@jock and @ilmich for ffmpeg patches and the csc-armbian-for-rk322x-tv-box-boards opencardev for openauto and aasdk -
jock reacted to fabiobassa in CSC Armbian for RK322x TV box boards
@Harleyyyu
Your project could be interesting , I would suggest to open a dedicated 3ad on It own so people can contribute.
As you have already realized by yourself quite all hardware and drivers aspects of this rk322x soc have bene investigated by @jockand/or @ilmich
But if you achieve any progress on GENERAL drivers and performance that isn't already been discussed or achieved you can came back here to share
Thanks
-
jock got a reaction from fabiobassa in CSC Armbian for RK322x TV box boards
Sorry @Harleyyyu, but me and @fabiobassa were a bit puzzled about your journey within the hardware video decoding.
I recently tested the kernel 6.18 (but I am pretty sure it works fine also in kernel 6.12/6.6/6.1), but everything was already in place even with zero-copy DMA buffers, using the LibreELEC patches which are already compiled in the mainline kernel shipped with armbian for years right now.
Then there is also this apt repository I brought up few months ago with ffmpeg already patched and some instructions to run mpv with hardware decoding, which so far works for me either in virtual terminal and wayland (although sometimes with some glitches).
Just to let you know, because it looks like hardware video decoding, HDMI and GPU things are unsupported, but actually everything works fine.
-
jock got a reaction from Harleyyyu in CSC Armbian for RK322x TV box boards
Sorry @Harleyyyu, but me and @fabiobassa were a bit puzzled about your journey within the hardware video decoding.
I recently tested the kernel 6.18 (but I am pretty sure it works fine also in kernel 6.12/6.6/6.1), but everything was already in place even with zero-copy DMA buffers, using the LibreELEC patches which are already compiled in the mainline kernel shipped with armbian for years right now.
Then there is also this apt repository I brought up few months ago with ffmpeg already patched and some instructions to run mpv with hardware decoding, which so far works for me either in virtual terminal and wayland (although sometimes with some glitches).
Just to let you know, because it looks like hardware video decoding, HDMI and GPU things are unsupported, but actually everything works fine.
-
jock got a reaction from Harleyyyu in CSC Armbian for RK322x TV box boards
@Harleyyyu See this thread; hardware video decoding works fine with mainline kernel and does not need vendor MPP. Debian Trixie although has a "broken" mpv that won't work, better stay with Bookworm
-
jock got a reaction from digital in CSC Armbian for RK322x TV box boards
hello @digital, in some rare cases there are some minor trickeries to try and improve compatibility with eMMC.
If you run rk322x-config, there is a panel dedicated to eMMC which allows you to select some compatiblity options, like emmc-pins and DDR/UHS modes. You may try first enabling emmc-pins and rebooting to see if it gets recognized. Anyway photos of the board and the original stock device tree could be useful to identify the compatibility problem.
-
jock got a reaction from arl_spb in CSC Armbian for RK3318/RK3328 TV box boards
DISCLAIMER (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.
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).
Thank you!
This thread is to give stable and mature long-term range support to rk3318/rk3328 found in many tv boxes in Armbian project as Community Supported Configuration (CSC).
The current work is mainlined into Armbian project, but your mileage may vary; most recent developments live on my personal fork on github -> here <-
Important notes: is just a personal opinion, but apparently widely supported, that rk3318 chip is not an official rockchip part. They probably are scrap rk3328 parts which have not passed conformance tests but are sold anyway to tv boxes manufacturers. They don’t reach the same operating frequency of the rk3328, have much higher leakage currents (and thus higher temperatures) and often the boards they are installed on are low quality with low quality components, in fact a very very common issue is the eMMC failure due to bad parts and bad soldering. So said, I personally suggest not to buy any rk3318 tv box, but instead find a properly supported SBC (Single Board Computer) if you need a reliable product. In the unfortunate case you already have such product, this thread may help you have some fun with them.
What works:
• Works on RK3318 and RK3328 TV boxes with DDR3 memories
• Mainline u-boot
• Mainline ATF provided as Trusted Execution Environment
• All 4 cores are working
• Ethernet
• Serial UART (configured at stock 1.5Mbps)
• Thermals and frequency scaling
• OTG USB 2.0 port (also as boot device!)
• EHCI/OHCI USB 2.0 ports and XHCI USB 3.0 ports
• MMC subsystem (including , SD and sdio devices)
• Hardware video acceleration (fully supported via RKMPP on legacy kernel, support via hantro and rkvdec kernel driver on mainline)
• Various WIFI over SDIO are supported
• Full acceleration on legacy kernel and mainline kernel
• U-boot boot order priority: first the sdcard, then the USB OTG port and eventually the internal ; you can install u-boot (and the whole system) in the internal 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 clock pin on the PCB. The procedure is explained here for rk322x, but for rk3318/28 is the same.
In most of the rk3318/28 boards, shorting the clock pin is difficult or impossible because eMMC are BGA chips with no exposed pins. Pay double attention when burning something on the internal flash memory and always test first the image booting from the sdcard to be sure it works before burning anything in internal flash.
This is a list of posts where forum users have been able to spot the eMMC clock pin to trigger the maskrom mode:
H96 Max+ (board signature: RK3318_V1.4) by @Gausus X88 PRO 10 (board signature: X88_PRO_B) by @mathgaming HK1 Max (board signature YX_RK3318) by @Constantin Gatej Ninkbox N1 Max RK3318 by @enigmasphinx Hongtop H50 (board signature t98-3318-221-v11) by @GmP
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;
Multimedia:
Mainline kernel: 3D acceleration is provided by Lima driver and is already enabled. Hardware video decoding: https://forum.armbian.com/topic/19258-testing-hardware-video-decoding-rockchip-allwinner/ Legacy kernel: If you need multimedia features, like OpenGL/OpenGL ES acceleration, hardware accelerated Kodi, ffmpeg and mpv you can take a look to this post
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 /TVB/ boards and select "rk3318-box" from the list.
Prebuilt images:
Nightly stables - built from trunk by Armbian servers and GPG-signed: https://github.com/armbian/community
Multitool:
Multitool - A small but powerful image for RK3318/RK3328 TV Box maintenance. Download it from here
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 rk3318-config to configure the board specific options Run armbian-config to configure timezone, locales and other personal options Congratulations, Armbian is now installed!
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 , the box may not boot anymore forcing you to follow the unbrick section at the top of this post.
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 flash; 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 rk3318-config to configure the board specific options Run armbian-config to configure timezone, locales and other personal options, or also to transfer the SD Card installation to internal ; Congratulations, Armbian is running from SD Card!
Tutorial - How to install Armbian on your TV Box (by @awawa) :
https://www.hyperhdr.eu/2022/01/tv-box-mania-i-part-x88-pro-10.html
A note about boot device order:
With Armbian also comes mainline U-boot. If you install Armbian, the bootloader will look for valid bootable images in this order:
External SD Card External USB Stick in OTG Port Internal
The Multitool does not boot / How to burn image directly on eMMC:
Some boards have the sdcard attached to an auxiliary (called also sdmmc_ext or external) controller which is not the common one.
Forum findings declare that those boards are not able to boot from sdcard with stock firmware and they neither do in maskrom mode: the stock firmware always boots even if you put the multitool on sdcard.
In such case, burning images directly on eMMC is the only way to have a working Armbian installation.
You can follow these instructions by @fabiobassa to burn images directly on eMMC:
https://forum.armbian.com/topic/17597-csc-armbian-for-rk3318rk3328-tv-box-boards/?do=findComment&comment=130453
Notes and special hardware:
Script to change DDR memory frequency here Wireless chip AP2734, SP2734, HY2734C and similars: they are clones of AmPAK AP6334 which is combo wifi + bluetooth of broadcom BCM4334/B0 chips. You may need a special nvram file, instructions by @paradigman are here
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 rk3318 into armbian would not have begun without his support! @hexdump for his precious support in early testing, ideas and suggestions
@MX10.AC2Nfor his patience in testing mxq-rk3328-d4 board support
All the rockhip64 maintainers at Armbian project who have done and do most of the work to support the platform
-
jock got a reaction from 0230826 in CSC Armbian for RK3318/RK3328 TV box boards
@0230826 you can follow instructions in this page by @fabiobassa The loader is there too
-
jock got a reaction from Kuroi Akuma in CSC Armbian for RK322x TV box boards
modprobe parameter should be crystal=1, not crystal_26M_en anymore (see here)
Otherwise you could try led-conf6 overlay (but I don't know if it fits your board...) which has the attribute esp,crystal-26M-en = <1> in the device tree to set the crystal to 26 MHz
-
jock reacted to fabiobassa in CSC Armbian for RK322x TV box boards
@Jerry Falken
I am pretty sure you jumped in this 3ad without reading all of it, and this is unfair .
You are right, it is huge, but such question you ask have been already answered in the past many times , and I will answer just as a form of courtesy , but will not go back in the future on the same question again
If you look at your board you can spot 3 pads : tx rx gnd . That is all is needed, no 5 volts just tx rx gnd
Those pads are the "uart" , in other words there you will see ALL that happens when the board starts, if is a rk 322x or other fake print, if it is ddr3 or ddr2 manyyyyy manyyy infos to debug the whole process. For me it is a 3229 with ddr3 memory but uart will tell you
Go find in the 1st post the speed of uart to use with putty or minicom ( spoiler :1500000 🙃 )
just for sake of coriousity, this si the setting I have in my lab: ALWAYS and I repeat ALWAYS a uart connected to debug what is going so if you need answer.. post the right questions and not generic ones
g on
-
jock got a reaction from Antom in Repository for v4l2request hardware video decoding (rockchip, allwinner)
No need to recompile, rk322x already have had all the right bits in the right place for years. Everything is written down in the first page of the thread for rk332x tv boxes (What works: ---> Hardware video acceleration) in the hope people read it.
-
jock got a reaction from Antom in Repository for v4l2request hardware video decoding (rockchip, allwinner)
I tell you to read the first post of the thread.
-
jock got a reaction from fabiobassa in CSC Armbian for RK322x TV box boards
@Aroldo Bossoni
The optimal would be understanding the reason why the watchdog triggers, but could be a difficult task without a hint because of the closed source proprietary trust os.
The easiest thing is to provide armbian images with the opensource trust os rather than the proprietary, which is totally feasible because it just requires to swap a file in the armbian build scripts. That would blow the issue away, but unfortunately the proprietary trust os provided DDR scaling and virtual poweroff. The latter is a seldom used feature, but the DDR scaling provided a dramatic improvement in performance and it is hard to give up on that.
Swapping the things at runtime is not savvy: when u-boot updates, the proprietary trust os will be reinstalled overwriting whatever you put in there.
I would be happy with opensource Trust OS and no runtime DDR scaling, but stil having it at a fixed decent rate (660MHz, instead of the default 330MHz), but some boards do not boot at all when they are instructed to boot at 660MHz.
-
jock reacted to GmP in HONGTOP H50 alias T98-3318-221-V1.1
Attached the source overlay file for the tm16xx driver. All features working. See for details and thanks to https://github.com/jefflessard .
rx3318-H50.dtso.txt
