Jump to content

CSC Armbian for RK3318/RK3328 TV box boards


jock

Recommended Posts

🤯 Is there a tool to convert hex pointers (phandle) to human readable names when doing dtc -I dtb -O dts?

 

For example, in original dtb file I have:

 

        io-domains {
            compatible = "rockchip,rk3328-io-voltage-domain";
            status = "okay";
            vccio1-supply = <0x29>;
            vccio2-supply = <0x2a>;
            vccio3-supply = <0x29>;
            vccio4-supply = <0x2b>;
            vccio5-supply = <0x29>;
            vccio6-supply = <0x29>;
            pmuio-supply = <0x29>;
            phandle = <0xa3>;
        };

 

where <0x29> is:

 

RK805_DCDC4 {}

 

 

Link to comment
Share on other sites

@helix afaik, no tool for that. phandles are the way how kernel navigates the device tree.

 

BTW, you may wish to try to enable box-wlan-ap6330 or box-wlan-ap6334 device tree overlay in /boot/armbianEnv.txt and see if you advance in getting bluetooth: broadcom chips have the need for some bits in the device tree to load the driver and attach the communication "bus" (which is usually a simple UART port). Also they are very similar chips. the driver is usually capable of handling the detection of features despite you declare a different chip in device tree.

 

You can see the source of the ap6330 overlay here

 

And yes, you definitely need to enable the led-conf3 because the dtb declares that your board definitely has a rk805 PMIC: that's why the photo of the board is heavily suggested in the first page to get help.

 

Link to comment
Share on other sites

Posted (edited)

Hello,

In led-conf3 overlay sdio card on mmc1 is disabled as I can see, so wifi does not work with this overlay.

I'm trying to add lines about rk805 to the initial working config rk3318-box and compile it, but it breaks sdio somehow:

 

[    1.141446] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[    1.141560] mmc1: error -110 whilst initialising SDIO card
[    1.141743] dwmmc_rockchip ff510000.mmc: card claims to support voltages below defined range
[    1.145758] mmc1: error -110 whilst initialising MMC card
[    1.171182] mmc_host mmc1: Bus speed (slot 0) = 300000Hz (slot req 300000Hz, actual 300000HZ div = 0)
[    1.345809] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[    1.345933] mmc1: error -110 whilst initialising SDIO card
[    1.346116] dwmmc_rockchip ff510000.mmc: card claims to support voltages below defined range
[    1.350139] mmc1: error -110 whilst initialising MMC card
[    1.376838] mmc_host mmc1: Bus speed (slot 0) = 200000Hz (slot req 200000Hz, actual 200000HZ div = 0)
[    1.618019] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[    1.618141] mmc1: error -110 whilst initialising SDIO card
[    1.618299] dwmmc_rockchip ff510000.mmc: card claims to support voltages below defined range
[    1.622240] mmc1: error -110 whilst initialising MMC card
[    1.648896] mmc_host mmc1: Bus speed (slot 0) = 100000Hz (slot req 100000Hz, actual 100000HZ div = 0)
[    2.096685] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[    2.096818] mmc1: error -110 whilst initialising SDIO card
[    2.097000] dwmmc_rockchip ff510000.mmc: card claims to support voltages below defined range
[    2.100963] mmc1: error -110 whilst initialising MMC card
[    2.114878] mmc1: Failed to initialize a non-removable card


Same result with rk3328-evb.dts from mainlain kernel 6.6.30, which have rk805 support by default.

 

Ok, may be &sdio { vmmc-supply = <&vcc_io>; } is missing, so i add this line also, but card still does not initialising:

 

[    1.144440] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[    1.144552] mmc1: error -110 whilst initialising SDIO card
[    1.167189] mmc_host mmc1: Bus speed (slot 0) = 300000Hz (slot req 300000Hz, actual 300000HZ div = 0)
[    1.341046] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[    1.341166] mmc1: error -110 whilst initialising SDIO card
[    1.367235] mmc_host mmc1: Bus speed (slot 0) = 200000Hz (slot req 200000Hz, actual 200000HZ div = 0)
[    1.599001] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[    1.599115] mmc1: error -110 whilst initialising SDIO card
[    1.625242] mmc_host mmc1: Bus speed (slot 0) = 100000Hz (slot req 100000Hz, actual 100000HZ div = 0)
[    2.077057] mmc_host mmc1: Bus speed (slot 0) = 50000000Hz (slot req 50000000Hz, actual 50000000HZ div = 0)
[    2.077170] mmc1: error -110 whilst initialising SDIO card
[    2.077353] dwmmc_rockchip ff510000.mmc: card claims to support voltages below defined range
[    2.081314] mmc1: error -110 whilst initialising MMC card
[    2.095266] mmc1: Failed to initialize a non-removable card


