Jump to content

Beelink X2 with armbian possible?


tpc010

Recommended Posts

Latest Armbian for OPi PC (5.14) works quite well for the Beelink X2. The /boot/bin/beelinkx2.bin file seems to work as it should. I made the below script to do modifications to the Armbian_5.14_Orangepipc_Debian_jessie_3.4.112.7z file in order to suit the Beelink X2.

Everything seems to work except wifi and internal emmc.

OS=Armbian_5.14_Orangepipc_Debian_jessie_3.4.112
RAW="${OS}.raw"
MNT=x2



echo ""
echo " *-Fetching Armbian-*"
wget "http://mirror.igorpecovnik.com/${OS}.7z"

echo ""
echo " *-Unpacking Armbian-*"
/usr/bin/7zr e "${OS}.7z" "$RAW"

echo ""
echo " *-Mounting image-*"
mount -t ext4 -o loop,offset=$((2048*512)) "$RAW" "$MNT"

echo ""
echo " *-Making fixes to image-*"
echo "Beelink X2" > "$MNT/root/.machine.id"
echo "beelinkx2" > "$MNT/etc/hostname"
(cd "$MNT/boot"; ln -sf bin/beelinkx2.bin script.bin)

echo ""
echo " *-Unmounting the image-*"
umount "$MNT"

echo ""
echo " *-Ready-*"

Link to comment
Share on other sites

 

Latest Armbian for OPi PC (5.14) works quite well for the Beelink X2. The /boot/bin/beelinkx2.bin file seems to work as it should. I made the below script to do modifications to the Armbian_5.14_Orangepipc_Debian_jessie_3.4.112.7z file in order to suit the Beelink X2.

 

Thx for the feedback! But we have currently already a board config for X2 so next logical step is to adjust board config in the following way:

BOOTCONFIG=orangepi_pc_defconfig
MODULES="#gpio_sunxi sndspdif sunxi_sndspdif sunxi_spdif sunxi_spdma ap6211"
MODULES_NEXT=""
CPUMIN=240000
CPUMAX=1200000

Switching to orangepi_pc_defconfig will enable eMMC, thermal settings have to be adopted to 'overheats as hell' (but I'll make some tests again with applied heat pad and metal plate since we should assume that every X2 owner uses his device inside the enclosure) and then anyone has to add/fix the Wi-Fi driver to sun8i sources if not already there.

Link to comment
Share on other sites

Thx for the feedback! But we have currently already a board config for X2 so next logical step is to adjust board config in the following way:

BOOTCONFIG=orangepi_pc_defconfig
MODULES="#gpio_sunxi sndspdif sunxi_sndspdif sunxi_spdif sunxi_spdma ap6211"
MODULES_NEXT=""
CPUMIN=240000
CPUMAX=1200000

Switching to orangepi_pc_defconfig will enable eMMC, thermal settings have to be adopted to 'overheats as hell' (but I'll make some tests again with applied heat pad and metal plate since we should assume that every X2 owner uses his device inside the enclosure) and then anyone has to add/fix the Wi-Fi driver to sun8i sources if not already there.

Thanks for info about the board config! Since I am relative new to Armbian I don't understand how to use it? Is this something I can use if I compile Armbian myself? I have not set up an environment to compile Armbian so far.

Link to comment
Share on other sites

Thanks for info about the board config! Since I am relative new to Armbian I don't understand how to use it? Is this something I can use if I compile Armbian myself? I have not set up an environment to compile Armbian so far.

 

It looks like we should add the Beelink X2 to list of officially supported boards with first officially H3 build (to be released soon). In case you've a spare SD card (4 GB are enough), please use our lima-memtester Armbian test image (originally created for BPi M2+ but after a small modification -- see below -- this can be used to test the X2 too) as outlined here in post #4: http://forum.armbian.com/index.php/topic/1322-testers-wanted-testing-dram-reliability-on-bpi-m2-and-nanopi-m1/

 

The only modification: Please create /boot/bin/beelinkx2.fex with the contents from here http://sprunge.us/UcBT  (everything and including between "[product]" and "corekeeper_enabled = 1") with one minor modification: dram_clk = 648. Then do

fex2bin /boot/bin/beelinkx2.fex /boot/bin/beelinkx2.bin
ln -sf /boot/bin/beelinkx2.bin /script.bin
armbianmonitor -r && reboot

And after the reboot you should let "lima-memtester 100M" run for at least 1 hour and check whether a spinning cube is shown on the monitor (with gray background, a glowing red background would be a bad sign). Then please report back in the other thread and post also a screenshot how temperatures/throttling looked like (the thermal pad on H3 and the large metal plate seem okish to improve heat dissipation).

 

BTW: I tried to enable eMMC but get then kernel panics and stuff like that, so won't waste any time with this for now. Also regarding Wi-Fi at least I won't look into it because my need for 2.4Ghz Wi-Fi is zero. So anyone else has to take care that a 'modprobe ap6211' will succeed and Wi-Fi gets useable.

Link to comment
Share on other sites

Download section is prepared :)

Great, I'm currently testing DRAM reliability at 672 MHz (just to be sure and then choosing the usual 624 MHz we're using on any H3 device due to identical u-boot settings).

 

