Android 9 Source Code

This UART2 has two functions: serial port printing debugging function and common serial port.

The two config are as follows:

FIQ debugging function config of UART2:

&uart2 {
	status = "disabled";

Common serial port config of UART2:

&uart2 {
	status = "okay";

&fiq_debugger {
	rockchip,serial-id = <0xffffffff>;
	status = "okay";
1 Like

It does not work.

EDGE does not start if uart1 is connected.
How to fix it?

Please describe in more detail the phenomena and steps of the problem, and what is the serial device you are connected to?

I connected Gps receiver.
Vim1 and vim2 work perfect. EDGE does not boot…

First confirm the voltage matching, 3.3V level is needed.

In addition, read and write permission for this serial port is required:

chmod 777 /dev/ttyS2

uart tool test download

To sum up, UART2 should be used as a common serial port. The following modifications are required:

  • Firstly, confirm whether the voltage of serial device matches or not.
  • uart2 config:
&uart2 {
	status = "okay";

&fiq_debugger {
	rockchip,serial-id = <0xffffffff>;
	status = "okay";
  • read and write permission for this serial port is required
--- a/init.rk30board.rc
+++ b/init.rk30board.rc
@@ -229,7 +229,9 @@ on boot
     chmod 0666 /sys/class/wol/rst_mcu
        #add for buzzer
        chmod 0666 /sys/class/w25q128fw/buzzer
+       #add for ttyS2
+       chmod 777 /dev/ttyS2
        #add for mac_addr
1 Like

No no, voltage and other is correct, I use 3.3V on EDGE header.
I mean that:

  1. If EDGE was start firstly and then I connect GPS on uart1, GPS works good, I can see all data on uart1.
  2. If I connect GPS on uart1 firstly, and then push power button on EDGE, EDGE does not boot. It shows rockchip logo only.

Please describe the problem clearly later. Add the following modifications:

--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -212,6 +212,8 @@ static int __abortboot(int bootdelay)
        int abort = 0;
        unsigned long ts;
+       return abort;

It fixes my issue.
Thank you!

One question.: how to repack img form out folder?

1 Like
$ source build/
$ lunch rk3399-userdebug
$ ./
$ ./

Yes, I try it, but is works strange. If I add new files in out folder or modif some files, then repack img with commands “. /” and “. /”. Sometime ROM don’t contain new files, sometime contain.
I don’t understand why it happens…
May be need something more?

If you add files to eg. out/*/system it won’t repack into the images since there are other prebuilt files that tell the image maker tools to only use the files previously built and your added files aren’t included there.
It’s part of Google’s security I think to make sure partitions haven’t been tampered with.
Android OS’s before Oreo didn’t have this problem.

Anyway, if you add any extra files in the out folder
just run ‘make -j4’ again then your files will be included in the built files.
Then just run ‘./’.
All your files will be included.

Changes to eg. build.prop won’t be saved as they are regenerated each time you run a build and has to match on each partition for the firmware to boot properly. You need to make changes to the source code eg. system.prop if you want this changed.


Oh, very interesting. Thank you so much!
Previously I built Nougaut and lower android…

I have issue with library for gps, it does not work in Pie.
I made library for gps (, I put it on system/lib/hw and system/lib64/hw but it does not work on EDGE Pie, but it works on other px5 devices on Oreo.
May be Pie has special path for gps?

1 Like

Just try it in only this directory:


Why only system/lib/hw/ ?
I build library for gps, and it puts 32bit library on system/lib/hw and 64bit library on system/lib64/hw automatically.

Sorry, I thought you only compiled 32-bit libraries.

Also, I have two phone with Pie, and first has in vendor/lib/hw and vendor/lib64/hw folders.
But second has in vendor/lib64/hw folder only.

They have not files in system folder…

You can try the vendor folder too, just make sure they aren’t in the system partition too.
You might need to modify the source code of your gps driver.
Most Rockchip lib files are stored in the vendor instead of system partition now.


I tried to copy in vendor folder from system folder manually, but library does not work.