finally i managed to initialize sdio with enabled rk805:


 

&sdio {

    post-power-on-delay-ms = <0x100>;

}

 

 

 

Edited by helix
finnaly i managed to initialize sdio with enabled rk805:
Link to comment
Share on other sites

@helix ff510000.mmc is disabled in led-conf3 because led-conf3 is for MXQ-RK3328-D4 board, which accidentally has rk805 PMIC and fixes something.

But clearly led-conf3 is not tailored for your board, hence not all the hardware works.

 

 

Link to comment
Share on other sites

finally bluetooth is working with such config:

 

&uart0 {
    status = "okay"; 
    uart-has-rtscts;
    
    bluetooth {
        pinctrl-names = "default";
        compatible = "brcm,bcm43438-bt";
        max-speed = <4000000>;
        clocks = <&rk805 0x01>;
        clock-names = "extclk";
        shutdown-gpios = <&gpio1 RK_PC5 GPIO_ACTIVE_HIGH>;
        host-wakeup-gpios = <&gpio1 RK_PD2 GPIO_ACTIVE_HIGH>;
    };
};

 

firmware from android partition:

 

sha256sum BCM4343B0.hcd
2252534aa755ab2857eb9765c55eb1d917e77992b5ee2ff701955cdcda9a8c9a  BCM4343B0.hcd


 

Link to comment
Share on other sites

From first post:

Prebuilt images:

Archived images - built by Armbian servers and GPG-signed: https://imola.armbian.com/dl/rk3318-box/archive/

Nightly stables - built from trunk by Armbian servers and GPG-signed: https://github.com/armbian/community

Stables provided by me (unsigned): https://users.armbian.com/jock/rk3318/

 

but the Archive with current images for RK3318 is down (many types is missing on the homepage) but the RK3228 is there but its not helping for my RK3318 boxes.

Do some have one mirror of the latest current / stable builds that  can being shred ?

Link to comment
Share on other sites

20 minutes ago, MattWestB said:

Archive with current images for RK3318

There is no archive for 'current images'.  As of 24.02 and going forward the only images produced are the community builds.

Link to comment
Share on other sites

I'm sorry, I don't know much about Linux, but I came across the H96Max 4k Ultra HD TV set-top box (rk3318), the rk3318 v.1.4 board, I wanted to install armbian on it. I did everything according to the instructions, the system was installed, I load from it, but Wi-Fi does not connect, although it shows that it sees 2.4 and 5 MHz networks, asks for a password but does not connect, the SP2734C chip. Bluetooth got up confidently and works, please advise me with the installation of armbian, maybe somehow disconnect the chip from the device, and connect Wi-Fi via USB. I read about the nvram file, but I did not understand where to write it, at what point, since, as I said above, I am not friends with Linux.

Link to comment
Share on other sites

2 hours ago, Борис Макаров said:

I'm sorry, I don't know much about Linux, but I came across the H96Max 4k Ultra HD TV set-top box (rk3318), the rk3318 v.1.4 board, I wanted to install armbian on it. I did everything according to the instructions, the system was installed, I load from it, but Wi-Fi does not connect, although it shows that it sees 2.4 and 5 MHz networks, asks for a password but does not connect, the SP2734C chip. Bluetooth got up confidently and works, please advise me with the installation of armbian, maybe somehow disconnect the chip from the device, and connect Wi-Fi via USB. I read about the nvram file, but I did not understand where to write it, at what point, since, as I said above, I am not friends with Linux.

You have to put the file in /lib/firmware/brcm directory, then reboot and see if it works

Link to comment
Share on other sites

Posted (edited)
21 час назад, jock сказал:

You have to put the file in /lib/firmware/brcm directory, then reboot and see if it works