Regarding Wi-Fi: is this already enough to confirm Wi-Fi is working with the driver we use for BPi M2+?

 

 

root@beelinkx2:/home/tk# modprobe bcmdhd

root@beelinkx2:/home/tk# iw list
Wiphy phy0
	Band 1:
		Frequencies:
			* 2412 MHz [1] (20.0 dBm)
			* 2417 MHz [2] (20.0 dBm)
			* 2422 MHz [3] (20.0 dBm)
			* 2427 MHz [4] (20.0 dBm)
			* 2432 MHz [5] (20.0 dBm)
			* 2437 MHz [6] (20.0 dBm)
			* 2442 MHz [7] (20.0 dBm)
			* 2447 MHz [8] (20.0 dBm)
			* 2452 MHz [9] (20.0 dBm)
			* 2457 MHz [10] (20.0 dBm)
			* 2462 MHz [11] (20.0 dBm)
			* 2467 MHz [12] (20.0 dBm)
			* 2472 MHz [13] (20.0 dBm)
			* 2484 MHz [14] (20.0 dBm)
		Bitrates (non-HT):
			* 1.0 Mbps
			* 2.0 Mbps (short preamble supported)
			* 5.5 Mbps (short preamble supported)
			* 11.0 Mbps (short preamble supported)
			* 6.0 Mbps
			* 9.0 Mbps
			* 12.0 Mbps
			* 18.0 Mbps
			* 24.0 Mbps
			* 36.0 Mbps
			* 48.0 Mbps
			* 54.0 Mbps
	max # scan SSIDs: 10
	max scan IEs length: 2048 bytes
	Retry short limit: 7
	Retry long limit: 4
	Coverage class: 0 (up to 0m)
	Supported Ciphers:
		* WEP40 (00-0f-ac:1)
		* WEP104 (00-0f-ac:5)
		* TKIP (00-0f-ac:2)
		* CCMP (00-0f-ac:4)
		* CMAC (00-0f-ac:6)
	Available Antennas: TX 0 RX 0
	Supported interface modes:
		 * IBSS
		 * managed
		 * AP
		 * P2P-client
		 * P2P-GO
	software interface modes (can always be added):
	valid interface combinations:
		 * #{ AP } <= 1, #{ managed } <= 3, #{ P2P-client, P2P-GO } <= 2, #{ IBSS } <= 1,
		   total <= 4, #channels <= 2
	Supported commands:
		 * new_interface
		 * set_interface
		 * new_key
		 * start_ap
		 * set_bss
		 * join_ibss
		 * set_pmksa
		 * del_pmksa
		 * flush_pmksa
		 * remain_on_channel
		 * frame
		 * frame_wait_cancel
		 * set_wiphy_netns
		 * set_channel
		 * tdls_oper
		 * connect
		 * disconnect
	Supported TX frame types:
		 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
		 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
	Supported RX frame types:
		 * IBSS: 0xd0
		 * managed: 0x40 0xd0
		 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
		 * P2P-client: 0x40 0xd0
		 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
	Device supports T-DLS. 

 

 

 

Remaining open issues:

  • Wi-Fi/ap6211 not working using bcmdhd module
  • Access to eMMC not possible
Link to comment
Share on other sites

It looks like we should add the Beelink X2 to list of officially supported boards with first officially H3 build (to be released soon). In case you've a spare SD card (4 GB are enough), please use our lima-memtester Armbian test image (originally created for BPi M2+ but after a small modification -- see below -- this can be used to test the X2 too) as outlined here in post #4: http://forum.armbian.com/index.php/topic/1322-testers-wanted-testing-dram-reliability-on-bpi-m2-and-nanopi-m1/

 

The only modification: Please create /boot/bin/beelinkx2.fex with the contents from here http://sprunge.us/UcBT  (everything and including between "[product]" and "corekeeper_enabled = 1") with one minor modification: dram_clk = 648. Then do

