Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

内蒙联通E900V21D(S905L3-B,主板5800-2amba02)刷入armbian成功。 #2447

Open
Leona233 opened this issue Jul 25, 2024 · 8 comments
Labels
documentation Improvements or additions to documentation essence Recommended essence posts new box Research Fills in the Blanks support This need is supported

Comments

@Leona233
Copy link

Leona233 commented Jul 25, 2024

记录历程:
拆机图。
IMG_3382
IMG_3504(20240725-233111)

所需工具:

外设:

  • 显示屏
  • hdmi线
  • 网线
  • 光猫/路由器
  • 金士顿16G U盘
  • 双usb线
  • 一小段导线(用于线刷短接)。

软件:

  • USB_Burning_Tool_v2.1.6.8(线刷工具)
  • rufus-4.5.exe(镜像烧录工具)
  • 开心电视助手 - YesStbTool v6.0 (ADB)
  • MobaXterm_Personal_24.2.exe(SSH)

镜像:

  • [ATV桌面]S905L3B通刷ATV9原生固件2024.img 见原帖:https://www.znds.com/tv-1247230-1-1.html
  • Armbian_24.8.0_amlogic_s905l3b-e900v22e_jammy_6.1.96_server_2024.07.01.img
    注意:刷机过程中本人遇到的各种问题写在了文章末尾,并附上了本人的解决办法,欢迎大家参考。

线刷ATV桌面

  1. 连接电源、网线、hdmi线,usb连接电脑。
  2. 关机,进入线刷模式。5800-2amba02主板线刷短接点参考:https://www.znds.com/tv-1235169-1-1.html
  3. 使用USB_Burning_Tool进行线刷,选择ATV9镜像刷机后拔下USB,开机,进入ATV9桌面。05307E66BBCA45938E8C75E059545A20

烧录armbian镜像

  1. U盘连接电脑,备份文件后格式化为FAT32。
  2. 打开RUFUS,引导文件选择armbian镜像,点击「开始」写入镜像。

U盘引导启动armbian

  1. 打开路由器管理页,确认盒子内网ip。打开开心电视盒子,输入内网ip连接。(固件默认已开启ADB,若未开启需自行打开USB调试)
  2. 点击 调试>晶晨芯片>「从U盘/SD卡启动」
  3. 盒子开始关机重启。屏幕一开始会显示恢复模式安卓小绿人,一段时间后屏幕黑掉。根据分享山东移动E900V22D刷armbian+引导程序 #1256 得知,此为主板5800-2amba02通病,armbian启动后hdmi无信号。因此需打开路由器管理页寻找设备连接情况,如armbian运行并联网成功,则会在设备列表中显示;否则,说明固件有问题,建议换其他固件/dtb重试。
    5~OBBXYYMQXDYCR66Q~QN

