Difference between revisions of "APITestPage"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
 
(89 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}}}
+
{{RockchipUnbrick|NanoPC-T4}}
| Smart4418 =
+
===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:23, 4 June 2024

1 Unbricking Method

If the ROM is not installed correctly, causing the development board to become bricked, and you might not have the opportunity to reinstall the ROM via an SD card, you need to enter Maskrom mode to unbrick it by erasing the storage device.

1.1 Windows Users

1.1.1 Download Required Files

  • Get the necessary tools: Visit here, find RKDevTool_v3.19_for_window.zip and DriverAssitant_v5.12.zip in the 05_Tools directory, and download them to your local machine.
  • Install Rockchip USB driver and RKDevTool: Extract DriverAssitant_v5.12.zip to install the Rockchip USB driver, and extract RKDevTool_v3.19_for_window.zip to obtain the Rockchip flashing tool RKDevTool.
  • Get the loader: Visit here, enter the tools directory corresponding to your CPU model, and download MiniLoaderAll.bin.

1.1.2 Enter Maskrom Mode to Erase the Storage Device

  • Connect NanoPC-T4 to your computer using a USB data cable.
  • Start RKDevTool on your computer.
  • Disconnect the power from NanoPC-T4, hold down the MASK button, connect the power, and release the button when you see Found One MASKROM Device displayed at the bottom of the interface, as shown below:

Rkdevtool found one maskrom device.png

  • Click the Advanced Function tab in the RKDevTool interface.
  • In the Boot text box, select MiniLoaderAll.bin, then click the Download button.
  • Select EMMC, click Switch Storage, then click the EraseAll button to erase the eMMC.

Rkdevtool erase emmc.png

  • At this point, NanoPC-T4 is restored to its initial state and can be normally booted via SD card or eMMC.

1.2 Linux/Mac Users

1.2.1 Download the Required Files

  • Get the necessary tools: Visit here and find upgrade_tool_v2.30_for_linux.tgz (or for Mac users, select upgrade_tool_v2.25_for_mac.tgz) in the 05_Tools directory and download it locally.
  • Get the loader: Visit here, enter the tools directory corresponding to your CPU model, and download MiniLoaderAll.bin.

1.2.2 Installation for upgrade_tool

The following commands are for Linux, with only slight differences in file and directory names for Mac users:

tar xzf upgrade_tool_v2.30_for_linux.tgz
cd upgrade_tool_v2.30_for_linux
sudo cp upgrade_tool /usr/local/sbin/
sudo chmod 755 /usr/local/sbin/upgrade_tool

1.2.3 Enter Maskrom Mode to Erase the Storage Device

  • Connect NanoPC-T4 to the computer using a USB data cable.
  • Disconnect the power from NanoPC-T4, hold down the MASK button, connect the power, and release the button after 4 seconds.
  • Check the connection with the following command:
upgrade_tool LD

A result similar to "DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=13 Mode=Maskrom SerialNo=" indicates that the device has been detected.

  • Erase the eMMC with the following command:
upgrade_tool EF MiniLoaderAll.bin
  • At this point, NanoPC-T4 has been restored to its initial state and can boot the system normally via SD card or eMMC.