fex2bin /boot/bin/beelinkx2.fex /boot/bin/beelinkx2.bin
ln -sf /boot/bin/beelinkx2.bin /script.bin
armbianmonitor -r && reboot

And after the reboot you should let "lima-memtester 100M" run for at least 1 hour and check whether a spinning cube is shown on the monitor (with gray background, a glowing red background would be a bad sign). Then please report back in the other thread and post also a screenshot how temperatures/throttling looked like (the thermal pad on H3 and the large metal plate seem okish to improve heat dissipation).

 

BTW: I tried to enable eMMC but get then kernel panics and stuff like that, so won't waste any time with this for now. Also regarding Wi-Fi at least I won't look into it because my need for 2.4Ghz Wi-Fi is zero. So anyone else has to take care that a 'modprobe ap6211' will succeed and Wi-Fi gets useable.

 

I would be happy if the Beelink X2 was officially supported by Armbian! :)  I have two units of the Beelink X2 and will be glad to help out to the best of my abilities. I am a seasoned Unix/Network administrator but not experienced in software development.

 

I managed to start up the "lima-memtester 100M". It is now running and I will post my results in the other thread in about an hour or so.

A big Thank You to tkaiser and Igor for all your good work with Armbian!

Link to comment
Share on other sites

Seems ok, but maybe would be good to compare fw extracted from offical image to AP6212 fw included in armbian.

 

I've been sent to this page where a firmware update package is available. Since I'm not interested in 2.4Ghz Wi-Fi at all maybe someone else wants to have a look?

 

A big Thank You to tkaiser and Igor for all your good work with Armbian!

 

Please don't forget about the other contributors who did a great job!

 

Regarding X2 still open issues (at least I won't look into):

  • Confirm that Wi-Fi really works using bcmdhd driver
  • Enable access to eMMC (script.bin tweaks -- we should keep in mind that script.bin currently used is extracted from an Android image that's supposed to run off eMMC and not SD card!)
Link to comment
Share on other sites

I tried getting the wifi working a while back, but not a serious effort as I typically use a better performing USB Wi-Fi dongle. The main hurdle on the internal Wi-Fi was that the drivers exist in the sun7i but not the sun8i kernel. I was more interested in the eMMC, but didn't even know where to start. 

Link to comment
Share on other sites

The main hurdle on the internal Wi-Fi was that the drivers exist in the sun7i but not the sun8i kernel. I was more interested in the eMMC, but didn't even know where to start. 

 

Sure, but the former has changed (Igor included Broadcom drivers that are known to work with BPi M2+ that uses AP6212 instead of AP6181) so testing again would make some sense (and should be done by someone with some knowledge in this area -- my personal opinion regarding Wi-Fi + Linux: sucks too much ;) ).

 

And maybe the only problem with the eMMC is that some pin mapping has to be adjusted since the original fex settings assume a different order of the mmc interfaces if I understood correctly (running of eMMC and not SD card as it's now the case with Armbian)

Link to comment
Share on other sites

Im using the Ubuntu 16.04 desktop build (from source 5.14) as the jessie desktop build failed for some reason. Where is the updated download link for the beelink images ?

 

I would suspect Igor is still waiting for user feedback regarding Wi-Fi / bcmdhd driver (and maybe eMMC feedback as well) before releasing an own image. And I really hope someone is looking into this prior to release of 5.15 (that will officially support X2 then :) )

Link to comment
Share on other sites

I fixed eMMC and led stuff: http://sprunge.us/iRXM

 

At the moment nand_sata_install.sh is running and if that succeeds i push the new fex into our repo.

 

Edit: Beelink X2 running off eMMC: http://sprunge.us/AgXZ (commit here). Regarding Wi-Fi dmesg output looks not that promising but I still won't look into (2.4GHz band useless here).

 

So anyone trying out the image should at least use the corrected fex file in github repo and replace /boot/bin/beelinkx2.bin (use fex2bin to convert) and reboot.

Link to comment
Share on other sites

http://www.armbian.com/beelinkx2/

 

But it's untested.

I did a quick test of Armbian_5.14_Beelinkx2_Debian_jessie_3.4.112.7z.

 

It boots up just like it should, does the first reboot and resizes the SD-card just like it should. At first login everything looks as expected. So the basic image seems flawless. :)

 

Regarding wifi I can't get it to work. It loads the bcmdhd driver but I can't get the interface up:

root@beelinkx2:~# ifconfig wlan0 up
SIOCSIFFLAGS: Operation not permitted
root@beelinkx2:~# iwlist wlan0 scan
wlan0     Interface doesn't support scanning.