I have placed a file nvram_2734с.txt in the /lib /firmware /brcm directory, no miracle happened, WiFi did not connect (Photo1). I inserted USB WiFi, WiFi did not appear, but another wlan1 network appeared (Photo 2), then the result rebooted without removing USB WiFi (Photo 3). The board and USB WiFi (Photo 4,5). I think if you can somehow disable the sp2734c, and USB WiFi drivers may be suitable. I don't really need Bluetooth, I'm making my son a 3D printer on clipper. Can you tell me a way to solve this problem?

 

 

 

 

 

 

 

 

 

 

1.jpg

2.jpg

3.jpg

4.jpg5.jpg

Edited by Борис Макаров
Link to comment
Share on other sites

Can you show output of this command? It will help to understand which file is required by the wifi driver.

 

dmesg | grep brcm

 

You can check which files driver looks for:


 

#become root
sudo su

#create empty folder for wifi drivers
cd /lib/firmware
mv brcm brcm_back
mkdir brcm

reboot

# after reboot messages from kernel will show missing files and errors
dmesg | grep brcm

#try to add missing files with correct filenames one by one and reboot again
#first you will need correct firmware file *.bin
#then nvram file *.txt
#then possible one more, but it depends 

 

Consider using ssh. All configuration will be much more convenient just because you be able to copy paste commands from regular pc rather then logging in to the graphical environment and typing again.

As i know, ssh enabled by default in armbian, so you will need just install client on you pc.

 

Link to comment
Share on other sites

Posted (edited)

 

19 часов назад, helix сказал:

Consider using ssh. All configuration will be much more convenient just because you be able to copy paste commands from regular pc rather then logging in to the graphical environment and typing again.

As i know, ssh enabled by default in armbian, so you will need just install client on you pc.

 

[   12.031297] Bluetooth: hci0: BCM: 'brcm/BCM4334B0.hcd'
[   12.031303] Bluetooth: hci0: BCM: 'brcm/BCM.hcd'
[   12.457401] brcmfmac: F1 signature read @0x18000000=0x16034334
[   12.467645] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4334-sdio for chip BCM4334/3
[   12.468154] usbcore: registered new interface driver brcmfmac
[   12.468572] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac4334-sdio.rockchip,rk3318-box.bin failed with error -2
[   12.468732] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac4334-sdio.bin failed with error -2
[   13.486755] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
root@rk3318-box:~# 
# insert BCM4334B0.hcd, BCM.hcd - not found
reboot
root@rk3318-box:~# dmesg | grep brcm
[   12.196909] brcmfmac: F1 signature read @0x18000000=0x16034334
[   12.242970] Bluetooth: hci0: BCM4334B0 'brcm/BCM4334B0.hcd' Patch
[   12.278893] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4334-sdio for chip BCM4334/3
[   12.279204] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac4334-sdio.rockchip,rk3318-box.bin failed with error -2
[   12.279364] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac4334-sdio.bin failed with error -2
[   12.282351] usbcore: registered new interface driver brcmfmac
[   13.282688] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
root@rk3318-box:~# 
# insert brcmfmac4334-sdio.bin, brcmfmac4334-sdio.rockchip,rk3318-box.bin - not found,insert brcmfmac4334-sdio.rockchip,rk3318-box.txt
reboot
root@rk3318-box:~# dmesg | grep brcm
[   12.003046] brcmfmac: F1 signature read @0x18000000=0x16034334
[   12.034518] Bluetooth: hci0: BCM4334B0 'brcm/BCM4334B0.hcd' Patch
[   12.043847] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4334-sdio for chip BCM4334/3
[   12.044134] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac4334-sdio.rockchip,rk3318-box.bin failed with error -2
[   12.073491] usbcore: registered new interface driver brcmfmac
[   12.254962] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4334-sdio for chip BCM4334/3
[   12.255193] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[   12.256172] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4334/3 wl0: Jul 24 2019 12:58:36 version 6.10.191 (TOB) (r) FWID 01-b049404e
root@rk3318-box:~# 

 

 

The file brcm/brcmfmac4334-sdio.rockchip,rk 3318-box.bin is missing, there is only brcm/brcmfmac4334-sdio.rockchip,rk 3318-box.txt what can be offered to the system next?

 

 

Edited by Борис Макаров
Link to comment
Share on other sites

Driver for integrated Wi-Fi card already compiled to Linux kernel.

So, you should put to the brcm folder:

* exactly one *.bin file, which is firmware for your Wi-Fi card. Kernel may look for this file during boot at several different filenames depending on hardware.

