Difference between revisions of "APITestPage"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
 
(91 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Android系统的使用==
 
===Android7 下使用4G模块EC20===
 
====连接方法====
 
{{#switch: {{{1}}}
 
| Smart4418 =
 
将EC20连接到底板的miniPCIe接口,以Smart4418底板为例,如下图所示:<br />
 
[[File:Smartxx18-4G-EC20.jpg|frameless|400px]]<br>
 
| Smart6818 =
 
将EC20连接到底板的miniPCIe接口,以Smart4418底板为例,如下图所示:<br />
 
[[File:Smartxx18-4G-EC20.jpg|frameless|400px]]<br>
 
| Smart4418SDK 1305 =
 
将EC20连接到底板的miniPCIe接口,以Smart4418底板为例,如下图所示:<br />
 
[[File:Smartxx18-4G-EC20.jpg|frameless|400px]]<br>
 
| Smart4418SDK 1606 =
 
将EC20连接到底板的miniPCIe接口,以Smart4418底板为例,如下图所示:<br />
 
[[File:Smartxx18-4G-EC20.jpg|frameless|400px]]<br>
 
| #default =
 
连接时,需要通过USB to miniPCIe转接板转接EC20,再连接到主板的USB Host端口,以T2为例,如下图所示:<br /> 
 
[[File: T2-4G-EC20.jpg|frameless|400px]]<br>
 
}}
 
连接后无需额外的配置,启动Android后就可以使用4G上网了,跟Android手机类拟。<br />
 
  
{{#switch: {{{1}}}
+
{{BurnLinuxToExtDrive-Rockchip/zh|NanoPC-T4}}
| Smart4418 =
+
{{BurnLinuxToExtDrive-Rockchip|NanoPC-T4}}
===Android4.4 下使用4G模块华为ME909u-521===
+
(注:该模块只支持 Android4.4)
+
* Smart4418使用Android4.4系统,假设你已经接好4G通信模块(4G Model:ME909u-521, 该模块支持联通FDD-LTE),进入系统后,可直接使用4G通信模块。
+
[[File:4G Model-nanopc-t3.png|frameless|500px|4G Model]]
+
| #default =
+
}}
+
 
+
===更换Android开机Logo===
+
替换下面路径下的 logo.bmp:
+
<syntaxhighlight lang="bash">
+
/opt/FriendlyARM/smart4418/android/device/friendlyelec/nanopi3/boot/logo.bmp
+
/opt/FriendlyARM/smart4418/android/device/friendlyelec/nanopi2/boot/logo.bmp
+
</syntaxhighlight>
+
重新编译 Android 源代码。
+
===使用fastboot命令烧写android固件===
+
上电时在串口终端敲回车进入uboot命令行模式,然后输入以下命令:
+
<syntaxhighlight lang="bash">
+
fastboot 0
+
</syntaxhighlight>
+
For S5P4418, PC端可使用以下命令来更新emmc:
+
<syntaxhighlight lang="bash">
+
fastboot flash partmap partmap.txt
+
fastboot flash 2ndboot bl1-mmcboot.bin
+
fastboot flash fip-loader loader-mmc.img
+
fastboot flash fip-secure bl_mon.img
+
fastboot flash fip-nonsecure bootloader.img
+
fastboot flash boot boot.img
+
fastboot flash system system.img
+
fastboot flash cache cache.img
+
fastboot flash userdata userdata.img
+
</syntaxhighlight>
+
For S5P6818, PC端可使用以下命令来更新emmc:
+
<syntaxhighlight lang="bash">
+
fastboot flash partmap partmap.txt
+
fastboot flash 2ndboot bl1-mmcboot.bin
+
fastboot flash fip-loader fip-loader.img
+
fastboot flash fip-secure fip-secure.img
+
fastboot flash fip-nonsecure fip-nonsecure.img
+
fastboot flash boot boot.img
+
fastboot flash system system.img
+
fastboot flash cache cache.img
+
fastboot flash userdata userdata.img
+
</syntaxhighlight>
+
===Android证书===
+
Android 5 我们缺省采用的是自己生成的证书,位于:
+
<syntaxhighlight lang="bash">
+
  vendor/friendly-arm/nanopi3/security/
+
</syntaxhighlight>
+
Android 7 缺省采用的是:
+
<syntaxhighlight lang="bash">
+
  build/target/product/security/
+
</syntaxhighlight>
+
===Android7只连接HDMI的情况下性能优化===
+
====背景说明====
+
默认情况下,驱动会初始化两个framebuffer,分别用于主显示LCD和HDMI,如果项目需求只需要使用HDMI,不需要用LCD,则可以根据本章节的步骤进行修改,修改后会将HDMI设置为主显示,这样驱动只会初始化一个framebuffer,节约资源,对UI性能和开机速度会有相应的提升。<br />
+
本章节内容仅适用于 S5P6818 Android7, S5P4418修改方法类拟,只是需要调整一下相应的文件。<br />
+
====修改内核====
+
需要修改内核dts,禁止dp_drm_lvds节点, 如下所示:
+
<syntaxhighlight lang="bash">
+
--- a/arch/arm64/boot/dts/nexell/s5p6818-nanopi3-common.dtsi
+
+++ b/arch/arm64/boot/dts/nexell/s5p6818-nanopi3-common.dtsi
+
@@ -810,6 +810,7 @@
+
                        plane-names = "video", "rgb", "primary";
+
                };
+
                port@1 {
+
+                      status = "disabled";
+
                        reg = <1>;
+
                        back_color = < 0x0 >;
+
                        color_key = < 0x0 >;
+
@@ -820,7 +821,7 @@
+
 
+
&dp_drm_lvds {
+
        remote-endpoint = <&lcd_panel>;
+
-       status = "ok";
+
+      status = "disabled";
+
 
+
        display-timing {
+
                clock-frequency = <50000000>;
+
</syntaxhighlight>
+
编译后将获得新的 arch/arm64/boot/dts/nexell/s5p6818-nanopi3-rev*.dtb。 <br />
+
测试阶段可直接通过adb 更新到板子,命令如下:
+
<syntaxhighlight lang="bash">
+
adb root; adb wait-for-device; adb shell mkdir /storage/sdcard1/; adb
+
shell mount -t ext4 /dev/block/mmcblk0p1 /storage/sdcard1/
+
adb push arch/arm64/boot/dts/nexell/s5p6818-nanopi3-rev*.dtb /storage/sdcard1/
+
</syntaxhighlight>
+
完整的固件则需要替换android7源代码目录 device/friendlyelec/nanopi3/boot 下的文件
+
====修改env.conf====
+
修改 device/friendlyelec/nanopi3/boot/env.conf 增加一行:
+
<syntaxhighlight lang="bash">
+
lcdtype    HDMI1080P60
+
</syntaxhighlight>
+
此模式需要与android7启动后探测到的模式相同,否则会导致长时的黑屏状态,甚至无显示输出, 或者进入uboot命令行环境手工设置:
+
<syntaxhighlight lang="bash">
+
setenv lcdtype HDMI1080P60; saveenv; reset
+
</syntaxhighlight>
+
====修改system.prop====
+
修改android7中 device/friendlyelec/nanopi3/system.prop
+
<syntaxhighlight lang="bash">
+
ro.sf.lcd_density=240
+
</syntaxhighlight>
+
或其它自己认为更合适的值, 也可串口或adb环境下,wm density 240 来调整观察效果是否合适。
+
====编译Android====
+
根据wiki说明编译android 7并测试,遇到异常则请仔细检查前面的步骤
+

Latest revision as of 09:58, 29 October 2024

1 安装系统到M.2或USB硬盘

可以通过使用TF卡启动eFlasher系统,将引导和系统分别安装到不同存储设备,但是由于CPU不支持直接从M.2和USB设备引导,所以虽然系统可以安装到M.2和USB设备,但是引导仍然需要安装到eMMC或者TF卡。
操作步骤如下:

  • 准备一张32G或以上容量的TF卡;
  • 访问此处的下载地址下载文件名为XXXX-eflasher-multiple-os-YYYYMMDD-30g.img.gz的固件(位于"01_系统固件/02_SD卡刷机固件(SD-to-eMMC)"目录);
  • 将固件写入TF卡,在NanoPC-T4上连接好存储设备,插入TF卡上电开机,接下来要在界面上操作,如果没有显示设备,可以使用VNC代替,请参考使用VNC操作eFlasher;
  • 在eFlasher界面上,首先选择要安装的OS,然后选择引导安装的目的地 (通常选eMMC),以及选择系统安装的目的地(可以选eMMC,M.2硬盘,USB存储设备等),如下图所示:

Eflasher-select-boot-and-system-device.png

  • 没有eMMC时可使用TF卡作为引导,方法是将另一个TF卡通过USB读卡器插入USB端口,然后选择USB设备作为引导安装目的地,从而实现从TF卡引导,但系统存放在M.2或USB硬盘的目的;
  • 烧写完成后,从NanoPC-T4弹出SD卡,引导在eMMC的情况下,NanoPC-T4会自动重启至你刚刚烧写的系统,如果引导安装在TF卡,则需要拨掉电源,插入TF引导卡再上电开机;
  • 更详细的安装指南请参考此处;

2 Installing the System to M.2 or USB Drive

You can use a TF card to boot the eFlasher system, allowing the boot and system to be installed on different storage devices. However, since the CPU doesn’t support booting directly from M.2 and USB devices, the system can be installed on M.2 and USB devices, but the boot must still be installed on eMMC or a TF card.
Steps are as follows:

  • Prepare a TF card with a capacity of 32GB or larger.
  • Visit [the download link here](http://download.friendlyelec.com/APITestPage) to download the firmware file named XXXX-eflasher-multiple-os-YYYYMMDD-30g.img.gz (located in the “01_Official images/02_SD-to-eMMC images” directory).
  • Flash the firmware to the TF card, connect the storage device you intend to use on NanoPC-T4, insert the TF card and power on, we need to perform the operations in the eFlasher GUI. If your NanoPC-T4 does not have a display interface, you can use VNC; refer to Using VNC to Operate eFlasher.
  • In the eFlasher GUI, select the OS to install, and in the OS settings interface, choose the destination for boot installation (typically eMMC), then choose the destination for system installation (options include eMMC, M.2 hard drive, USB storage, etc.), as shown below:

Eflasher-select-boot-and-system-device.png

  • If no eMMC is available, the TF card can serve as the boot by inserting another TF card into the USB port via a USB card reader and selecting it as the boot destination, enabling booting from the TF card with the system stored on the M.2 or USB drive.
  • After flashing, eject the SD card from NanoPC-T4. If booting from eMMC, NanoPC-T4 will automatically restart into the newly flashed system. If boot installation is on a TF card, power off, insert the boot TF card, and power on again.
  • For a more detailed installation guide, please refer to this link.