If I do the same two commands with a TP-Link WN-725N USB wifi dongle it works and I get a list of the available networks.

 

However, I am very happy that Beelink X2 will be supported by Armbian and for my personal use wifi is not important. Hopefully the wifi issue and emmc access can be solved later on.

Link to comment
Share on other sites

I did some more testing on the wlan issue. There seems to be some sort of missmatch regarding the driver. Error message: dhdsdio_download_code_file: Open firmware file failed /lib/firmware/ap6212/fw_bcm40181a2.bin

 

I tried to make a symbolic link named fw_bcm40181a2.bin pointing to the existing driver fw_bcm43438a0.bin in the /lib/firmware/ap6212 directory but no success.

 

Dmesg:

[ 2147.698347] dhd_bus_devreset: == WLAN ON ==
[ 2147.698788] F1 signature read @0x18000000=0x1591a962
[ 2147.699479] dhd_conf_set_hw_oob_intr: Enable HW OOB for 43362
[ 2147.705885] F1 signature OK, socitype:0x1 chip:0xa962 rev:0x1 pkg:0x9
[ 2147.708253] DHD: dongle ram size is set to 245760(orig 245760) at 0x0
[ 2147.710776] dhd_conf_read_config: Ignore config file /lib/firmware/ap6212/config.txt
[ 2147.710851] dhd_conf_set_fw_name_by_chip: firmware_path=/lib/firmware/ap6212/fw_bcm40181a2.bin
[ 2147.710901] Final fw_path=/lib/firmware/ap6212/fw_bcm40181a2.bin
[ 2147.710939] Final nv_path=/lib/firmware/ap6212/nvram.txt
[ 2147.710973] Final conf_path=/lib/firmware/ap6212/config.txt
[ 2147.712535] dhdsdio_download_code_file: Open firmware file failed /lib/firmware/ap6212/fw_bcm40181a2.bin
[ 2147.712594] _dhdsdio_download_firmware: dongle image file download failed
[ 2147.712710] dhd_net_bus_devreset: dhd_bus_devreset: -35
[ 2147.712754] dhd_prot_ioctl : bus is down. we have nothing to do
[ 2147.712797] dhd_net_bus_devreset: dhd_bus_devreset: -35
[ 2147.712938] wifi_platform_set_power = 0
[ 2147.712973] ======== PULL WL_REG_ON LOW! ========
[ 2147.713008] [wifi_pm]: set wl_reg_on 0 !
[ 2147.713043] wl_android_wifi_on: Failed
[ 2147.713077] dhd_open : wl_android_wifi_on failed (-35)
[ 2147.713118] dhd_stop: Enter ee5d9000
[ 2147.713148] wl_android_wifi_off in 1
[ 2147.713179] wl_android_wifi_off in 2: g_wifi_on=0
[ 2147.713210] wl_android_wifi_off out
[ 2147.713239] dhd_stop: Exit
[ 2147.713279] dhd_open: Exit ret=-1

Link to comment
Share on other sites

Hi tkaiser

 

Will update the config and check if ap6211 works. (Beelink config since it already in the build list)

 

It looks like we should add the Beelink X2 to list of officially supported boards with first officially H3 build (to be released soon). In case you've a spare SD card (4 GB are enough), please use our lima-memtester Armbian test image (originally created for BPi M2+ but after a small modification -- see below -- this can be used to test the X2 too) as outlined here in post #4: http://forum.armbian.com/index.php/topic/1322-testers-wanted-testing-dram-reliability-on-bpi-m2-and-nanopi-m1/

 

The only modification: Please create /boot/bin/beelinkx2.fex with the contents from here http://sprunge.us/UcBT  (everything and including between "[product]" and "corekeeper_enabled = 1") with one minor modification: dram_clk = 648. Then do

fex2bin /boot/bin/beelinkx2.fex /boot/bin/beelinkx2.bin
ln -sf /boot/bin/beelinkx2.bin /script.bin
armbianmonitor -r && reboot

And after the reboot you should let "lima-memtester 100M" run for at least 1 hour and check whether a spinning cube is shown on the monitor (with gray background, a glowing red background would be a bad sign). Then please report back in the other thread and post also a screenshot how temperatures/throttling looked like (the thermal pad on H3 and the large metal plate seem okish to improve heat dissipation).

 

BTW: I tried to enable eMMC but get then kernel panics and stuff like that, so won't waste any time with this for now. Also regarding Wi-Fi at least I won't look into it because my need for 2.4Ghz Wi-Fi is zero. So anyone else has to take care that a 'modprobe ap6211' will succeed and Wi-Fi gets useable.