* exactly one *.txt file, which is nvram parameters specific to your Wi-Fi card. Kernel also may try to reach this file at different filenames, but will use just one.

clm_blob not always necessary, you may try to connect without it. Use nmtui command.

*.hcd files - firmware for bluetooth module, if you do not need bluetooth you may safely ignore this files and then bluetooth will not appear in system.

If your Tv-BOX was able to connect to Wi-Fi with the Android image installed, probably is will connect to same Wi-Fi with Armbian too, if the correct files are present in the brcm folder.

In my case (AP6212 wifi module), I found correct files inside backup image I made with Multitool before flashing the Armbian image:

original file was: fw_bcm43436b0.bin renamed: brcmfmac43430b0-sdio.bin

original file was: nvram_ap6212.txt  renamed: brcmfmac43430b0-sdio.txt

You will need to somehow mount a backup copy of the original disk image, then open it as normal disk on regular pc and search for the necessary files.

 

Link to comment
Share on other sites

Posted (edited)
On 5/30/2024 at 12:24 AM, Борис Макаров said:

I have placed a file nvram_2734с.txt in the /lib /firmware /brcm directory, no miracle happened,

open nvram_2734с.txt copy and paste all the contents and in the loaded config. bcmfmac4330* or brcmfmac4334* in /lib/firmware

On 5/30/2024 at 12:24 AM, Борис Макаров said:

I'm making my son a 3D printer on clipper.

you can install klipper with kiauh just fine with this build of armbian i've been using it for 3 years now. you just need git installed and clone kiauh repository for a very convenient klipper install.

Edited by Seth
Link to comment
Share on other sites

Posted (edited)
6/1/2024 в 5:41 AM, Seth сказал:

open nvram_2734с.txt copy and paste all the contents and in the loaded config. bcmfmac4330 * или brcmfmac4334 * в / lib /firmware

I read this from the above link.

 

6/1/2024 в 5:41 AM, Seth сказал:

you can install klipper with kiauh just fine with this build of armbian i've been using it for 3 years now. you just need git installed and clone kiauh repository for a very convenient klipper install.

