Android transplantation on TQ2440 development board

Publisher:悠闲之旅Latest update time:2016-04-27 Source: eefocusKeywords:Android  TQ2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1. Current progress

1. Android can already run on the TQ2440 development board via NFS

I recently compiled the android file system myself and ran it on TQ. It has more bin programs than the panda version, and the basic functions have been implemented. You can download the file system from:
http://d.namipan.com/d/b64ce43b2388e5e1f66af181 49824b98cd13b926c4921f02
and try it out. I will organize it another day and post a detailed transplantation process and precautions.
Network settings:
route add default gw 192.168.1.1 dev eth0
setprop net.dns1 202.120.223.5
 

1. Use ADB
Ubuntu:
export ADBHOST=192.168.1.101
adb kill-server
adb start-server
adb shell
2. Battery causes shutdown during startup
Modification: frameworks/base/services/jni/com_android_server_BatteryService.cpp, see the attached patch. Add setprop battery.fake_ac 1
in the init.rc file

2. Current defects
1. The touch screen is not calibrated
2. The clock in Android stops, the zygote process ends, the system restarts, the clock is updated, but it stops again
III. Porting steps
1. Port the Android kernel to the TQ2440 development board
1. Download linux-2.6.25-android-1.0_r1.tar.gz from http://code.google.com/p/android/downloads/list
2. Unzip the kernel to the user directory, such as /root/kernel.git
3. Enter the kernel.git folder, such as cd ~/kernel.git/
4. Modify the nand flash partition settings in the arch/arm/plat-s3c24xx/common-smdk.c file, such as gedit arch/arm/plat-s3c24xx/common-smdk.c
Modify the static struct mtd_partition smdk_default_nand_part[] structure to:
static struct mtd_partition smdk_default_nand_part[] = {
        [0] = {
               .name        = 5. Download 
               the  IA32 GNU / Linux  TAR  file from  http://www.codesourcery.com/gnu_toolchains/arm/portal/release644 .​​​​ ​​ ​​ ​​ ​ ​​​ 6. Unzip the files to the user directory, such as /usr/local/arm/arm-2008q3 7. Enter the arm-2008q3/bin folder, such as cd ~/arm-2008q3/bin/ 8. Add the current path to the environment variable, such as export PATH=$PWD:$PATH, or modify the ~/.bashrc file and log in again 9. Enter the kernel folder, such as cd ~/kernel.git/ 10. Modify the Makefile file, such as gedit Makefile to change ARCH and CROSS_COMPILE #ARCH  ?= $(SUBARCH) ARCH  ?= arm #CROSS_COMPILE  ?= arm-eabi- CROSS_COMPILE  ?= arm-none-gnueabi- 11. Use make s3c2410_defconfig to configure the 2410 kernel by default 12. Run make menuconfig (1) Make sure the content in System Type ---> ARM system type () is Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442,S3C2443 (2) Make sure System Type ---> S3C2410 Machines --->  SMDK2410/A9M2410 is checked (3) Deselect the content related to Goldfish Device Drivers ---> Character devices ---> < > Goldfish TTY Driver Device Drivers ---> Power supply class support ---> < >  Goldfish battery driver (NEW) Device Drivers ---> Real Time Clock ---> < >  GOLDFISH (NEW) Device Drivers ---> Graphics support - --> Support for frame buffer devices ---> < >  Goldfish Framebuffer (4) Select S3C2410 LCD related content Device Drivers ---> Graphics support ---> Support for frame buffer devices ---> <*>  S3C2410 LCD framebuffer support Device Drivers ---> Graphics support  ---> Bootup logo --->  Standard black and white Linux logo Device Drivers ---> Graphics support --->  Bootup logo --->        
                      
        
        
                      
                      
                      
        
        
                      
                      
                      
        








             
             
      
      







 
 
 

 


   


   Standard 16-color Linux logo
Device Drivers ---> Graphics support ---> 
Bootup logo ---> 
   Standard 224-color Linux logo
(5) Select the required options for the Android kernel
Kernel Features ---> 
Use the ARM EABI to compile the kernel
General setup ---> 
Use full shmem filesystem
General setup ---> 
Enable Android's Shared Memory Subsystem
System Type ---> 
Support Thumb user binaries
Device Drivers ---> Android ---> 
Android log driver
Device Drivers ---> Android ---> <*> Binder IPC Driver
(6) Try to select the optional options for the Android kernel
Device Drivers ---> Android ---> 
RAM buffer console
Device Drivers ---> Android ---> 
Android timed gpio driver
Device Drivers ---> Android ---> 
Only allow certain groups to create sockets
(7) For other CONFIG options, please select them as well if the system supports them
CONFIG_ANDROID_POWER =y
CONFIG_ANDROID_POWER_STAT =y
CONFIG_ANDROID_POWER_ALARM =y
(You can search for ANDROID_POWER and other fields in the Kconfig file to make a selection, or directly modify the .config file)
13. Exit and save .config
2. Port the LCD driver to the Linux-2.6.25 kernel (Steps 2, 3, and 4 can refer to the manual, or refer to my other articles) For the
LCD porting of TQ2440, please refer to my other article: http://www.arm9.org.ru/viewthread.php?tid=3&extra=page=1
3. Port the touch screen driver to the Linux-2.6.25 kernel For

        the touch screen porting of TQ2440, please refer to my other article: http://www.arm9.org.ru/viewthread.php?tid=4&extra=page=1
Change line 256
        ts.dev->evbit[0] = BIT(EV_SYN) | BIT(EV_KEY) | BIT(EV_ABS);
        ts.dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT(BTN_TOUCH);
to:
ts.dev->evbit[0] = BIT_MASK(EV_SYN) | BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
ts.dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
4. Porting the network card driver to the Linux-2.6.25 kernel For

        the network card porting of TQ2440, please refer to my other article: http://www.arm9.org.ru/viewthread.php?tid=5&extra=page=1
5. Making an Android root file system that supports ARMv4 1. Download the Android root file system
from http://d.namipan.com/d/403e5eb4ec3af5d8029d9948 79808140f0c9222be3858a02
or
http://www.hiapk.com/bbs/download.php?keyid=f5d23685c772ca9eb4772a6a 86274a1705ef58019c851c39 72830c94b24c361d
Download the Android ARMv4 version root file

2. Add two device nodes, null and console, under /dev
mknod -m 660 null c 1 3
mknod -m 660 console c 5 1

3. In U-boot, modify the boot parameter init to /init. The complete command line is as follows:

a. Press and hold the space bar when starting up
b. Select [0] Set the boot parameters
c, [1] Set NFS boot parameter
d. Enter 192.168.1.3 (this is the IP address of your PC, mine is this), and press Enter
e. Enter 192.168.1.6 (this is the board IP, the default one), press Enter, enter 255.255.255.0
f, then select [3] Set parameter, this is very important, enter bootargs, press Enter, enter console=ttySAC0 root=/dev/nfs init=/init nfsroot=192.168.1.3:/root_nfs ip=192.168.1.6:192.168.1.3:192.168.1.6:255.255.255.0: www.arm9.org.ru:eth0:
off g, save and restart

Note: The kernel file that comes with TQ2440 seems to have problems with nfs startup. It is recommended to refer to step 5 to drive the network card; /root_nfs is your nfs directory, set it to your own
4. Modify the /init.rc file and remove all mount commands except mount tmpfs tmpfs /sqlite_stmt_journals size=4m
The system is complete, and you should be able to see a beautiful big table now. You need to create files for the first startup. TQ2440 starts relatively quickly, about 5 minutes. Then each startup only takes 1 minute.

Postscript: At this point, Android can be driven. Because the file system is too large, the file system has more than 70 megabytes, and 2440 has only 64m of space, so it can only use nfs. One day, I have time to streamline the file system, maybe it can be reduced to 64m, and I will write about it later!


Note: The above links for the touch screen, LCD, and network card drivers are based on 2.6.29, while the Android kernel is currently 2.6.25. For the 2.6.25 driver, please refer to the TQ2440 official document.
I. Current progress
1. Android can already run on the TQ2440 development board via NFS

2010.03.12 update: I recently compiled the Android file system myself and ran it on TQ. It has more bin programs than the Panda version, and the basic functions have been realized. You can download the file system from:
http://d.namipan.com/d/b64ce43b2388e5e1f66af181 49824b98cd13b926c4921f02
and try it out. I will organize it another day and send a detailed transplantation process and precautions.
2010.04.09 update:
Network settings:
route add default gw 192.168.1.1 dev eth0
setprop net.dns1 202.120.223.5
2010.05.08 update:
1. Use ADB
Ubuntu:
export ADBHOST=192.168.1.101
adb kill-server
adb start-server
adb shell
2. Battery causes shutdown during startup
Modification: frameworks/base/services/jni/com_android_server_BatteryService.cpp, see the attached patch. Add setprop battery.fake_ac 1
in the init.rc file

 
#include
#include

#include


#if HAVE_ANDROID_OS
#include
#endif
@@ -173,6 +176,29 @@

static void android_server_BatteryService_update(JNIEnv* env, jobject obj)
{
static int enable_fake_ac = -1;
if( enable_fake_ac == -1 ){
char value[PROPERTY_VALUE_MAX];
enable_fake_ac = 0;
if ( property_get("battery.fake_ac", value, 0 ) ){
if( 0 == strcmp( value, "true") || 0 == strcmp(value, "1") ){
enable_fake_ac = 1;
}
}
}
if( enable_fake_ac == 1 ){
env->SetBooleanField(obj, gFieldIds.mAcOnline, true);
env->SetBooleanField(obj, gFieldIds.mUsbOnline, false);
env->SetBooleanField(obj, gFieldIds.mBatteryPresent, true );
env->SetIntField(obj, gFieldIds .mBatteryStatus, gConstants.statusCharging);
env->SetIntField(obj, gFieldIds.mBatteryLevel, 50);
env->SetIntField(obj, gFieldIds.mBatteryVoltage, 4000);
env->SetIntField(obj, gFieldIds.mBatteryTemperature, 20) ;
env->SetIntField(obj, gFieldIds.mBatteryHealth, gConstants.healthGood);
env->SetObjectField(obj, gFieldIds.mBatteryTechnology, env->NewStringUTF("Fake"));
return;
}

setBooleanField(env, obj, AC_ONLINE_PATH, gFieldIds.mAcOnline);
setBooleanField(env, obj, USB_ONLINE_PATH, gFieldIds.mUsbOnline);
setBooleanField(env, obj, BATTERY_PRESENT_PATH, gFieldIds.mBatteryPresent);
 
#include
#include

#include


#if HAVE_ANDROID_OS
#include
#endif
@@ -173,6 +176,29 @@

static void android_server_BatteryService_update(JNIEnv* env, jobject obj)
{
static int enable_fake_ac = -1;
if( enable_fake_ac == -1 ){
char value[PROPERTY_VALUE_MAX];
enable_fake_ac = 0;
if ( property_get("battery.fake_ac", value, 0 ) ){
if( 0 == strcmp( value, "true") || 0 == strcmp(value, "1") ){
enable_fake_ac = 1;
}
}
}
if( enable_fake_ac == 1 ){
env->SetBooleanField(obj, gFieldIds.mAcOnline, true);
env->SetBooleanField(obj, gFieldIds.mUsbOnline, false);
env->SetBooleanField(obj, gFieldIds.mBatteryPresent, true );
env->SetIntField(obj, gFieldIds .mBatteryStatus, gConstants.statusCharging);
env->SetIntField(obj, gFieldIds.mBatteryLevel, 50);
env->SetIntField(obj, gFieldIds.mBatteryVoltage, 4000);
env->SetIntField(obj, gFieldIds.mBatteryTemperature, 20) ;
env->SetIntField(obj, gFieldIds.mBatteryHealth, gConstants.healthGood);
env->SetObjectField(obj, gFieldIds.mBatteryTechnology, env->NewStringUTF("Fake"));
return;
}

setBooleanField(env, obj, AC_ONLINE_PATH, gFieldIds.mAcOnline);
setBooleanField(env, obj, USB_ONLINE_PATH, gFieldIds.mUsbOnline);
setBooleanField(env, obj, BATTERY_PRESENT_PATH, gFieldIds.mBatteryPresent);

2. Current defects
1. The touch screen is not calibrated
2. The clock in Android stops, the zygote process is terminated, the system restarts, the clock is updated, but it stops again
3. Migration steps
1. Migrate the Android kernel to the TQ2440 development board
1. Download linux-2.6.25-android-1.0_r1.tar.gz from http://code.google.com/p/android/downloads/list
2. Unzip the kernel to the user directory, such as /root/kernel.git
3. Enter the kernel.git folder, such as cd ~/kernel.git/
4. Modify the nand flash partition settings in the arch/arm/plat-s3c24xx/common-smdk.c file, such as gedit arch/arm/plat-s3c24xx/common-smdk.c
Modify the static struct mtd_partition smdk_default_nand_part[] structure to:
 
static struct mtd_partition smdk_default_nand_part[] = {
[0] = {
.name = "TQ2440_uboot",
.size = 0x00040000,
.offset = 0x00000000,
},
[1] = {
.name = "TQ2440_kernel",
.offset = 0x0004C000,
. size = 0x00200000,
},
[2] = {
.name = "TQ2440_yaffs2",
.offset = 0x0024C000,
.size = 0x03DB0000,
}
};
5. Download IA32 GNU/Linux TAR from http://www.codesourcery.com/gnu_toolchains/arm/portal/release644
. 6. Unzip the files to the user directory, such as /usr/local/arm/arm-2008q3
7. Enter the arm-2008q3/bin folder, such as cd ~/arm-2008q3/bin/
8. Add the current path to the environment variable, such as export PATH=$PWD:$PATH, or modify the ~/.bashrc file and log in again
9. Enter the kernel folder, such as cd ~/kernel.git/
10. Modify the Makefile file, such as gedit Makefile
to change ARCH and CROSS_COMPILE
#ARCH               ?= $(SUBARCH)
ARCH               ?= arm
#CROSS_COMPILE        ?= arm-eabi-
CROSS_COMPILE        ?= arm-none-gnueabi-
11. Use make s3c2410_defconfig to configure the 2410 kernel by default
12. Run make menuconfig
(1) Make sure the content in System Type ---> ARM system type () is Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442,S3C2443
(2) Make sure System Type ---> S3C2410 Machines ---> 
SMDK2410/A9M2410 is checked
(3) Deselect the content related to Goldfish
Device Drivers ---> Character devices ---> < > Goldfish TTY Driver
Device Drivers ---> Power supply class support ---> < >   Goldfish battery driver (NEW)
Device Drivers ---> Real Time Clock ---> < >   GOLDFISH (NEW)
Device Drivers ---> Graphics support - --> Support for frame buffer devices ---> < >   Goldfish Framebuffer
(4) Select S3C2410 LCD related content
Device Drivers ---> Graphics support ---> Support for frame buffer devices ---> <*>   S3C2410 LCD framebuffer support
Device Drivers ---> Graphics support  ---> Bootup
logo ---> 
   Standard black and white Linux logo
Device Drivers ---> Graphics support ---> 
Bootup logo ---> 
   Standard 16-color Linux logo
Device Drivers ---> Graphics support ---> 
Bootup logo ---> 
   Standard 224-color Linux logo
(5) Select the required options for the Android kernel
Kernel Features ---> 
Use the ARM EABI to compile the kernel
General setup ---> 
Use full shmem filesystem
General setup ---> 
Enable Android's Shared Memory Subsystem
System Type ---> 
Support Thumb user binaries
Device Drivers ---> Android ---> 
Android log driver
Device Drivers ---> Android ---> <*> Binder IPC Driver
(6) Try to select Android kernel optional options
Device Drivers ---> Android ---> 
RAM buffer console
Device Drivers ---> Android ---> 
Android timed gpio driver
Device Drivers ---> Android ---> 
Only allow certain groups to create sockets
(7) For other CONFIG options, if the system supports them, please select them together:
CONFIG_ANDROID_POWER = y
CONFIG_ANDROID_POWER_STAT = y
CONFIG_ANDROID_POWER_ALARM = y
(You can search for ANDROID_POWER and other fields in the Kconfig file to select, or directly modify the .config file)
13. Exit and save .config
2. Transplant LCD driver to Linux-2.6.25 kernel (steps 2, 3, and 4 can refer to the manual, or refer to my other articles) For the
LCD transplantation of TQ2440, please refer to my other article: http://www.arm9.org.ru/viewthread.php?tid=3&extra=page=1
3. Transplant touch screen driver to Linux-2.6.25 kernel For the

        touch screen transplantation of TQ2440, please refer to my other article: http://www.arm9.org.ru/viewthread.php?tid=4&extra=page=1
Change line 256
        ts.dev->evbit[0] = BIT(EV_SYN) | BIT(EV_KEY) | BIT(EV_ABS);
        ts.dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT(BTN_TOUCH);
to:
ts.dev->evbit[0] = BIT_MASK(EV_SYN) | BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
ts.dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
4. Porting the network card driver to the Linux-2.6.25 kernel For

        the network card porting of TQ2440, please refer to my other article: http://www.arm9.org.ru/viewthread.php?tid=5&extra=page=1
5. Making an Android root file system that supports ARMv4
1. Download the root file system from http://d.namipan.com/d/403e5eb4ec3af5d8029d9948 79808140f0c9222be3858a02
or
http://www.hiapk.com/bbs/download.php?keyid=f5d23685c772ca9eb4772a6a 86274a1705ef58019c851c39 72830c94b24c361d
Download the root file of Android ARMv4 version

2. Add two device nodes, null and console, under /dev
mknod -m 660 null c 1 3
mknod -m 660 console c 5 1

3. Change the boot parameter init to /init in U-boot. The complete command line is as follows:

a. Press and hold the space bar when starting up
b. Select [0] Set the boot parameters
c, [1] Set NFS boot parameter
d. Enter 192.168.1.3 (this is the IP address of your PC, mine is this), press Enter
e. Enter 192.168.1.6 (this is the IP address of the board, the default is this), press Enter, enter 255.255.255.0
f, then select [3] Set parameter, this is very important, enter bootargs, press Enter, enter console=ttySAC0 root=/dev/nfs init=/init nfsroot=192.168.1.3:/root_nfs ip=192.168.1.6:192.168.1.3:192.168.1.6:255.255.255.0: www.arm9.org.ru:eth0:off
g, save and restart

Note: The kernel file that comes with TQ2440 seems to have problems with nfs startup. It is recommended to refer to the fifth step to drive the network card; /root_nfs This is your nfs directory, set it to your own
4. Modify the /init.rc file and remove all mount commands except mount tmpfs tmpfs /sqlite_stmt_journals size=4m
The system is complete, and you should now be able to see a beautiful large table. The first boot requires creating files. TQ2440 boots up relatively quickly, about 5 minutes. Each boot then takes only 1 minute.

Postscript: So far, Android can be driven. Since the file system is too large, the file system is more than 70 megabytes, and 2440 only has 64 megabytes of space, so it can only be driven by nfs. One day I will have time to streamline the file system to 64 megabytes, and I will write about it later!


Note: The above links for the touch screen, LCD, and network card drivers are all based on 2.6.29, while the Android kernel is currently 2.6.25. For the 2.6.25 driver, please refer to the TQ2440 official documentation.
Keywords:Android  TQ2440 Reference address:Android transplantation on TQ2440 development board

Previous article:s3c2440 android port
Next article:ARM's explanation of PINSEL

Recommended ReadingLatest update time:2024-11-17 01:38

Market research company SA believes that Huawei's Hongmeng system will squeeze the market share of Android system
Huawei will release its smartphone operating system (OS) Hongmeng next month. Market research firm Strategy Analytics (SA) predicts that Hongmeng's market share will exceed 5% within three years, squeezing the market share of Google's Android system. According to the Korean media "inews24", SA analyzed on the 11th tha
[Mobile phone portable]
Lenovo launches ThinkCentre M70a all-in-one PC: the PC closest to Android
According to news on October 9, Lenovo will manufacture an all-in-one computer equipped with Android system. Lenovo is currently working with Android operating system expert Esper to create the ThinkCentre M70a all-in-one computer. It is reported that ThinkCentre M70a is equipped with a 21.5-inch touch screen. The cur
[Home Electronics]
Google lists 9 Android 12 flagship phones: hardware performance levels meet the highest requirements
      Google introduced a "performance level" concept in Android 12, which allows developers to query the hardware information of the device and divide the device into different performance levels. For devices with lower performance levels, developers can choose to turn off some functions or reduce some animations so
[Mobile phone portable]
Google lists 9 Android 12 flagship phones: hardware performance levels meet the highest requirements
Qualcomm is developing a handheld similar to the Switch: equipped with Android 12 and detachable handle
       According to reports from Android Police and XDA, Qualcomm is developing an Android-based handheld game console similar in design to the Nintendo Switch. The device will use Qualcomm chips and, if it is finally launched, could be available next year .   Android Police said it has seen pictures of the device, wh
[Mobile phone portable]
U-boot1.1.6 ported to TQ2440 development board (Part 2)
      I have been porting u-boot these two days. It took me two days because I got stuck in nandflash. I will write about nandflash next time. This time I will record a problem I just encountered... Haha.       u-boot needs to pass environment variables and other configurations when booting linux       Set some macr
[Microcontroller]
Android 12 operating system updates are easier: you can update via the app store
       Google has launched Project Mainline to improve the way Android updates, and in Android 12, updating the operating system may be easier. XDA developer luca020400 noticed that Google is converting Android Runtime (also known as ART) into a Mainline module, making it possible to push updates to key system compone
[Mobile phone portable]
Microsoft Surface Duo 2 dual-screen phone is launched and the first Android firmware update is released
     According to MSPoweruser, Microsoft Surface Duo 2 was officially launched a few days ago, with a starting price of US$1,499 (approximately RMB 9,578.61), and Microsoft has prepared the first Android firmware update after its launch.   As expected, this update is designed to address any bugs not discovered befor
[Mobile phone portable]
TQ2440 uboot---8.tftp download kernel and start the kernel
TQ2440 + uboot1.1.6 1. uboot modified  1.1 common/main.c  In the function main_loop about line 513:     char cmd_buf ;     printf("Booting Linux ...\n");     //boot_zImage(0x200000,0x200000); //Comment boot_zImage             strcpy(cmd_buf, "tftp 0x30008000 zImage; boot_zImage"); //tftp kernel to memory 0x3
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号