Link to comment
Share on other sites

Firmware is missing. Extract https://transfer.sh/h6nda/ap6210.tar.xzto /lib/firmware so you will have /lib/firmware/ap6210 folder. Then unload bcmdhd driver if it is already loaded and load it with following command:

modprobe bcmdhd firmware_path=/lib/firmware/ap6210/bcmdhd.bin nvram_path=/lib/firmware/ap6210/nvram.txt

NOTE: Download link will be valid only for 14 days, but until then it will be fixed, I guess.

Edited by jernej
Link to comment
Share on other sites

Firmware is missing. Extract https://transfer.sh/h6nda/ap6210.tar.xzto /lib/firmware so you will have /lib/firmware/ap6210 folder. Then unload bcmdhd driver if it is already loaded and load it with following command:

modprobe bcmdhd firmware_path=/lib/firmware/ap6210/bcmdhd.bin nvram_path=/lib/firmware/ap6210/nvram.txt

NOTE: Download link will be valid only for 14 days, but until then it will be fixed, I guess.

Confirmed working!

root@beelinkx2:~# modprobe bcmdhd firmware_path=/lib/firmware/ap6210/bcmdhd.bin nvram_path=/lib/firmware/ap6210/nvram.txt
root@beelinkx2:~# lsmod
Module                  Size  Used by
bcmdhd                648477  0
sunxi_spdma             3703  1
sunxi_spdif             7037  1
sunxi_sndspdif          3885  0
sndspdif                2743  1
root@beelinkx2:~# ifconfig wlan0 up
root@beelinkx2:~# iwlist wlan0 scan
wlan0     Scan completed :
               bla, bla....

A VERY big thank you for your help! :)

Link to comment
Share on other sites

Firmware is missing. Extract https://transfer.sh/h6nda/ap6210.tar.xz  to /lib/firmware so you will have /lib/firmware/ap6210 folder. Then unload bcmdhd driver if it is already loaded and load it with following command:

modprobe bcmdhd firmware_path=/lib/firmware/ap6210/bcmdhd.bin nvram_path=/lib/firmware/ap6210/nvram.txt

NOTE: Download link will be valid only for 14 days, but until then it will be fixed, I guess.

 

Thx for firmware and instructions. @slinde and/or @markbirss: Please remember that fex file should be exchanged (and reboot in between) and one minor tweak should also be applied, see my last comment: https://github.com/igorpecovnik/lib/commit/60e935b34e3ed8b2ed14cf812fc30b08506b1651#commitcomment-17864605

 

EDIT: F*ck, we're moving really quick! So I think @Igor has to add the firmware bits to the specific package (and then please also change the USB detect mode since we're then finally done with X2)

Link to comment
Share on other sites

 @slinde and/or @markbirss: Please remember that fex file should be exchanged (and reboot in between) and one minor tweak should also be applied, see my last comment: https://github.com/igorpecovnik/lib/commit/60e935b34e3ed8b2ed14cf812fc30b08506b1651#commitcomment-17864605

 

When I did my last test and got wifi working I had already exchanged the fex/bin file to your latest version and rebooted. The "minor tweak" already seems to be include in the version of fex file I have.

Link to comment
Share on other sites

It seems that bluetooth is present on AP6210 but unfortunatelly not connected to SoC (based on fex file).

 

There might be easier way to make this driver work. ap6210 and ap6212 folders could be merged to one (for example, /lib/firmware/bcmdhd) and nvram.txt files renamed to something like nvram_ap6210.txt and nvram_ap6212.txt Then kernel config should be fixed to point to this merged folder. After module is rebuild, we could load bcmdhd based on board with only

modprobe bcmdhd nvram_path=/lib/firmware/bcmdhd/nvram_ap6210.txt

for example...

Link to comment
Share on other sites

Perhaps now is the time to make a firmware deb package. What's not packed to kernel is still in a ZIP which is unpacked over rootfs :(  :)

 

Yes, Cubietruck has this chip and this firmware is even little newer that the one packed with (sun7i) kernel.

Link to comment
Share on other sites

Uh, I checked original fex file extracted from Android image and there is a good chance that bluetooth could work. If someone is interested, just ask and I will prepare instructions for it (blindly, cos I don't own this board).

Link to comment
Share on other sites

Yes, @jernej kindly guide us with some instructions and we can test

 

Uh, I checked original fex file extracted from Android image and there is a good chance that bluetooth could work. If someone is interested, just ask and I will prepare an instructions for it (blindly, cos I don't own this board).

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines