• Content Count

  • Joined

  • Last visited

Reputation Activity

  1. Like
    fabiobassa reacted to SteeMan in CSC Armbian for RK322X TV Boxes   
    Sometimes disreputable manufacturers will modify the kernel in the android firmware to provide false information. (easy way to cut costs by not actually including the memory/storage advertized).
  2. Like
    fabiobassa reacted to lucky62 in CSC Armbian for RK3318 TV box boards   
    This was not helpful. The boot stucked at the same point - ALERT! UUID=bla bla bla does not exists.
    I checked the USB key and really - the partition UUID was different than in the armbianEnv. I don't know how UUID was changed. Sorry for my mistake.
    So I flashed the image to the USB key again an successfully booted from USB... (overlay was not necessary for boot).
  3. Like
    fabiobassa reacted to jock in CSC Armbian for RK3318 TV box boards   
    Armbian project does not officially support nor maintains tv boxes. Armbian project maintains only supported Single Board Computer (SBC) devices. SBCs have stable hardware (kind-of), and are usually well-documented.
    Tv boxes are another thing.
    In the ideal world of the naked puffy angels chanting melodious high-tone songs, the organization you proposed would be perfect.
    In our world full of crap, dirt and oil it does not work at all: every chinese tv box manufacturer buy chips at the lowest price point possible on the market and put all that crap and scrap on these boards. If you read carefully the first post (and I invite you to do it) the very same rk3318 is probably a scrap chip, and eMMC chips are often failing after a while, some because are faulty, some others fail because of crappy soldering (you can ask @fabiobassa how many faulty eMMC chips desoldered from these boards).
    That's why Armbian does not officially tv boxes: it's a community matter, because keeping the things working with a huge hardware variety is just too difficult and very time consuming.
    In a world were everything can fit onto these boards, having one image for each box is unthinkable; I preferred a more elegant solution that allows the user to download a single image with a basic configuration that (hopefully) boots on every board with the same SoC. Once installed, the system can be further configured by the user herself to enable all the features of the board, like higher cpu speed, wifi, bluetooth, eMMC higher speed modes, leds, buttons, etc... etc...
    You won't find images of mine spread here and there on the forum, usually I publish images just on the first page of this thread and sometimes I prepare some special testing images for someone who has willingness to help the development progress. When everything will be stable enough, I will ask for merging to the main Armbian project, so the images will not be built and published anymore by me, but the Armbian server will build (and certify) them and they will be available in the official download page, but still totally backed and maintained by community efforts.
    You will find everything you need to get the thing running on the first page of the thread, so read that carefully and, if you're not satisfied, steer away from tv boxes and search for a proper SBC.
  4. Like
    fabiobassa reacted to lucky62 in CSC Armbian for RK3318 TV box boards   
    I forgot to attach the serial logs..
    serial_boot_internal.log serial_boot_USB2.0.log
  5. Like
    fabiobassa reacted to jock in CSC Armbian for RK3318 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 in early stages, it may or may not work for you; if and when it will be considered mature enough, it will be hopefully merged into Armbian master, but in the meantime it lives 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
        • 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. Mainline has lima driver compiled in but X11 is albeit slow - you are still free to compile and install mali kernel driver on mainline yourself.
        • 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.
    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. Here there is the procedure (for rk322x, but on rk3318 is the same), 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 where shorting the clock pin is difficult or impossibile, like BGA chips with no exposed pins. In those cases 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.
    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):
    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.
    Development images:
    Armbian 21.08 - Debian Buster minimal - mainline kernel 5.10.34 - Download from here - Build date: 2021-05-05 Armbian 21.08 - Ubuntu Focal desktop [xfce] - mainline kernel 5.10.34 - Download from here - Build date: 2021-05-05 Armbian 21.05 - Debian Buster minimal - legacy kernel 4.4.213 - Download from here - Build date: 2021-04-16  
    Multitool - A small but powerful image for RK3318/RK3328 TV Box maintenance. Download it from here  
    Quick installation instructions on :
    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 FAT 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 , skip to the next step. Instead if you are running the original firmware you need to first erase the internal ; 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!  
    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  
    How to partecipate:
    If you want to partecipate, do not hesitate to share your experience with the installation procedura of the boxes.
    In case of issues and missed support, providing these things is very useful to try and bring support for an unsupported board:
    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; attach a serial converter to the device and provide the output of the serial port; a link to the original firmware (you can do a full backup with the Multitool); some photos of both sides of the board. Some details of the eMMC, DDR and Wifi chips are also useful  
    Critics, suggestions and contributions are welcome!
        • @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
        • All the rockhip64 maintainers at Armbian project who have done and do most of the work to support the platform
  6. Like
    fabiobassa reacted to gurzixo in CSC Armbian for RK322X TV Boxes   
    Boa noite KSilva! (I'm French, but I live in Algarve...)
    I was in the same case as you, knew nothing about those boxes and rochchip, but, with the STRONG help of fabiobassa, I have been able to resuscitate a few of thoses boxes, and at least for some of them, able to have a stable Linux.
    A few questions:
    - Are you "fluent" in Linux and windows, do you have a windows system available?
    - Do you have some experience in electronics, microprocessors and microcomputers?
    - Do you have experience with serial connexions?
    My recommendation for you:
    - grab a male-male A-A usb cable, a micro (I mean MICRO) screwdriver, and a high magnification magnifying glass.
    - Open your box, take good quality pictures of both sides of the PCB and  put them on the forum.
    - The 2 next steps are: put the box either in Rockchip (ie. Loader) mode or in Maskrom mode, and try to connect a serial line to the box serial connection (1500000-N-8-1) to get console log, as this helps A LOT. (all cards have 3 or 4 plots for that: Gnd, Tx, Rx, Vcc . We can help you find that on the pictures; you will need a serial adapter, some thin wires that you have usually to solder on some pads and a com program - minicom works very well)
    - After that, you will have to flash some firmware using the USB to USB OTG cable.
    - Even if you prefer Linux (that'salso my case...), I suggest that you use windows for bringing back your box alive, as W tools are A LOT more complete, and also windows emits a sound when a new USB device is recognized, which helps a lot.
    This page explains the boot process.
    You can grab your stock firmware on this page . The archive of firmware contains RKDevelopTool.exe, which is used for flashing firmware.
    You can grab also some more Rockchip tools here
    Here are the main points that I understood:
    - Armbian and Rockchip/android firmwares are RADICALLY different, and their boot process are INCOMPATIBLE. Conceptually, they are similar, but takes very different approaches.
    - Let's detail the RK approach, which is very basic, unsophisticated and pragmatic. The image in flash contains the following elements at FIXED addresses, from bottom to top of flash:
    - A "partition table", (Parameter in RKDevTool) which indicates the addresses of the following blobs (with extension .img)
    - Loader, closed source called after reset by the HW of the processor.
    - The "trusted bloc", closed source, which performs some needed magic... started by the loader
    - The RK uboot, started by the trust module, which is similar to the BIOS for PC, and contains an interactive monitor, that you can start by entering a char on the serial console; otherwise it continues the boot.
    - The Device Tree Block (DTB, called "Resource" in RKDevTool)): this is a binary blob  which contains all the details and parameters of the hardware. it is compiled from source, and is COMPLETELY INCOMPATIBLE with the Armbian DTB. This allows to have a standard kernel, which is the same for all boxes.
    - The Linux kernel, started by the uboot, with a command line indicating where in flash to find the DTB, the Boot partition and the root file system.
    - The Boot partition
    - The Root partition (called "System" in RKDevTool), containing the Linux userland.
    On android, there are other blobs, used for backup and recovery, in case something goes wrong.
    All those blobs are usually packed together by the above RK tools, to create a complete image.
    RKDevtool allows you to flash each of those blobs in a specific place in memory, erase the memory, do some low level tests or flash a complete image.
    I will detail some practical instructions on a next post.
  7. Like
    fabiobassa reacted to gurzixo in CSC Armbian for RK322X TV Boxes   
    Hi again KSilva,
    Using RKDevTool (RKT) for bringing back the box alive, and flash an android image:
    UNPLUG the box, and do NOT plug it now. The Power will come from USB. You can switch RKT in english by editing config.ini and changing Selected=2 (use an 8bit editor such as VSCode). Start RKT, connect the box. If you hear a Windows DingDong, you have won, and you see "LOADER Mode" or a "MASKROM mode" in RKT. In that case you can plug power so that the box stays in that mode and go to 6). Otherwise you have to put the chip in one of those modes. The best thing is Loader (ie. Rockchip) mode. With Rockchip/Android (opposed to Armbian) with a normal flash image (at least if the bootloader is not erased), you can enter this mode by pressing the "Rockchip button" while connecting the USB. This button is usually located behind the audio jack, you can use a wood toothpick (cut both ends as it hurts...) for that. This is NOT the case if there is an Armbian image; in that case, the only way to enter loader mode is to interrupt the boot from the serial console (BTW, RK/android is 1500000000-N-8-1 (yes, 1.5MB/s), Armbian is 115000-N-8-1) If this does not work, the MASKROM mode is your last resort.  The hardware of the chip automatically enters this mode at boot if the flash is erased or not accessible. Technically, the flash is a serial memory accessed synchronously using a clock line, so the trick is to short this line to ground while connecting the USB. Most boxes have some pads for that, or the PCB can receive a Nand memory in a QFP package; in that case you have to short pins 8 and 9 with the small screwdriver and a good magnifier (see here for a video). Unfortunately, typically now the emmc chips use BGA packages, and I had to throw away a bricked box where I could not find the clock line on the PCB (or maybe the DRAM was dead... ) You have to be perseverant, as it does not work  each time, but eventually you will be rewarded by a Windows DingDong!. This is where we can help with the pictures of your PCB. In either mode, select "upgrade firmware" tab, load the android image from disk with the "Firmware" button (you have to wait 20seconds for the firmware to be decoded), erase the memory, and flash the firmware. If you boot in Armbian mode, unfortunately the toothpick trick does not work, and the only way to enter LOADER mode is to interrupt the boot from the serial line, and from the u-boot monitor in RAM, erase the u-boot in flash so that when rebooting, it enters LOADER mode. You can find details here  (mmc erase 0x4000 0x2000)
    If you enter Maskrom mode, and don't want to burn a complete image, but at least a bootloader, so that it is a lot more easier to enter back loader mode with a toothpick.
    I recommand that you bring back your box alive with stock firmware before installing Linux.
    Unfortunately, your box has NO sdcard, and that's a pity as it helps A LOT. Next time, buy a box WITH AN SDCARD!
    I was in the same case, and was not able to flash an u-boot allowing the box to continue booting on USB, as described in the 1st post. So I had to flash images directly in emmc, which is not good in case of problems,
    In order to install LInux on such a system, it is best to switch from Windows to Linux as I have not found a way to burn an Armbian image with RKT, and use rkdeveloptool, got from here . This is a CLI program, of lower level, which is agnostic about what it burns. There are instructions how to use it in the 1st post.
    Just a remark which costed me a few hours of headscratching: when being in Maskrom, the ONLY command accepted is to download a bootloder (rkdeveloptool WL bootloader.bin). ONLY after that you can use the other commands.
    Jock, Fabiobassa, balbes150 and others have done a tremendous job in creating armbian images, and the multitool, and they work most of the time. But I had a couple of boxes (called T96 Mini) where even the old (4.4) kernel panicked (serial console is mandatory to see what's going on...). In that case, fabiobassa was kind enough to help me install manually an even older kernel manually using RKT, but this is a complex process and the resulting system is NOT very stable, so I don't recommand that. 
    Just FYI, I have standardised now on those 2 boxes (Q96 HOME 4K and V88 4K - beware, rhe 4G/32G is in fact a 1G/8G!!!) which, despite having a small memory, have 4 usb (enough for a WIFI dongle and some USB SSD), and are perfect as small headless Linux servers with the 4.4 kernel, and extremely stable :
    stress-ng --sequential 0 runs for 24H without crash, but it is a good idea to add a small heat-sink on the processor as it throttles speed above 105C celsius...)
    Just my 2 cents, and welcome to the club!
  8. Like
    fabiobassa got a reaction from gurzixo in CSC Armbian for RK322X TV Boxes   
    hello Michel , yes to ALL your questions except for
    this is true for emmc. For nand since them charateristic the discussion is little little different, but let's assume is quite the same for our purpose:
    It is good idea and safe approach DON'T TOUCH idbloader , the very very very first stage of loading something in ram and go modify starting from address 2000
    Will follow a different approach for your board so please be patient some hours so i can give you more details
    EDIT :
      this also is half half correct: the sd card will do the job if there is a uboot and a trust ALSO in sd card at right places . It will happena " jump" from the internal uboot to sd uboot and then continue bootng from sd.
    But don't worry we wil go back from scratch
  9. Like
    fabiobassa got a reaction from gurzixo in CSC Armbian for RK322X TV Boxes   
    that is for android 3.10.xxx and we are on kernel 4.4.xxx and yes .. we already have that too
  10. Like
    fabiobassa got a reaction from gurzixo in CSC Armbian for RK322X TV Boxes   

    yes your board is well known and also quite good supported.
    I am happy and satisfied it is working now
  11. Like
    fabiobassa got a reaction from Alex83 in CSC Armbian for RK322X TV Boxes   

    yes your board is well known and also quite good supported.
    I am happy and satisfied it is working now
  12. Like
    fabiobassa reacted to rlukas210 in CSC Armbian for RK322X TV Boxes   
    @jock @fabiobassa hi after a long time!
    I have spent many hours, tried several times, blá blá blá
    After all, i got my board to work both with USB, and tried with Debian Image and nand was booted Fine!
    I would like to give a huge thank you to you and everyone who could make this possible! 😁😁😁
    I can't attach the images here, but in the link below has the proof and the df output
    One more time, a big thank for u'all!! 
  13. Like
    fabiobassa reacted to jock in CSC Armbian for RK322X TV Boxes   
    Hello @gurzixo, most of your observations are true, I will add some precisations to make things more clear as long as I see you like having things tidied up
    The box is surely intended by rockchip to run under Android, but tools are definitely OS-agnostic. Also the tools given by rockchip are intended also for other SoCs that are publicized and sold and supported for use in Linux (like rk3288, rk3399 and rk3328).
    Not exactly. Armbian is a set of scripts and patches that allows building Debian-based (so Debian, but also Ubuntu) images capable to boot on several ARM-based Single Board Computers (SBCs). Since ARM device does not have a standard way to boot and does not have a BIOS like x86 system, there is the need to support each SoC/board in its own peculiar way. Once you install Armbian, you have a full Debian (or Ubuntu) on your system, with some extra packages that make life much easier.
    Loader mode: right!
    Maskrom mode: right also, but the chip enters maskrom mode also when it does not find a valid bootloader in both internal and external flash memory, or using rkdeveloptool rd 3
    True. This page is the official rockchip documentation with the official way to handle things.
    Clearly the most important thing is to put a valid loader at sector 0x40 of internal or external flash, otherwise the SoC does not boot at all.
    You can of course alter the flow at any point, for example the idbloader can be made of rockchip blobs (ddrbin + miniloader) or can be made of full opensource software (U-boot TPL + U-boot SPL).
    If you use the rockchip blobs, you must of course put the things in the locations proposed by them, but in reality there is still a large degree of freedom.
    The DTB exists because these boards don't have a Plug and Play bios, so devices and peripherals cannot be autodetected by the kernel, but must be described somewhere. The DTB describes the devices of the board: where they are mapped in memory, whose interrupts, dmas, gpios they use, and so on. This way the kernel drivers knows how to devices.
    The "compatibility" of the DTB is determined by the kernel version: since the kernel drivers are modified during time the way to describe the resources trivially changes too, and so the DTB needs to be adjusted.
    Kernel 3.10/3.14 are waaay too old and so many things changed, so it is totally a bad idea take a dtb of such version and
    bring it to kernel 5.10 or whatever.
    No, according to the rockchip boot page, the very first loader is ROM code in the SoC. It is going to do these steps:
    check sector 0x40 on internal flash memory for a valid second stage loader and run it if possible check sector 0x40 on external flash memory for a valid second stage loader and run it if possible resign itself and go in maskrom mode No, absolutely.
    Putting the multitool on the internal eMMC is pointless, since it is an utility to easily install Armbian on eMMC using an sdcard.
    Just substitute the armbian image you want in place of multitool.img at step #4 and you're done.
    Also step #3 should not be really needed, because the armbian image already contains all the proper things at the right places.
    The storage map is just the default way to arrange partition proposed by rockchip when all their blobs are used, but as I said there is wide degree of freedom. Partitions also are often intended as "location where to place things", and not always proper partitions in the partition table.
    Armbian, for example, has just a single ext4 partition because all those partitions are definitely not needed and I don't use the rockchip blobs at all except for the very first DDR memory initializer.
    Multitool image, by contrast, uses the rockchip blobs but has two real partitions, and u-boot image and trust image are just at the "right places".
    That never worked for me, also GPT partition table is also not really needed. You can use it to customize the various binaries locations, but actually I don't think you need to complicate things.
    Indeed, when you're in maskrom mode the SoC is waiting for some valid code to run; it is not providing any service and no devices are initialized yet. The only command that works is rkdeveloptool db: only when you provide a valid loader (it is called usbplug in this case) the dram and emmc/nand subsystems are initialized and ready to be used.
  14. Like
    fabiobassa reacted to gurzixo in CSC Armbian for RK322X TV Boxes   
    I have a couple of questions:
    - Is this storage map the one used by android, multitool, legacy and up-to-date armbian, or are they each using different maps?
    - I found very few information about the GPT partition table, what to put inside and how to build the parameter_gpt.txt  file used by rkdeveloptool. Are there some pointers available?
    I have also a strange thing: I am able to enter loader mode by wiping emmc, and everything works well (ie. test chip, read id, etc.). But when I enter maskrom mode, I have the correct PID/VID on USB, but all rkdevelop commands block (ie I have to press ^C to come back to shell).
    This is the case either when I reboot by software (rkdevelop rd 3) or by hardware (ie. short emmc pins)
    And when I reload multitool in emmc, it still gives kernel panic.
  15. Like
    fabiobassa reacted to gurzixo in CSC Armbian for RK322X TV Boxes   
    Thanks to all of you for your kind words! I also forget to thank all the other who helped
    FYI I am French, 62, living now in Portugal, *soldered* my first computer (a Z80 Nascom ) at 19, and I have a good experience in embedded systems, electronics, network and system programming on various OSes.
    @fabiobassa @Jock :
    I tried to extract the dtb using PabloCastellano's extract_dtb.py, but it gave weird things. Thanks for your tool (I work on Linux and there was also a Linux version!). Using it with 2nd level decoding, and then using linux's dtc on Image/resource.img.dump/rk-kernel.dtb for my working android image gave:
    But before taking the dtb route, I would like to fully reprogram this board from scratch, as I am sure that I did some mistakes somewhere.
    GPT 0x63337df8 signature is wrong recovery gpt... GPT 0x63337df8 signature is wrong recovery gpt fail! At the beginning of the boot seems very bad!
    I am new to those boards, knowing nothing from them 2 weeks ago, and the information is scattered in lots of places (is there a WIKI somewhere, as it is BADLY needed?), so this is what I understood:
    The RK322X chips are done by Rockchip which assembles IP blocs licenced by ARM to make a SoC. ARM and the communauty provides compilers, linkers and the like. The box is intended by Rockchip to run under Android, and Rockchip tools are heavily biaised toward this environnement, with a lot of specific tools, and an old kernel (3.x and maybe 4.x). Armbian is a Debian distribution, adapted to run on Arm chips, which makes for a very diverse ecosystem, and follows the Linux track (new kernels, etc). Both environments do the same job, but there are many places where armbian and rk/android tools are not compatible. The box has a (set of) processors, RAM and flash plus various peripherals, some of them being integrated in the SoC. The flash can be Nand, or eMMC (which is nand plus a controller taking care of many details, including bad blocks and wear levelling). As seen from the software, flash is a linear vector of blocks (of typically 512K each) which can be R/W with only this granularity. All of them have a (usually hidden) serial line, that runs @ 115200 bauds, and gives lots of system information. Putting Linux on this box consists in reprogramming fully the flash, and this is done using an *image* (extension ".img"). It can be flashed using RK tools (rkdeveloptool for linux) directly on the chip through USB, or by crafting an sdCard which will do the job. The RK322X has 2 reset modes: Loader mode which allows only access to flash above 0x2000*0x200 maskrom mode which allows for full access. The chip enters maskrom mode when it cannot read flash; that can be accomplished  in a wild way by shorting pins 8 and 9 of the eMMC chip at boot (which is why RK322X chips are nearly unbrickable) The boot sequence is complex: Execution starts first with a miniloader (? at a certain offset in flash?) whose job is to load a 2nd level loader (?located at another offset in flash?) called u-boot. U-boot is based on Das U-Boot modified by many people. All of them are more or less compatible, with subtle differences. They have one thing in common, which is that a ^C on the serial line stops the boot and gives a CLI. The Job of uboot is to load the Linux kernel in memory, and start it using a command line with various parameters. One important parameter is the DTB, which indicates to the kernel (drivers) the hardware details. This is a binary blob (.dtb) compiled from various source modules (.dts). The armbian and android dtb are similar but not compatible. They can be decompiled by (mostly uncompatible) compilers (dtc in linux). Another important parameter is the offset in flash of various filesystems. Then he kernel starts... An image is the concatenation of various blobs according to a certain format. Armbian and RK images are NOT compatible, as they don't have the same numbers and type of blobs, and so require different sets of tools (?which ones?) Is the 1st-level loader (?located at offset 0 in flash?) part of the armbian image So, in order in order to *fully* reflash my box:
    Manage to enter maskrom rkdeveloptool db rk322x_loader.bin rkdeveloptool ul rk322x_loader.bin rkdeveloptool wl 0 multitool.img Am I right or should I have missed something?
  16. Like
    fabiobassa got a reaction from gurzixo in CSC Armbian for RK322X TV Boxes   

    Ciao Michel, welcome in this valley of tears lol lol lol
    Well, another lovely board with no SD reader and this makes the whole story a bit complicated , but not impossible to solve.
    Ant thank you so much for photos and serial uart log, this really helps

    The kernel as you can see is starting and the kernel panic could be for wrong trust_os, wrong dtb, not mounting the root fs ,one only or all 3 causes lol
    If you have original firmware you can extract the pieces and in particular dtb with this tool
    (google for it ) but I guess you have nothing of different from other boards with ddr3 and emmc

    Let's wait @jock for further infos on how to approach at this rare study case but I can say to you for sure that it will boot

    You are new so cannot post many posts in the first days , you must wait I believe one day for other post.
    And don't forget to click a " like" ( the heart icon) for helping good reputation of authors
    Where are you from if I can ask , and have you some skills on linux so it will be in some manner easier?

    I attached a command line CLI only windows tool to extract pieces from a firmware , try it please
  17. Like
    fabiobassa got a reaction from Alex83 in CSC Armbian for RK322X TV Boxes   
    OHHHH and finally here it goes 

    Bravo Alex, but more bravo Jock
  18. Like
    fabiobassa got a reaction from rlukas210 in CSC Armbian for RK322X TV Boxes   

    hello and welcome on this 3ad
    would you be so kind to provide us some photos of your board , thank you so much !

    And you are newbie so you must wait one day for replay ( forum rules    )
  19. Like
    fabiobassa reacted to jock in CSC Armbian for RK322X TV Boxes   
    Erasing the NAND with rkdeveloptool was not a smart move, as you noticed right now the NAND is not detected anymore.
    First of all, be aware that everytime you reboot the box, unplug the power cord and detach the serial connectors from the board if you have them attached: NAND boxes are very sensitive to even the lowest current.
    As long as you tried both Armbian and LibreELEC, you should specify what image you did try: forget the mainline kernel images, they won't work with NAND because there is no driver. You must use legacy 4.4 kernel images.
    From my point of view, as long as you erased the flash (thus removed the original idbloader), you may do something smarter and use the sdcard to understand if legacy kernel Armbian/LE boots from sdcard or not.
    If it is not booting, you need to attach a serial adapter and take some logs because something wrong is happening and the kernel is not able to boot.
    Note that probably you will need to erase the flash again if you installed a non working idbloader to make the board boot from sdcard without interferences.
    Instead, if Armbian or LE are booting fine from sdcard, proceeding to restoring the NAND functionality can happen.
    As @fabiobassa said, photos and signatures of the board as useful to understand if it is a known board or similar. I have an MXQ Pro 4K tv box right here and it looks similar to yours, but the commercial name is worthless since the board inside may be of a different revision with different components.
  20. Like
    fabiobassa got a reaction from dale in CSC Armbian for RK322X TV Boxes   
    since you are able to manage linux and linux command , you can enjoy yourself with a chron command too:
    a simple bash script that in the morning at 8:00 ( or when is usefull for you) does a
    echo default-on ( ot timer or heartbeat or cpu0 ) >>> /sys/class/leds/here_the_name_of_your_led/trigger  
    and the at 20:00 ( or when is usefull for you) does a
    echo none ( ATTENTION: none and default on " could be inverted as logical but you will realize it by yourself ;-) ) >>> /sys/class/leds/put_here_your_led_name/trigger  
    If you are electronic skilled, too, you can even control something with a simple transistor and a relay attached to that led
  21. Like
    fabiobassa got a reaction from dale in CSC Armbian for RK322X TV Boxes   
    ty so much for sharing your experiments. This helps  @jock and me to better understand behaviour of some boxes that haven't sd card reader , ddr3 and nand.
    The u-boot legacy we realized have some difficult to proper initialize the usb: it's random failure so quite difficult to debug, maybe jock will investigate further or/and rewrite some pieces of code to proper start USB subsystem but this requires it's time. For now we are glad your board is functional

    ty for sharing the dtb and your experiences, too
  22. Like
    fabiobassa reacted to Seth in CSC Armbian for RK322X TV Boxes   
    well, i'm gonna tinker with it a bit more and post any progress. i put files there for others to use as reference just in case they encounter same problems as mine. cheers.
  23. Like
    fabiobassa reacted to dale in CSC Armbian for RK322X TV Boxes   
    Hi @jock,
    Play around with rockchip tv box is always such an interesting thing.
    I tried to boot off usb drive with 3 types of image:
    1) same with image flashed into NAND (buster legacy) --> Armbian could boot from usb drive
    2) focal legacy image --> could not boot armbian just ignored the usb drive and booted right from NAND
    3) Multiboot --> could not boot, armbian just ignored the usb drive and booted right from NAND
  24. Like
    fabiobassa got a reaction from dale in CSC Armbian for RK322X TV Boxes   
    Glad everything is working . Later personally will investigate vwhy multitool doesn t work as expected 
    And don't forget help good reputation of authors with a simple like, thanks !
    What exactly do you want to achieve now?
    Maybe I missed something
  25. Like
    fabiobassa got a reaction from Seth in CSC Armbian for RK322X TV Boxes   
    Glad everything is working . Later personally will investigate vwhy multitool doesn t work as expected 
    And don't forget help good reputation of authors with a simple like, thanks !
    What exactly do you want to achieve now?
    Maybe I missed something