I used Armbian_22.05.0-trunk_Rk3318-box_jammy_current_5.15.35_xfce_desktop, installed Klipper on a TV-box, installed Klipper firmware on a 3d printer (my son has an Anycubic Kobra 2 neo). And who would have thought that the TV-box does not see how the printer is connected under the Klipper. It says from the network address that the printer is not connected. I gave the command ls /dev/serial/by-id/*, in response, the directory serial does not exist. I looked at it - it's not there. Where to dig next?

Edited by Борис Макаров
Link to comment
Share on other sites

Posted (edited)
On 6/1/2024 at 2:54 PM, Борис Макаров said:

I gave the command ls /dev/serial/by-id/*, in response, the directory serial does not exist. I looked at it - it's not there. Where to dig next?

please post output of the following commands while the printer is plugged in the usb and is turned on.

ls /dev/tty*

and

lsusb

 

i never had problems with usb serial communication with armbian before. please check your klipper make menuconfig settings and that it is exactly what is intended for your printer mainboard. here is the guide for your printer.

Edited by Seth
Link to comment
Share on other sites

Posted (edited)
10 часов назад, Seth сказал:

Welcome to Armbian 22.05.0-trunk Jammy with Linux 5.15.35-rockchip64

No end-user support: built from trunk

System load:   25%              Up time:       15 min
Memory usage:  11% of 3.88G     IP:            192.168.1.55
CPU temp:      50°C             Usage of /:    19% of 28G

[ 263 security updates available, 478 updates total: apt upgrade ]
Last check: 2024-06-04 17:39

[ General system configuration (beta): armbian-config ]

Last login: Tue Jun  4 17:37:13 2024 from 192.168.1.68
pi@rk3318-box:~$ ls /dev/tty*
/dev/tty    /dev/tty2   /dev/tty31  /dev/tty43  /dev/tty55  /dev/ttyS0
/dev/tty0   /dev/tty20  /dev/tty32  /dev/tty44  /dev/tty56  /dev/ttyS1
/dev/tty1   /dev/tty21  /dev/tty33  /dev/tty45  /dev/tty57  /dev/ttyS2
/dev/tty10  /dev/tty22  /dev/tty34  /dev/tty46  /dev/tty58  /dev/ttyS3
/dev/tty11  /dev/tty23  /dev/tty35  /dev/tty47  /dev/tty59  /dev/ttyS4
/dev/tty12  /dev/tty24  /dev/tty36  /dev/tty48  /dev/tty6   /dev/ttyS5
/dev/tty13  /dev/tty25  /dev/tty37  /dev/tty49  /dev/tty60  /dev/ttyS6
/dev/tty14  /dev/tty26  /dev/tty38  /dev/tty5   /dev/tty61  /dev/ttyS7
/dev/tty15  /dev/tty27  /dev/tty39  /dev/tty50  /dev/tty62
/dev/tty16  /dev/tty28  /dev/tty4   /dev/tty51  /dev/tty63
/dev/tty17  /dev/tty29  /dev/tty40  /dev/tty52  /dev/tty7
/dev/tty18  /dev/tty3   /dev/tty41  /dev/tty53  /dev/tty8
/dev/tty19  /dev/tty30  /dev/tty42  /dev/tty54  /dev/tty9
pi@rk3318-box:~$ lsusb
Bus 005 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 004 Device 003: ID c0f4:01b0 USB usb keyboard
Bus 004 Device 002: ID 214b:7250 Huasheng Electronics USB2.0 HUB
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@rk3318-box:~$

 

Edited by Борис Макаров
Link to comment
Share on other sites

Posted (edited)

Many thanks to all those who helped me launch the TV-box, I am very grateful to these people who help out newcomers with their advice. Thanks  jock, I deleted brltty using the command:

13 часов назад, jock сказал:

sudo apt remove brltty

and oh, a miracle the board worked, the connection to the printer took place!

Edited by Борис Макаров
Link to comment
Share on other sites

@Alex ThreeD actually it is in the wild and it looks to work right to me, also executes boot.scr script. boot.scr is essential to read armbianEnv.txt and apply dtb overlays as well.

Did you notice something wrong?

Link to comment
Share on other sites

Boot process stops after these lines:

Cannot lookup file /extlinux/extlinux.conf
Cannot lookup file /boot/extlinux/extlinux.conf
Cannot lookup file /boot.scr.uimg
Cannot lookup file /boot.scr
Cannot lookup file /boot/boot.scr.uimg
Cannot lookup file efi/boot/bootaa64.efi
Card did not respond to voltage select! : -110
No ethernet found.
No ethernet found.
=>

 

It seems that my /boot/boot.scr is silently ignored (at first i was thought it is not even looked for because there is no "Cannot lookup file /boot/boot.scr").

I'll try to enable more logs somehow.

File definitely could be loaded by uboot, when I do it manually:

=> load mmc 1 $loadaddr /boot/boot.scr
5143 bytes read in 14 ms (358.4 KiB/s)
=> md.b $loadaddr 80
00800800: 27 05 19 56 ad 25 ac 5b 66 65 49 4f 00 00 13 d7  '..V.%.[feIO....
00800810: 00 00 00 00 00 00 00 00 6d 84 bc 01 05 02 06 00  ........m.......
00800820: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00800830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00800840: 00 00 13 cf 00 00 00 00 23 20 44 4f 20 4e 4f 54  ........# DO NOT
00800850: 20 45 44 49 54 20 54 48 49 53 20 46 49 4c 45 0a   EDIT THIS FILE.
00800860: 23 0a 23 20 50 6c 65 61 73 65 20 65 64 69 74 20  #.# Please edit
00800870: 2f 62 6f 6f 74 2f 61 72 6d 62 69 61 6e 45 6e 76  /boot/armbianEnv

 

Link to comment
Share on other sites

On 6/9/2024 at 9:46 PM, Alex ThreeD said:

The problem was in btrfs root-/boot-fs. It is broken again in uboot 24.01 (I'll try to look into it later)

Let's run the wheel and bump to v2024.04 ? Every u-boot bump is a lottery ticket 😑

Link to comment
Share on other sites

I've finally managed to boot from btrfs in uboot 2024.01.

The problem was not a new bug (there was only a few small btrfs related changes since previously used uboot 2022.10), but some old limitations/bugs uncovered by uboot's switch from distroboot to bootflow.

One bug has already been fixed in 2024.04 and another (out of bounds write) is not fixed yet. I have sent PR to armbian and will try to push it uboot upstream (ohhh, good ol maillists)

Link to comment
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

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

Important Information

Terms of Use - Privacy Policy - Guidelines