SSH登录盒子,安装armbian到板载emmc

  1. 由于没有hdmi输出所以没办法直接调试,但好在网络是好的,我们可以借助ssh进入盒子系统。这里我使用MobaXterm,其他ssh终端理论上都可行。ssh输入ip,端口22,账号root 密码1234,进入系统。
  2. 安装命令:armbian-install -m yes,格式选择ext4,dtb选择第122项。安装成功。
    U{4WRH}3%~APGSO9G(C1YOM

过程中遇到的问题

  • 本人安装ATV9镜像之前曾经胡乱线刷了一堆镜像,把原厂的mac地址丢失了,导致ATV9每次开机都是随机地址,但可以正常上网。然而在U盘引导Armbian后,机器无法连接到网络。解决方法:通过https://www.znds.com/tv-1213499-1-1.html 帖子找到了大神VastStarGames的博客:http://vaststargames.com/read.php?tid=24 ,在录入底板上的原mac地址后,随机mac问题再也没有出现,并且armbian可以正常上网了。

  • 刷入ATV9后意外发现ATV9非常好用,而且发现它可以调用遥控器传感器,所以研究了一下ATV9使用遥控器的方法。本人将从帖子https://www.znds.com/tv-1235401-19-11.html 找到的安卓4.4固件刷入盒子后发现遥控器完全可以正常使用,因此产生想法想将遥控码文件移植到ATV9上。然而比对后发现,安卓4.4与安卓9的遥控码文件存在些许差异,安卓4.4为:/etc/remote.conf,安卓9为:/vendor/etc/remote.tab1。移植需要做的措施:

使用开机助手盒子导出文件,文本编辑器打开两个文件,找到remote.conf的「factory_code = 0xc43b0001」 ,其中「0xc43b」为遥控器设备编号。对应remote.tab1中的「custom_code = xxx」。将xxx替换为「0xc43b」(或者你的factory_code中的值);
将key_begin至key_end的值从remote.conf原封不动替换到remote.tab1,自此移植完成,保存。
再使用开心盒子助手导入文件,遥控器便可以正常使用了。

  • 本人一开始使用balenaEtcher烧录,但一直报错,且无法引导。最终使用rufus-4.5烧录成功。

  • 细心的网友会注意到,本人选择烧录的固件为:s905l3b-e900v22e.dtb,其中对应的armbian的安装列表为124项,但在我烧录的时候使用124项安装报错:
    dd: fsync failed for '/dev/mmcblk2': Input/output error 8191+0 records in 8191+0 records out 4193792 bytes (4.2 MB, 4.0 MiB) copied, 2.09829 s, 2.0 MB/s [ ERROR ] Failed to write bootloader using [ dd ].

  • 在更换安装列表122项后,刷机成功。

@ophub
Copy link
Owner

ophub commented Jul 26, 2024

多谢分享,教程图文并茂,安卓系统镜像也提供了,刷机教程也细致如丝,盒子的照片和短接点也进行了示意,难得一见的精品分享贴。

根据你的分享成果,我随后添加到设备列表里。

@ophub ophub added documentation Improvements or additions to documentation support This need is supported essence Recommended essence posts new box Research Fills in the Blanks labels Jul 26, 2024
@ophub
Copy link
Owner

ophub commented Jul 26, 2024

现在添加了130是这个设备的配置,和120,122配置相同,可以下载s905l3的默认固件使用。

@ophub
Copy link
Owner

ophub commented Jul 27, 2024

https:/ophub/kernel/releases/tag/tools

安卓系统我转存了一份到上面的地址了。

@Leona233
Copy link
Author

多谢分享,教程图文并茂,安卓系统镜像也提供了,刷机教程也细致如丝,盒子的照片和短接点也进行了示意,难得一见的精品分享贴。

根据你的分享成果,我随后添加到设备列表里。

非常感谢!
顺便分享一些其他问题。
最近几天我正在尝试让机顶盒上的led灯正常驱动。
从右到左,应该依次是电源灯、网络指示灯、遥控器信号灯。
IMG_3541
在ATV9固件中,这三个灯可以正常驱动,在开机后电源灯、网络灯绿色,遥控信号灯(绿色)在按下遥控器后闪烁。
基于这个原因,我曾认为通过驱动cpu特定的引脚(最有可能是gpio_out)可以实现对盒子的灯光控制。于是我找到了这篇文章:https://blog.csdn.net/ic2121/article/details/132783021 题主演示了一种通过操作gpio输出电平直接控制灯光亮灭的方法。
我尝试了很多办法,包括把gpio接口一个一个试,但最终只找到了3个控制led的引脚,而没找到可以控制电源灯的引脚。原因不清楚。

led 实际端口 是否可调
net_green 506
net_red 505
sys_green -  
sys_red -  
remote 507

另外如果有好的编写驱动的方法,希望解答一下!

@ophub
Copy link
Owner

ophub commented Jul 28, 2024

led灯的显示红绿效果在dts文件里也有一些代码设置,你可以在内核源码里找已有的参考怎么写,编译内核测试一下。

仅编dts可以在编译时选择参数-m dtbs,编一次1两分钟的事,方便快速测试。

https:/ophub/amlogic-s9xxx-armbian/tree/main/compile-kernel

https:/unifreq/linux-6.6.y/tree/main/arch/arm64/boot/dts/amlogic

@Leona233
Copy link
Author

led灯的显示红绿效果在dts文件里也有一些代码设置,你可以在内核源码里找已有的参考怎么写,编译内核测试一下。

仅编dts可以在编译时选择参数-m dtbs,编一次1两分钟的事,方便快速测试。

https:/ophub/amlogic-s9xxx-armbian/tree/main/compile-kernel

https:/unifreq/linux-6.6.y/tree/main/arch/arm64/boot/dts/amlogic

如果只编辑设备树的话,是否可以选择跳过编译kernel的步骤,直接选择使用DTC修改设备树?

@ophub
Copy link
Owner

ophub commented Jul 28, 2024

可以反编译修改

@Leona233
Copy link
Author

可以反编译修改

尝试了一下反编译并加入led驱动,可以正常运行,但会变得不稳定,而且有很多奇怪的bug。
附上一段比较稳定的案例代码(加入x7-5g中):

	gpioleds {
		compatible = "gpio-leds";
		led2_red {
			lable = "led2_red";
			gpios = <0x64 0x04 0x00>;
			default-state = "on";
		};

		led2_green {
			lable = "led2_green";
			gpios = <0x64 0x05 0x00>;
			default-state = "on";
		};


		led3 {
			lable = "led3";
			gpios = <0x64 0x06 0x00>;
			default-state = "off";
			linux,default-trigger = "timer";
		};
	};

其中linux,default-trigger只能给其中一个led用,两个同时用就无法开机。而且不支持磁盘使用等等回调,只能用heartbeat和timer。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation essence Recommended essence posts new box Research Fills in the Blanks support This need is supported
Projects
None yet
Development

No branches or pull requests

2 participants