全志一些具体工作

转自 http://blog.sina.com.cn/s/blog_12fa2144a0102vjio.html

dmesg

grep remotect1

===================================================全志新建一个自己的工程和编译============================================================

1.在自己Android目录中:

注意:执行完上述步骤之后,检查一下你工程目录中的package.sh文件,确定你要在lichee\tools\pack\chips\sun8iw3p1\configs\android中使用的名字。

2.在lichee\tools\pack\chips\sun8iw3p1\configs\android中复制一份相同的目录,修改成自己的名字(名字要与上述注意事项的名字相同)。

3.编译(以A23为例子)

1)在lichee下:./build.sh config-->s0.un8iw3p1-->0. Android-->选择你自己的项目名(如不是第一次编译,直接./build.sh)

2)在android中:执行source build/envsetup.sh -->lunch-->选择你自己的项目名-->extract-bsp,然后make

===============================================主要配置和修改============================================================

主要配置sys_config.fex:Y:\a20\lichee\tools\pack\chips\sun7i\configs\android\wing-evb-v20\sys_config.fex

本来A20开发板上自带CSI接口模组gt2005. 但需要将其替换成ov2643.

1.修改: android/device/softwinner/wing-evb-v20/init.sun7i.rc

使其在初始化时insmod ov2643 的driver.

#sam modify it for ov2643

#insmod /system/vendor/modules/gt2005.ko

insmod /system/vendor/modules/ov2643.ko

2. 修改

lichee\tools\pack\chips\sun7i\configs\android\wing-evb-v20\sys_config.fex

[csi0_para]

csi_used = 1

csi_dev_qty = 1

csi_stby_mode = 0

csi_mname = "ov2643"

csi_if = 0

csi_iovdd = ""

csi_avdd = ""

csi_dvdd = ""

csi_vol_iovdd =

csi_vol_dvdd =

csi_vol_avdd =

csi_vflip = 0

csi_hflip = 1

csi_flash_pol = 0

csi_facing = 0

csi_twi_id = 1

csi_twi_addr = 0x60

csi_pck = port:PE00<3>

csi_ck = port:PE01<3>

csi_hsync = port:PE02<3>

csi_vsync = port:PE03<3>

csi_d0 = port:PE04<3>

csi_d1 = port:PE05<3>

csi_d2 = port:PE06<3>

csi_d3 = port:PE07<3>

csi_d4 = port:PE08<3>

csi_d5 = port:PE09<3>

csi_d6 = port:PE10<3>

csi_d7 = port:PE11<3>

csi_reset =port:PH13<1><0>

csi_power_en =port:PH16<1><1>

csi_stby =port:PH18<1><0>

任务2:使MAC地址不重复:

修改:lichee\tools\pack\chips\sun7i\configs\android\default\env.cfg

任务3: 修改开机画面:

请注意:通常意义上的开机画面其实分以下三种:

1. Linux系统启动时的小企鹅。(Android早期版本和当前一些开发板还有用)

2. Android平台初始化时显示的rle图像。

3.Android平台图形系统启动时,显示的一个动画,如果没有特别设定,就是那个不断变化光线位置的ANDROID的动画。

我们着重学习2和3。

3.2: 添加和修改Android平台初始化时显示的rle图像:

/android/system/core/init/init.c

的main()函数中有:

queue_builtin_action(console_init_action,"console_init");

它向init 进程中添加了一个执行Action。名字为:"console_init"。 执行的是:console_init_action()

这里,就是显示开机画面的代码。

#define INIT_IMAGE_FILE "/initlogo.rle"

if( load_argb8888_image(INIT_IMAGE_FILE) ) {

fd = open("/dev/tty0", O_WRONLY);

if (fd >= 0) {

const char*msg;

msg = "\n"

"\n"

"\n"

"\n"

"\n"

"\n"

"\n" // console is 40 cols x 30 lines

"\n"

"\n"

"\n"

"\n"

"\n"

"\n"

"\n"

" A N D R OI D ";

write(fd,msg, strlen(msg));

close(fd);

}

这里,如果有/initlogo.rle,则利用framebuffer把图片显示在屏幕中。否则,打开串口,打印ANDROID.

如何将24bpp或者32bpp bmp图像转化成rle文件格式呢?

A20提供了一个软件:

\lichee\tools\tools_win\LogoGen\LogoGen\BmpConvert.exe

在Windows下,使用它将BMP图像转化为rle文件。

之后把它放到:/android/device/softwinner/wing-evb-v20/目录下。

请注意:此原始图像应与屏幕分辨率相同。当使用720P时,则应该使用1280x720的图片。

3.3:修改Android平台图形系统启动时的动画:

首先分析代码:

/android/frameworks/base/cmds/bootanimation/BootAnimation.cpp

#define USER_BOOTANIMATION_FILE"/data/local/bootanimation.zip"

#define SYSTEM_BOOTANIMATION_FILE"/system/media/bootanimation.zip"

#define SYSTEM_ENCRYPTED_BOOTANIMATION_FILE"/system/media/bootanimation-encrypted.zip"

if ((encryptedAnimation&&

(access(SYSTEM_ENCRYPTED_BOOTANIMATION_FILE,R_OK) == 0) &&

(mZip.open(SYSTEM_ENCRYPTED_BOOTANIMATION_FILE)== NO_ERROR))

((access(USER_BOOTANIMATION_FILE, R_OK) == 0)&&

(mZip.open(USER_BOOTANIMATION_FILE) ==NO_ERROR))

((access(SYSTEM_BOOTANIMATION_FILE, R_OK) == 0)&&

(mZip.open(SYSTEM_BOOTANIMATION_FILE) ==NO_ERROR))) {

mAndroidAnimation =false;

}

这一段明确说明了:如果/data/local/bootanimation.zip,/system/media/bootanimation.zip,/system/media/bootanimation-encrypted.zip这三个文件有任何一个存在且能够正常解压,则mAndroidAnimation=false.

另一处:

if (mAndroidAnimation) {

r = android();

} else{

r = movie();

}

结合上面的代码,说明如果没有以上三个文件,则执行android();

加载:/android/frameworks/base/core/res/assets/images/中的:android-logo-mask.png android-logo-shine.png

这两个文件,一个是镂空的ANDROID字体默认的前景图片,文字部分镂空,大小256×64,一个是斜闪光,是动感效果。

源码里默认是没有那些个.zip动画的,所以总会跳到android字体闪动的画面。

我们通常下载一个别人制作好的文件,放在:

\\android\out\target\product\wing-evb-v20\system\media下。

desc.txt文件很简单:

例1:

480 854 20

p 1 3 part0

p 0 3 part1

480854 20: 图像像素长宽为:480x854. 显示帧数:20帧。

p 13 part0:part0里面的图片(可以是多幅) 每个显示一次,间隔3。

p 03 part1:part1里面的图片显示无数次,间隔为3。

例2:

480 800 7

p 0 0 part0

480 800 7: 图像像素长宽为:480x800. 显示帧数:7帧。

p 0 0 part0:part0里面的图像显示无数次。间隔为0。

4. 预装APK:

预装APK的方式有两种不同方式,一种是作为系统软件安装,用户无法在卸载界面看到它(所以无法卸载)。另一种作为正常软件安装。

4.1:按照正常软件安装:

把APK放到:/android/device/softwinner/wing-common/preinstallapk

编译烧入后。启动后会静默安装。

4.2:按系统软件安装:

把APK放到:/android/device/softwinner/wing-common/apk

如果此APK有library.则需要把它放到:/android/device/softwinner/wing-common/apklib

最终,在Android Rootfs中,这个库会放到 /system/lib/中。

5. 指定缺省Launcher:

6. 配置wifi+bt

a) init.sun7i.rc:Android/device/softwinner/wing-evb-v20/init.sun7i.rc为资源和服务配置的文件

b) BoardConfig.mk:Android/device/softwinner/wing-evb-v20/BoardConfig.mk决定Android要加载哪一款wifi模组,以及是否支持蓝牙。

c) .config:将wifi driver编译成模块,CONFIG_RTL8723AU = m

d) Wing-evb-v20.mk:/android\device\softwinner\wing-evb-v20。决定拷贝文件rtl8723au wifi的firmware到相应的目录,要修改此目录。

e) Ueventd.sun7i.rc:android\device\softwinner\wing-evb-v20。增加设备的节点

f) Config.xml:android\device\softwinner\wing-evb-v20\overlay\frameworks\base\core\res\res\values.要打开蓝牙功能需要在文件中把蓝牙的bneq网口打开修改。

g) Vnd-wing-evb-v10.txt:android\device\softwinner\common\hardware\realtek\bluetooth\libbt-vendor\rtl8723au\include配置蓝牙:

h) bdroid_buildcfg.h:android\device\softwinner\wing-evb-v20\bluetooth。配置打开蓝牙时显示的本机的名字

i) sys_config.fex:lichee\tools\pack\chips\sun7i\configs\android\wing-evb-v20决定选用的wifi模组,以及GPIO pin 的分配

7.配置LCD屏

a) LCD_PWM_EN,LCD_BL_EN,LCD_PWR_EN 这三个函数是通过 GPIO 控制实现电源和背光的开启关闭,IO 的位置及属性定义在 sys_config.fex 文件中。

b) LCD基本配置在driver/video/sun7i/lcd/lcd0_panel_cfg.c中,可调节LCD背光,pwm等参数。

c)

d)

8.摄像头配置

a) Device Drivers --->Multimedia support ---> CSI Driver Config for sunxi ---> 或者Video capture adapters ---> 里面可以配置选上相应的摄像头。

9.启动频率和电压

a) Sys_config.fex文件中target中根据参考手册修改

10.增加蓝牙选项

1)android\frameworks\base\core\res\res\values\config.xml中加

2)Y:\a20-v3.0\a20\android\device\softwinner\wing-k70\wing_k70.mk中增加相应模块

3)Y:\a20-v3.0\a20\android\device\softwinner\wing-k70\init.sun7i.rc中增加相应模块

4)Y:\a20-v3.0\a20\android\device\softwinner\wing-k70\BoardConfig.mk中增加相应模块

11.修改字体以及整体大小

a) Y:\a20\android\out\target\product\wing-k70\recovery\root\default.prop

b) Y:\a20\android\out\target\product\wing-k70\system\build.prop中的fontScale

12.关于按键映射

1)mcu讲数据由串口传至arm,arm由串口程序接收,接收后,使用system函数映射按键system("input keyevent 82");后面的键值由Android映射的按键决定。

2)增加MUTE按键:由于Android本身有静音按键,但是在a20\android\frameworks\base\media\java\android\media\AudioManager.java中却没有映射出来,所以要自己添加程序:

public void handleKeyDown(KeyEvent event, int stream) {

int keyCode = event.getKeyCode();

boolean mute = isStreamMute(AudioManager.STREAM_MUSIC);

switch (keyCode) {

case KeyEvent.KEYCODE_VOLUME_UP:

case KeyEvent.KEYCODE_VOLUME_DOWN:

if (mute) {

setStreamMute(AudioManager.STREAM_MUSIC, false);

int volume = getStreamVolume(AudioManager.STREAM_MUSIC);

if (volume == 0) {

if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {

setStreamMute(AudioManager.STREAM_MUSIC, true);

break;

} else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {

setStreamMute(AudioManager.STREAM_SYSTEM, false);

setStreamMute(AudioManager.STREAM_NOTIFICATION, false);

}

} else {

setStreamMute(AudioManager.STREAM_SYSTEM, false);

setStreamMute(AudioManager.STREAM_NOTIFICATION, false);

adjustStreamVolume(AudioManager.STREAM_MUSIC,

AudioManager.ADJUST_SAME,

AudioManager.FLAG_SHOW_UI);

break;

}

}

int flags = FLAG_SHOW_UI

FLAG_VIBRATE;

if (mUseMasterVolume) {

adjustMasterVolume(

keyCode == KeyEvent.KEYCODE_VOLUME_UP

? ADJUST_RAISE

: ADJUST_LOWER,

flags);

} else {

adjustSuggestedStreamVolume(

keyCode == KeyEvent.KEYCODE_VOLUME_UP

? ADJUST_RAISE

: ADJUST_LOWER,

stream,

flags);

}

if (stream == AudioManager.STREAM_MUSIC) {

int v = getStreamVolume(AudioManager.STREAM_MUSIC);

mute = isStreamMute(AudioManager.STREAM_MUSIC);

if (!mute && (v == 0)) {

setStreamMute(AudioManager.STREAM_SYSTEM, true);

setStreamMute(AudioManager.STREAM_MUSIC, true);

setStreamMute(AudioManager.STREAM_NOTIFICATION, true);

adjustStreamVolume(stream,

AudioManager.ADJUST_SAME,

AudioManager.FLAG_SHOW_UI);

}

}

break;

case KeyEvent.KEYCODE_VOLUME_MUTE:

// TODO: Actually handle MUTE.

mute = !mute;

setStreamMute(AudioManager.STREAM_SYSTEM, mute);

setStreamMute(AudioManager.STREAM_MUSIC, mute);

setStreamMute(AudioManager.STREAM_NOTIFICATION, mute);

adjustStreamVolume(AudioManager.STREAM_MUSIC,

AudioManager.ADJUST_SAME,

AudioManager.FLAG_SHOW_UI);

break;

}

}

加入上述代码,可讲MUTE键映射成功。

13.关于UartTestApp服务(注意权限一定要最高)

1)使用,mmm把seria编译成UartTestApp可行性文件后,在目录out/target/product/wing-k70/system/bin下,在init.rc中加入service UartTestApp /system/bin/UartTestApp

class main

user root

group graphics

2)修改bin目录下的preinstall.sh文件,加上$BUSYBOX chmod 777 /system/bin/UartTestApp

3)如果1)中没有效果,接着在android\device\softwinner\wing-common\preinstall.sh中加上$BUSYBOX chmod 777 /system/bin/UartTestApp

4)然后make

14.gsensor方向

1)修改驱动文件

2)修改out/xxx/xxx/system/user/gsensor.cfg下的文件

15.圆圈与十字架不在同一点

以A23平台为例,是在android\frameworks\base\services\jni下的com_android_server_input_InputManagerService.cpp文件,outSpriteIcon->hotSpotX = pointerIcon.hotSpotX-10;

outSpriteIcon->hotSpotY = pointerIcon.hotSpotY-10;这个位置更改白色圆圈图片的坐标,数值又白点位置决定。

16.A23问题

Nw7723l:有8089和rda两种wifi,

8089:有1024x600和800x480两种分辨率,切换两种分辨时,主要修改:

1)sys_config.fex,看是什么lcd,如RGB和LVDS的

2)Out/xxx/xxx/system/bulid.prop中的ro.sf.lcd_density大小,1024为160,800为120,

3)Sensor方向:--》14

4)修改屏幕的方向。在build.prop文件中ro.sf.rotation=180(800x480)ro.sf.rotation=0(1024x600)

5)修改开机启动画面android\out\target\product\polaris-nw7723lesp\system\media,修改 6)

6) lichee\tools\pack\chips\sun8iw3p1\configs\android\polaris-nw7723lesp中的bootlogo.bmp,根据情况修改。

7)去掉又上角信号图标,找到\android\frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\policy\NetworkController.java

把其中关于stat_sys_signal_null的部分注释掉。

8)去掉解锁屏幕上关于SIM:字样。找到\android\frameworks\base\packages\Keyguard\src\com\android\keyguard\CarrierText.java把setText("SIM1:" + (text != null ? text.toString().toUpperCase() : null));注释掉。

16.关于亮度调节

亮度条减到一定值时屏幕变黑,此时修改亮度最小值:android\device\softwinner\fiber-common\hardware\libhardware\lights\lights.c

static int set_light_backlight(struct light_device_t *dev,

struct light_state_t const *state)

{

struct light_context_t *ctx;

int err = 0;

int brightness = rgb_to_brightness(state);

// add

if( brightness <= 80 )

brightness = 80;

//

pthread_mutex_lock(&g_lock);

unsigned long args[3];

args[0] = 0;

args[1] = brightness;

args[2] = 0;

err = ioctl(fd,DISP_CMD_LCD_SET_BRIGHTNESS,args);

pthread_mutex_unlock(&g_lock);

return err;

}

17.修改主页面添加程序的快捷方式:android\device\softwinner\astar-7723l\overlay\packages\apps\Launcher2\res\xml-sw720dp,或者在device/softewinner/overlay/Launcher中根据需要修改,可参照A23,default_ apace.xml里面的数据,跟A23对比即可。

18.删除右上角信号图标:找到X:\A23\nw7723l\esp8089\android\frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\SignalClusterView.java,找到stat_sys_signal_null,把这一部分代码注释即可。

19.A33移植注意问题

1)lcd_pwm_pol 由0改为1,不然调节亮度会有问题

2)vip_define_sensor_list = 0取消扫描,不然会找不到摄像头

3)[clock] pll configuration选项的pll10 = 297

4)[dram_para]中dram_clk = 480与A23 = 552不同,不降频使用系统会不稳定

5)声音太小在配置文件中找到audio。pa_double_used = 1,原来为0更改为1。添加headset_mic_vol = 3 main_mic_vol = 1

6)修改下拉菜单中的服务问题:修改framework下的GsmServiceStateTracker.java KeyguardTouchDelegate.java KeyguardUpdateMonitor.java NetworkController.java中的文件,修改的时候跟a23的对比修改。

7)找不到camera时,有可能是camera.cfg中的没有相关的信息(在out目录下)。Camera方向不对时,更改camera.cfg中相关的角度。

8)找不到gsensor时,可参照7)。同时,查看android\device\softwinner\polaris-common\hardware\libhardware\libsensors\sensorDetect.cpp下有没有对应sensor的信息,跟原来的可用的对比,在debug模式下查看gsensor信息:input5。修改完成后使用adb push xxx /system/usr下

9)修改虚拟按键位置:竖屏时虚拟按键不能完全显示:平板布局需修改文件。frameworks/base/packages/SystemUI/res/layout-sw600dp/navigation_bar.xml,

如果想注销某个按键,只需作如下修改即可:

- android:layout_width="128dp" android:paddingStart="25dp" android:paddingEnd="25dp"

+ android:layout_width="0dp" android:paddingStart="25dp" android:paddingEnd="25dp"

如果想要按键偏移,可以修改这个值android:layout_width="3300",

10)更换camera时,如0312+0328,首先确保I2C地址是正确的,如果两个I2C地址一样的话在sys_config.fex中有一个设置为不一样的(比如前置随便设置一个),否则只能检测一个,另一个会检测不到,在设置好地址后,挂载模块以后,看打印信息echo 8 > /proc/sys/kernel/printk,查看驱动的信息,如果找不到i2c地址使用test查看哪个i2c地址是正确的,在函数static int sensor_read(struct v4l2_subdev *sd, unsigned char reg, unsigned char *value)中加入

struct i2c_client *client = v4l2_get_subdevdata(sd);

client->addr = I2C_ADDR;

for(i = 0; i < 128 ;i ++)

{

client->addr = i;//I2C_ADDR;

printk("r:sa set is 0x%x\n",i);

ret = cci_read_a8_d8(sd,reg,value);

if(ret == 0)

printk(KERN_ERR "found 0x%x \n",i);

},根据情况而变。如果在sensor_detect中出错,打印查看value的值,更改它。

10)移植rda5991:

a) 调试蓝牙时,如出现mmc uartclk 过高,不在频率范围时,可更改X:\a33\android\external\bluetooth_rda\bt_cfg.h文件中的CUST_BT_SERIAL_BOURATE小一点的波特率

11)去掉蓝牙图标:删除frameworks/native/data/etc/android.hardware.bluetooth.xml文件以及system/etc/permissions/android.hardware.bluetooth.xml,同理增加蓝牙图标时放进去即可。

12)置换默认壁纸android\frameworks\base\core\res\res\drawable-sw600dp-nodpi

13)修改默认亮度:修改frameworks\base\packages\SettingsProvider\res\values\defaults.xml文件中的def_screen_brightness的值

14)A33 lvds RGB切换

a) 修改系统UI方向:RGB:在device\softwinner\astar-7723l\astar_7723l.mk中加入PRODUCT_PROPERTY_OVERRIDES += \ro.sf.rotation=180 ,在build.prop中加入ro.sf.rotation=180 LVDS: = 0

b) 修改bootlogo.bmp以及initlogo.rle:RGB:反向,LVDS:正向

c) 修改gsensor方向:在system/usr/gsensor.cfg中修改lcs RGB:false true LVDS:true false

20.去掉setting中某个选项:

a) 如果只是preference而不是checkboxpreference时,直接注释掉相应的preference即可

b) 如果是checkboxpreference:找到对应的Android:key找到对应的java代码,在相应代码后面加上getPreferenceScreen().removePreference(mBluetoothTether);

如下例子:去掉“手机套餐”以及“蓝牙共享网络”,xml路劲Setting/res/xml/wirless_setting.xml setting/res/tether_prefx.xml java路径:src/com/android/setting/tethersetting.java

Xml:lichee/brandy/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/de/lowlevel_sun8iw5/de_be.c

android:key="enable_bluetooth_tethering"

android:title="@string/bluetooth_tether_checkbox_text"

android:persistent="false" />

Java:

mBluetoothTether = (CheckBoxPreference) findPreference(ENABLE_BLUETOOTH_TETHERING);

getPreferenceScreen().removePreference(mBluetoothTether);

21.去掉窗口小部件中的蓝牙快捷方式:在窗口小部件的xml源码中:Settings/res/layout/widget.xml中,找到蓝牙的加入android:visibility="gone"使其隐藏

22.系统自带的浏览器下载东西时出错退出信息如下failed to find provider info for downloads Unknown URL content://downloads

,查看有没有DownloadProvider(下载)这个服务,如果没有,在priv-app中加入DownloadProvider.apk和在app中加入DownloadProviderUi.apk

23.修改logcat的等级lichee\tools\pack\chips\sun8iw5p1\configs\default\env.cfg中的loglevel,默认是4,数字越大,级别越高。

24.关于Android4.4对外置卡写入限制问题:Android4.4以后对外置卡写入进行了限制,如要写入,需要对frameworks\base\data\etc下的platform.xml或者system/etc/permissions/platform.xml文件中

加入这一行

25.切换成阿拉伯语是systemui出现错误:Keyguard discontent ,其实是虚拟按键没有找到,主要是在切换语言是,使用了不同语言的frameworks\base\packages\SystemUI\res\layout

layout-ldrtl优先级介绍,layout-ldrtl优先级要低于语言级别(layout-ar),因此如果存在layout-ar目录,会首先去查找layout-ar目录下的布局文件,因此建议删除layout-ar等bidi语言目录。layout-ldrtl优先级又高于分辨率等级,优先级归纳如下:

layout-ar(语言级别) > layout-ldrtl > layout-800*540(分辨率),如果layout-ldrtl中的navigation_bar.xml文件中没有相应虚拟按键的id(比如没有volume的按键),则对比另外几个layout,把没有的id添加上

E/AndroidRuntime( 1845): java.lang.NullPointerException

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.phone.NavigationBarView.setDisabledFlags(NavigationBarView.java:395)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.phone.NavigationBarView.notifyScreenOn(NavigationBarView.java:321)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.phone.PhoneStatusBar.notifyNavigationBarScreenOn(PhoneStatusBar.java:822)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.phone.PhoneStatusBar.access$3800(PhoneStatusBar.java:110)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.phone.PhoneStatusBar$30.onReceive(PhoneStatusBar.java:2485)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.phone.PhoneStatusBar.makeStatusBarView(PhoneStatusBar.java:639)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.phone.PhoneStatusBar.addStatusBarWindow(PhoneStatusBar.java:2270)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.phone.PhoneStatusBar.createAndAddWindows(PhoneStatusBar.java:2244)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.BaseStatusBar.start(BaseStatusBar.java:253)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.phone.PhoneStatusBar.start(PhoneStatusBar.java:349)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.SystemBars.createStatusBarFromConfig(SystemBars.java:106)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.SystemBars.onNoService(SystemBars.java:58)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.ServiceMonitor.startService(ServiceMonitor.java:228)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.ServiceMonitor.access$000(ServiceMonitor.java:49)

E/AndroidRuntime( 1845): at com.android.systemui.statusbar.ServiceMonitor$1.handleMessage(ServiceMonitor.java:73)

E/AndroidRuntime( 1845): at android.os.Handler.dispatchMessage(Handler.java:102)

E/AndroidRuntime( 1845): at android.os.Looper.loop(Looper.java:136)

E/AndroidRuntime( 1845): at android.app.ActivityThread.main(ActivityThread.java:5017)

E/AndroidRuntime( 1845): at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime( 1845): at java.lang.reflect.Method.invoke(Method.java:515)

E/AndroidRuntime( 1845): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)

E/AndroidRuntime( 1845): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)

E/AndroidRuntime( 1845): at dalvik.system.NativeStart.main(Native Method)

W/ActivityManager( 468): Process com.android.systemui has crashed too many times: killing!

26.修改开机第一屏时的背光亮度:lichee\brandyu-boot-2011.09\drivers\video_sunxi\sunxi_v1\de_bsp\de\ebios\de_be.c中的brightness = brightness>100?100:(brightness<0?0:brightness);以及ichee\brandyu-boot-2011.09\drivers\video_sunxi\sunxi_v2\de_bsp\de\lowlevel_sun8iw5\de_be.c同上。

27.当看视频时把屏幕倒回来看时,点击视频会抖动,修改android/device/softwinner/polaris-common/hardware/libhardware/hwcomposer中的hwc_sunxi.cpp文件中的static int _hwcdev_fe_can_use函数

double fe_clk = 234000000;

int fe_pro_w=0;

int fe_pro_h=0;

int m = 5;

int n = 4; 在后面添加return 0,

return 0;

。。。

28.在容易出现死机重启时,ddr不稳定,尝试修改dram_clk的频率,以及dcdc5_vol的电压,以及LVx_freq的频率

29.移植ap6476注意事项

1)调试wifi

a) 首先确认wifi脚位配置是否正确

b) 查看wifi使用的电压引脚,配置电压,在arch/arm/mach-sunxi/rf/wifi_pm_ap6xxx.c中添加wifi电压相关的信息

type = script_get_item(wifi_para, "ap6xxx_wl_regon", &val);

if (SCIRPT_ITEM_VALUE_TYPE_PIO!=type)

ap6xxx_msg("get ap6xxx ap6xxx_wl_regon gpio failed\n");

else

gpio_p = &val.gpio;

ap6xxx_wl_regon = gpio_p->gpio;

sunxi_ap6xxx_gpio_req(gpio_p);等等相关信息

c)在setting中,看wifi开关是否能打开,如打不开,是上层为配置好,查看X:\softwinner\A33\nw1034\android\device\softwinner\astar-nw1034\中相关mk文件有吗ap6476相关信息,查看framework,与移植包一一对应修改

d)如出现[ 10.706820] [mmc]: sdc1 power_supply is null

[ 10.711567] [mmc]: sdc1 card_power_on ok

[ 10.730037] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B

[ 10.740278] [mmc]: mclk 0xf1c2008c 0x8002000e

[ 10.822362] [mmc]: *** sunxi_mci_dump_errinfo(L773): smc 1 err, cmd 52, RTO !!

[ 10.831311] [mmc]: *** sunxi_mci_dump_errinfo(L773): smc 1 err, cmd 52, RTO !!

[ 10.839453] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B

[ 10.849710] [mmc]: mclk 0xf1c2008c 0x8002000e

[ 10.912002] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B

[ 10.922230] [mmc]: mclk 0xf1c2008c 0x8002000e

[ 10.983926] [mmc]: *** sunxi_mci_dump_errinfo(L773): smc 1 err, cmd 8, RTO !!

Mmc等错误,尝试降低sdio的速率并查看电压是否正常。

2)调试蓝牙

a) 首先确认蓝牙脚位配置是否正确

b) 在正确的情况下查看蓝牙电压是否正确,

出现D/BluetoothAdapterState( 919): CURRENT_STATE=PENDING, MESSAGE = STARTED, isTurningOn=true, isTurningOff=false

I/bluedroid( 919): enable

E/GKI_LINUX( 919): ##### ERROR : GKI_exception: GKI_exception(): Task State Table

E/GKI_LINUX( 919): #####

E/GKI_LINUX( 919): ##### ERROR : GKI_exception: TASK ID [0] task name [(null)] state [0]

E/GKI_LINUX( 919): #####

E/GKI_LINUX( 919): ##### ERROR : GKI_exception: TASK ID [1] task name [BTIF] state [1]

E/GKI_LINUX( 919): #####

E/GKI_LINUX( 919): ##### ERROR : GKI_exception: TASK ID [2] task name [A2DP-MEDIA] state [1]

E/GKI_LINUX( 919): #####

E/GKI_LINUX( 919): ##### ERROR : GKI_exception: GKI_exception 65531 Sending to unknown dest#####

E/GKI_LINUX( 919): ##### ERROR : GKI_exception:

E/GKI_LINUX( 919): ********************************************************************

E/GKI_LINUX( 919): #####

E/GKI_LINUX( 919): ##### ERROR : GKI_exception: * GKI_exception(): 65531 Sending to unknown dest

E/GKI_LINUX( 919): #####

E/GKI_LINUX( 919): ##### ERROR : GKI_exception: **********************************等错误,先查看蓝牙的wake脚位的电压是否正确,如不为高,

查看是否已经在arch/arm/mach-sunxi/rf/bt_pm.c中的rfkill_set_power函数增加wifi_pm_gpio_ctrl("ap6xxx_bt_wake", 1);把wake脚设置为高。

c) 如果出现[ 196.177323] +++++++++++ bt gpio on +++++++

d) [ 196.191878] gpio ap6xxx_bt_regon set io=360 val 1, act val 1

e) [ 196.210244] gpio ap6xxx_bt_wake set io=362 val 1, act val 1

f) [ 196.733337] sw_uart_check_baudset()443 - uart1, select set 5, baud 1000000, uartclk 24000000 beyond rance[31000000, 120000000]

g) [ 196.848732] sw_uart_check_baudset()443 - uart1, select set 5, baud 1000000, uartclk 24000000 beyond rance[31000000, 120000000]

h) [ 196.871298] sw_uart_check_baudset()443 - uart1, select set 5, baud 1000000, uartclk 24000000 beyond rance[31000000, 120000000]

修改串口的速率,根据uartclk 24000000查看lichee/linux-3.4/drivers/tty/serial/sunxi-uart.c中的范围,提高或者降低波特率。在android\hardware\broadcom\libbt\include\vnd_softwinner-ap6476.txt中修改

BLUETOOTH_UART_DEVICE_PORT = "/dev/ttyS2"

FW_PATCHFILE_LOCATION = "/system/vendor/modules/"

LPM_IDLE_TIMEOUT_MULTIPLE = 5

UART_TARGET_BAUD_RATE = 1500000

30.wifi,蓝牙等默认开关位置

android\frameworks\base\packages\SettingsProvider\res\values\defaults.xml

31.A23(5501)增加、删除wifi选项

1)注释或者添加

android:title="@string/header_category_wireless_networks" />

android:id="@+id/wifi_settings"

android:fragment="com.android.settings.wifi.WifiSettings"

android:title="@string/wifi_settings_title"

android:icon="@drawable/ic_settings_wireless" />

2)X:\softwinner\A23\nw5501\nw5501_sources_wifi_0805\android\packages\apps\Settings\src\com\android\settings\Settings.java

a)在 private int[] SETTINGS_FOR_RESTRICTED 中注释或者添加

//R.id.wireless_section,

//R.id.wifi_settings,

B)在private void updateHeaderList(Listtarget)中注释或者添加

else if (id == R.id.wifi_settings) {

// Remove WiFi Settings if WiFi service is not available.

if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_WIFI)) {

target.remove(i);

}

}

C)在static int getHeaderType(Header header) 中注释或者添加

else if (header.id == R.id.wifi_settings

header.id == R.id.bluetooth_settings) {

return HEADER_TYPE_SWITCH;

}

D)在 switch (headerType) {中注释或者添加

if (header.id == R.id.wifi_settings) {

mWifiEnabler.setSwitch(holder.switch_);

} else {

mBluetoothEnabler.setSwitch(holder.switch_);

}

3)有wifi的时候出现如下错误

D/audio_hw_primary( 114): out_standby

E/WifiHW ( 378): Supplicant not running, cannot connect

E/WifiHW ( 378): Supplicant not running, cannot connect

E/WifiHW ( 378): Supplicant not running, cannot connect

E/WifiHW ( 378): Supplicant not running, cannot connect

E/WifiHW ( 378): Supplicant not running, cannot connect

E/WifiStateMachine( 378): Failed to setup control channel, restart supplicant

D/WifiHW ( 108): Enter: wifi_get_fw_path function, fw_type=0,

E/WifiStateMachine( 378): Failed to reload STA firmware java.lang.IllegalStateException: command '129 softap fwreload wlan0 STA' failed with '400 129 Softap operation failed (No such device)'

W/CommandListener( 108): Failed to retrieve HW addr for wlan0 (No such device)

D/CommandListener( 108): Setting iface cfg

E/WifiStateMachine( 378): Unable to change interface settings: java.lang.IllegalStateException: command '131 interface setcfg wlan0 0.0.0.0 0 down' failed with '400 131 Failed to set address (No such device)'

E/wpa_supplicant( 3204): nl80211: Could not configure driver to use managed mode

E/wpa_supplicant( 3204): Could not read interface p2p0 flags: No such device

E/wpa_supplicant( 3204): p2p0: Failed to initialize driver interface

E/WifiHW ( 378): Unable to open connection to supplicant on "wlan0": No such file or directory

E/WifiHW ( 378): Supplicant not running, cannot connect

E/WifiHW ( 378): Supplicant not running, cannot connect

E/WifiHW ( 378): Supplicant not running, cannot connect

E/WifiHW ( 378): Supplicant not running, cannot connect

E/WifiHW ( 378): Supplicant not running, cannot connect

E/WifiStateMachine( 378): Failed to setup control channel, restart supplicant

主要是驱动没有找到,查看驱动是否挂载,没有挂载的时候在init.sun8i.rc中加入insmod esp8089.ko

Adb shell基础知识

32.在写一个apk时,Edittext可以指定输入字符

33.

1)在shell中,可以使用am start -n 包名/类名 来打开应用程序如am start -n com.android.settings/.Settings

2)使用svc wifi enable/disabled来打开或者关闭wifi

3)Shell截屏:

adb shell /system/bin/screencap -p /sdcard/screenshot.png

adb pull /sdcard/screenshot.png E:\

34.制作测试软件

在lichee下执行./build.sh config选择平台dragonboard,然后编译lichee,同时更改test_config.fex,加载相应的驱动。

35.去掉电池图标

找到该文件android\frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\policy\BatteryController.java

//add by lc 150210 1line

import android.view.View;

import com.android.systemui.R;

public class BatteryController extends BroadcastReceiver {

private static final String TAG = "StatusBar.BatteryController";

private Context mContext;

private ArrayListmIconViews = new ArrayList();

private ArrayListmLabelViews = new ArrayList();

private ArrayListmChangeCallbacks =

new ArrayList();

public interface BatteryStateChangeCallback {

public void onBatteryLevelChanged(int level, boolean pluggedIn);

}

public BatteryController(Context context) {

mContext = context;

IntentFilter filter = new IntentFilter();

//del 20150210 1line

// filter.addAction(Intent.ACTION_BATTERY_CHANGED);

context.registerReceiver(this, filter);

}

public void addIconView(ImageView v) {

//add lc 20150210 2line

v.setVisibility(View.GONE);

mIconViews.add(v);

}

public void addLabelView(TextView v) {

//add lc 20150210

v.setVisibility(View.GONE);

mLabelViews.add(v);

}

36.一个应用不需要横竖屏选择的时候加入以下:只横屏显示,在AndroidManifest.xml的< p="">

37.只替换内核的时,在shell中,进入system目录:dd if=/boot.img of=/dev/block/nandc

38.设置字体大小比例

因为我修改 ro.sf.lcd_density的值,将它从160修改 为120,所以导致整个系统的字体都变得很小。因此需要将整个字体变大,并且在设置-->显示-->字体大小的4个选项的值都必须变大。我想到的思路是将字体的缩放比例调大一些,下面是我的修改步骤。

1、修改默认字体的大小

Step1: 修改frameworks/base/core/java/android/content/res/Configuration.java

文件中的setToDefaults()方法,将默认的字体缩放比例调为1.35f,即修改fontScale属性

[java]

Public void setToDefaults(){

fontScale=1.35f; //default value is 1

mcc = mnc = 0;

....

}

2、修改设置-->显示-->字体大小的4个选项值

Step2: vim packages/apps/Settings/res/values/arrays.xml和

vim packages/apps/Settings/res/values-sw600dp/arrays.xml

下面就是4个选项对应的值,分别为 小、正常、大、超大

[html]

1.4

dabao1.45

1.5

1.55

Step3: 编译frameworks模块

[html]

mm frameworks/

Step4:

编译packages模块

[html]

mm packages/

39.更改图标大小android\packages\apps\Launcher2\res\values-sw600dp\dimens.xml,找到58dp

,数值越大,图标越大。图标太大时字体会显示不全

40.禁用下拉菜单KeyguardViewMediator.java

03:2禁用状态栏下拉

if (mStatusBarManager == null) {

mStatusBarManager = (StatusBarManager)

getSystemService(Context.STATUS_BAR_SERVICE);

}

禁用if (mStatusBarManager != null) {

mStatusBarManager.disable(StatusBarManager.DISABLE_EXPAND);

}

不禁用if (mStatusBarManager != null) {

mStatusBarManager.disable(StatusBarManager.DISABLE_NONE);

}

41.摄像头插值,在camera.cfg中找到分辨率,改成你要

42.apk反编译问题,jdk最好装1.7以上的,版本太低有些反编译有些apk的时候会出现错误,

Exception in thread "main" java.lang.UnsupportedClassVersionError: brut/apktool/Main : Unsupported major.minor version 51.0

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClassCond(Unknown Source)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$000(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

打包后用apktool反编译再打包都没问题,安装时出现Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]错误,网上查资料原来是签名的问题,解决方案如下。

《一》使用命令行生成签名文件

(1)创建一个用来存放签名文件的文件夹Android_keystore

(2)在命令行窗口中输入命令:(粗体部分)

[java] view plaincopy

1. D:\Android_keystore>keytool -genkey -alias aeo_android.keystore -keyalg RSA -validity 2000 -keystore aeo_abdroid.keystore

[java] view plaincopy

1. 输入密钥库口令:

2. 再次输入新口令:

3. 您的名字与姓氏是什么?

4. [Unknown]: localhost

5. 您的组织单位名称是什么?

6. [Unknown]: btbu

7. 您的组织名称是什么?

8. [Unknown]: btbu

9. 您所在的城市或区域名称是什么?

10. [Unknown]: beijing

11. 您所在的省/市/自治区名称是什么?

12. [Unknown]: beijing

13. 该单位的双字母国家/地区代码是什么?

14. [Unknown]: cn

15. CN=XiaoFeng, OU=btbu, O=btbu, L=beijing, ST=beijing, C=cn是否正确?

16. [否]: y

输入的密钥口令

(如果和密钥库口令相同, 按回车):

这时会在D盘的Android_keystore文件夹下生成aeo_android.keystore文件,就是我们需要的签名文件,(-validity 20000 表示证书的有效天数为20000天)

《二》用生成的签名文件对apk文件进行签名

(1)在Eclipse中用“Export the unsigned apk”工具导出项目,这里保存到D盘的Android_keystore文件夹下,名为testbim.apk

(2)使用jarsigner给 testbim.apk 文件签名,如下所示:

[java] view plaincopy

1. D:\Android_keystore>"C:\Program Files\Java\jdk1.7.0_67\bin\jarsigner.exe" -verbose -keystore aeo_android.keystore -signedjar Launcher2_signed.apk Launcher2.apk aeo_android.keystore

2. 输入密钥库的口令短语:

3. 正在添加: META-INF/MANIFEST.MF

4. 正在添加: META-INF/AEO_ANDR.SF

5. 正在添加: META-INF/AEO_ANDR.RSA

6. 正在签名: res/drawable-hdpi/ic_action_search.png

7. 正在签名: res/drawable-hdpi/ic_launcher.png

8. 正在签名: res/drawable-ldpi/ic_launcher.png

9. 正在签名: res/drawable-mdpi/ic_action_search.png

10. 正在签名: res/drawable-mdpi/ic_launcher.png

11. 正在签名: res/drawable-xhdpi/ic_action_search.png

12. 正在签名: res/drawable-xhdpi/ic_launcher.png

13. 正在签名: res/layout/activity_main.xml

14. 正在签名: res/layout/two.xml

15. 正在签名: res/menu/activity_main.xml

16. 正在签名: AndroidManifest.xml

17. 正在签名: classes.dex

18. 正在签名: resources.arsc

keytool 是个密钥和证书管理工具。jarsigner 工具利用密钥仓库中的信息来产生或校验 Java 存档 (JAR) 文件的数字签名 (JAR 文件将类文件、图象、声音和/或其它数字化数据打包在一个文件中)。

这两个工具都是JDK自带的,所以你当前需要先确保JDK安装正确。并且环境变量设置正确,以便可以以命令行的方式进行处理。

输入密匙的口令短语:

......

通过上面的命令就可以讲未签名的testbim.apk 文件签名为

[java] view plaincopy

1. testbim_signed.apk

(3)最后验证是否签名成功

Android_keystore>"C:\Program Files\Java\jdk1.6.0_30\bin\jarsigner.exe" -verify testbim_signed.apk

如果成功则

输出:

jar 已验证

43.使用adb与机器连接的时候出现错误

adb server is out of date. killing...

ADB server didn't ACK

* failed to start daemon *

是adb server端口被占用了

先执行adb nodaemon server ,查看adb server的端口是多少

C:\Users\xxxx>

cannot bind 'tcp:5037'

再执行下netstat -ano

findstr "5037"

C:\Users\xxxxxx>netstat -ano

findstr "5037"

TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 4236

TCP 127.0.0.1:5037 127.0.0.1:49422 ESTABLISHED 4236

TCP 127.0.0.1:49422 127.0.0.1:5037 ESTABLISHED 3840

然后执行tskill 4236即可

44.去掉长按图标时Info选项

1) android\packages\apps\Launcher2\src\com\android\launcher2\SearchDropTargetBar.java在这个文件中去点关于info的信息

Line 49: private ButtonDropTarget mInfoDropTarget;

Line 67: dragController.addDragListener(mInfoDropTarget);

Line 69: dragController.addDropTarget(mInfoDropTarget);

Line 72: mInfoDropTarget.setLauncher(launcher);

Line 101: mInfoDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.info_target_text);

Line 105: mInfoDropTarget.setSearchDropTargetBar(this);

2) android\packages\apps\Launcher2\res\layout\drop_target_bar.xml中删除以下

xmlns:android="http://schemas.android.com/apk/res/android"

style="@style/DropTargetButtonContainer"

android:layout_weight="1">

style="@style/DropTargetButton"

android:id="@+id/info_target_text"

android:text="@string/info_target_label"

android:drawableStart="@drawable/info_target_selector" />

备注:lichee/brandy/u-boot-2011.09/drivers/video_sunxi/sunxi_v2/de_bsp/de/lowlevel_sun8iw5/de_be.c

X:\softwinner\A33\7729\lichee\brandy\u-boot-2011.09\include\spare_head.h 52 #define SUNXI_UPDATE_NEXT_ACTION_CHARGE (6)

调通sina33下的AP6212A0(WIFI+BT) 大文实验室/大文哥 壹捌陆捌零陆捌捌陆捌贰 wb4916 AT qq.com 完成时间:2017/6/26 11:01 版本:V1.1 本文参照: 《A33 wifi移植说明书.pdf》 还有就是全志R16的parrotv1.1的官方SDK(Android4.4.2) 1、打开AP6212的BT,关闭rtl8723bs的BT: [ 3.141273] Bluetooth: HCI UART driver ver 2.2 [ 3.146210] Bluetooth: HCI H4 protocol initialized [ 3.151563] Bluetooth: HCI BCSP protocol initialized [ 3.157154] usbcore: registered new interface driver btusb [ 3.163282] Bluetooth: Generic Bluetooth SDIO driver ver 0.1 [ 3.169599] Bluetooth: BlueSleep Mode Driver Ver 1.1 [ 3.175402] Bluetooth: get rtl8723bs rtl8723bs_bt_host_wake gpio failed [ 3.953017] Bluetooth: RFCOMM TTY layer initialized [ 3.958456] Bluetooth: RFCOMM socket layer initialized [ 3.964183] Bluetooth: RFCOMM ver 1.11 [ 3.968340] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 3.968638] [mmc]: sdc2 set ios: clk 25000000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 3.968734] [mmc]: mclk 0xf1c20090 0xc100000b [ 3.989421] Bluetooth: BNEP filters: protocol multicast [ 3.995242] Bluetooth: HIDP (Human Interface Emulation) ver 1.2 [ 4.001921] L2TP core driver, V2.0 [ 4.005706] PPPoL2TP kernel driver, V2.0 [ 4.010070] L2TP IP encapsulation support (L2TPv3) [ 4.015468] L2TP netlink interface [ 4.019264] L2TP ethernet pseudowire support (L2TPv3) [ 4.023860] [mmc]: sdc2 set ios: clk 25000000Hz bm PP pm ON vdd 3.3V width 1 timing MMC-HS(SDR20) dt B [ 4.023929] [mmc]: mclk 0xf1c20090 0xc100000b [ 4.040272] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5 [ 4.048780] ThumbEE CPU extension supported. [ 4.053550] Registering SWP/SWPB emulation handler [ 4.059269] [rfkill]: rfkill set power 1 [ 4.063652] gpio ap6xxx_bt_regon set val 0, act val 0 正常启动的BT加载: [ 3.207764] Bluetooth: HCI UART driver ver 2.2 [ 3.212725] Bluetooth: HCI H4 protocol initialized [ 3.218045] Bluetooth: HCI BCSP protocol initialized [ 3.223671] usbcore: registered new interface driver btusb [ 3.229766] Bluetooth: Generic Bluetooth SDIO driver ver 0.1 [ 3.236243] Bluetooth: MSM Sleep Mode Driver Ver 1.2 rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r$ ll rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. dragonboard 2. linux Choice: 0 All available kernel: 0. linux-3.4 Choice: 0 All available boards: 0. evb 1. maple 2. redwood 3. y2 4. y3 Choice: 4 rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ cd linux-3.4/ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4$ make ARCH=arm menuconfig [*] Networking support ---> <*> Bluetooth subsystem support ---> Bluetooth device drivers ---> < > Broadcom Bluetooth Low Power Manager Support <*> Realtek Bluesleep driver support 修改为: <*> Broadcom Bluetooth Low Power Manager Support < > An inverter between bt hostwake pin and cpu (NEW) < > Realtek Bluesleep driver support 2、(这个不修改:) R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\overlay\frameworks\base\core\res\res\values\config.xml <!-- List of regexpressions describing the interface (if any) that represent tetherable Wifi interfaces. If the device doesn't want to support tethering over Wifi this should be empty. An example would be "softap.*" --> <string-array translatable="false" name="config_tether_wifi_regexs"> <item>"wlan0"</item> </string-array> <!-- List of regexpressions describing the interface (if any) that represent tetherable bluetooth interfaces. If the device doesn't want to support tethering over bluetooth this should be empty. --> <!-- default: disable Bluetooth PAN feature --> <string-array translatable="false" name="config_tether_bluetooth_regexs"> <item>"bt-pan"</item> </string-array> 3、 R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\astar_y3.mk # ap6181/6210/6330 sdio wifi fw and nvram #$(call inherit-product-if-exists, hardware/broadcom/wlan/firmware/ap6181/device-bcm.mk) #$(call inherit-product-if-exists, hardware/broadcom/wlan/firmware/ap6210/device-bcm.mk) $(call inherit-product-if-exists, hardware/broadcom/wlan/firmware/ap6212/device-bcm.mk) #$(call inherit-product-if-exists, hardware/broadcom/wlan/firmware/ap6330/device-bcm.mk) #rtl8723bs bt fw and config #$(call inherit-product, hardware/realtek/bluetooth/rtl8723bs/firmware/rtlbtfw_cfg.mk) # camera config for camera detector #PRODUCT_COPY_FILES += \ # device/softwinner/astar-y3/hawkview/sensor_list_cfg.ini:system/etc/hawkview/sensor_list_cfg.ini #add gms features #PRODUCT_COPY_FILES += \ # frameworks/native/data/etc/android.hardware.faketouch.xml:system/etc/permissions/android.hardware.faketouch.xml \ # frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ # frameworks/native/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml # 3G Data Card Packages #PRODUCT_PACKAGES += \ # u3gmonitor \ # chat \ # rild \ # pppd # 3G Data Card Configuration Flie #PRODUCT_COPY_FILES += \ # device/softwinner/polaris-common/rild/ip-down:system/etc/ppp/ip-down \ # device/softwinner/polaris-common/rild/ip-up:system/etc/ppp/ip-up \ # device/softwinner/polaris-common/rild/3g_dongle.cfg:system/etc/3g_dongle.cfg \ # device/softwinner/polaris-common/rild/usb_modeswitch:system/bin/usb_modeswitch \ # device/softwinner/polaris-common/rild/call-pppd:system/xbin/call-pppd \ # device/softwinner/polaris-common/rild/usb_modeswitch.sh:system/xbin/usb_modeswitch.sh \ # device/softwinner/polaris-common/rild/apns-conf_sdk.xml:system/etc/apns-conf.xml \ # device/softwinner/polaris-common/rild/libsoftwinner-ril.so:system/lib/libsoftwinner-ril.so #PRODUCT_COPY_FILES += \ # device/softwinner/polaris-common/rild/init.3gdongle.rc:root/init.sunxi.3gdongle.rc # 3G Data Card usb modeswitch File #PRODUCT_COPY_FILES += \ # $(call find-copy-subdir-files,*,device/softwinner/polaris-common/rild/usb_modeswitch.d,system/etc/usb_modeswitch.d) PRODUCT_PROPERTY_OVERRIDES += \ ro.sw.embeded.telephony = false PRODUCT_PROPERTY_OVERRIDES += \ persist.sys.timezone=Asia/Shanghai \ persist.sys.language=zh \ persist.sys.country=CN PRODUCT_PACKAGES += Bluetooth #PRODUCT_PROPERTY_OVERRIDES += \ # ro.product.8723b_bt.used=true #GPS Feature #PRODUCT_PACKAGES += gps.polaris #BOARD_USES_GPS_TYPE := simulator #PRODUCT_COPY_FILES += frameworks/native/data/etc/android.hardware.location.xml:system/etc/permissions/android.hardware.location.xml # evb logger PRODUCT_COPY_FILES += \ device/softwinner/astar-y3/tools/logger.sh:system/bin/logger.sh PRODUCT_PROPERTY_OVERRIDES += \ persist.sys.usb.config=mass_storage,adb \ ro.adb.secure=0 ro.udisk.lable=Polaris \ ro.font.scale=1.0 \ ro.hwa.force=false \ rw.logger=0 \ ro.sys.bootfast=true \ debug.hwc.showfps=0 \ debug.hwui.render_dirty_regions=false #ro.sys.storage_type = emulated \ #for gms #PRODUCT_PROPERTY_OVERRIDES += \ # ro.sys.mutedrm=true \ # ro.adb.secure=1 PRODUCT_PROPERTY_OVERRIDES += \ ro.sf.lcd_density=213 \ ro.product.firmware=v2.0 $(call inherit-product-if-exists, device/softwinner/astar-y3/modules/modules.mk) DEVICE_PACKAGE_OVERLAYS := device/softwinner/astar-y3/overlay PRODUCT_CHARACTERISTICS := tablet # Overrides PRODUCT_AAPT_CONFIG := xlarge hdpi xhdpi large PRODUCT_AAPT_PREF_CONFIG := xhdpi PRODUCT_BRAND := Allwinner PRODUCT_NAME := astar_y3 PRODUCT_DEVICE := astar-y3 PRODUCT_MODEL := QUAD-CORE A33 y3 PRODUCT_MANUFACTURER := softwinner #include device/softwinner/polaris-common/prebuild/google/products/gms_base.mk 4、 R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\BoardConfig.mk # wifi and bt configuration # 1. Wifi Configuration # 1.1 realtek wifi support # 1.1 realtek wifi configuration #BOARD_WIFI_VENDOR := realtek ifeq ($(BOARD_WIFI_VENDOR), realtek) WPA_SUPPLICANT_VERSION := VER_0_8_X BOARD_WPA_SUPPLICANT_DRIVER := NL80211 BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_rtl BOARD_HOSTAPD_DRIVER := NL80211 BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_rtl SW_BOARD_USR_WIFI := rtl8188eu BOARD_WLAN_DEVICE := rtl8188eu #SW_BOARD_USR_WIFI := rtl8723au #BOARD_WLAN_DEVICE := rtl8723au #SW_BOARD_USR_WIFI := rtl8723bs #BOARD_WLAN_DEVICE := rtl8723bs endif # 1.2 broadcom wifi support BOARD_WIFI_VENDOR := broadcom ifeq ($(BOARD_WIFI_VENDOR), broadcom) BOARD_WPA_SUPPLICANT_DRIVER := NL80211 WPA_SUPPLICANT_VERSION := VER_0_8_X BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd BOARD_HOSTAPD_DRIVER := NL80211 BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd BOARD_WLAN_DEVICE := bcmdhd WIFI_DRIVER_FW_PATH_PARAM := "/sys/module/bcmdhd/parameters/firmware_path" #SW_BOARD_USR_WIFI := AP6181 #SW_BOARD_USR_WIFI := AP6210 #WIFI_DRIVER_FW_PATH_STA := "/system/vendor/modules/fw_bcm40181a2.bin" #WIFI_DRIVER_FW_PATH_P2P := "/system/vendor/modules/fw_bcm40181a2_p2p.bin" #WIFI_DRIVER_FW_PATH_AP := "/system/vendor/modules/fw_bcm40181a2_apsta.bin" # 2017/6/21 15:11 wenyuanbo configure ap6212 use ap6210 SW_BOARD_USR_WIFI := AP6212 WIFI_DRIVER_FW_PATH_STA := "/system/vendor/modules/fw_bcm43438a0.bin" WIFI_DRIVER_FW_PATH_P2P := "/system/vendor/modules/fw_bcm43438a0_p2p.bin" WIFI_DRIVER_FW_PATH_AP := "/system/vendor/modules/fw_bcm43438a0_apsta.bin" #SW_BOARD_USR_WIFI := AP6330 #WIFI_DRIVER_FW_PATH_STA := "/system/vendor/modules/fw_bcm40183b2_ag.bin" #WIFI_DRIVER_FW_PATH_P2P := "/system/vendor/modules/fw_bcm40183b2_ag_p2p.bin" #WIFI_DRIVER_FW_PATH_AP := "/system/vendor/modules/fw_bcm40183b2_ag_apsta.bin" endif #1.3 eag wifi config #BOARD_WIFI_VENDOR := eagle ifeq ($(BOARD_WIFI_VENDOR), eagle) WPA_SUPPLICANT_VERSION := VER_0_8_X BOARD_WPA_SUPPLICANT_DRIVER := NL80211 BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_eagle BOARD_HOSTAPD_DRIVER := NL80211 BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_eagle SW_BOARD_USR_WIFI := esp8089 BOARD_WLAN_DEVICE := esp8089 endif # 2. Bluetooth Configuration # make sure BOARD_HAVE_BLUETOOTH is true for every bt vendor BOARD_HAVE_BLUETOOTH := true BOARD_HAVE_BLUETOOTH_BCM := true #SW_BOARD_HAVE_BLUETOOTH_NAME := ap6210 SW_BOARD_HAVE_BLUETOOTH_NAME := ap6212 #SW_BOARD_HAVE_BLUETOOTH_NAME := ap6330 #BOARD_HAVE_BLUETOOTH_RTK := true #BLUETOOTH_HCI_USE_RTK_H5 := true #SW_BOARD_HAVE_BLUETOOTH_NAME := rtl8723bs 5、 R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\init.sun8i.rc on early-fs mount_all /fstab.sun8i setprop ro.crypto.fuse_sdcard true insmod /system/vendor/modules/disp.ko insmod /system/vendor/modules/lcd.ko insmod /system/vendor/modules/mali.ko insmod /system/vendor/modules/leds-sunxi.ko insmod /system/vendor/modules/bcmdhd.ko insmod /system/vendor/modules/bcm_btlpm.ko #2G or 3G init.rc # import init.sunxi.3gdongle.rc ## 1. realtek & eagle wifi service ## 1.1 realtek & eagle wifi sta service #service wpa_supplicant /system/bin/wpa_supplicant \ # -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ # -O/data/misc/wifi/sockets \ # -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 # # we will start as root and wpa_supplicant will switch to user wifi # # after setting up the capabilities required for WEXT # # user wifi # # group wifi inet keystore # class main # socket wpa_wlan0 dgram 660 wifi wifi # disabled # oneshot # ## 1.2 realtek & eagle wifi sta p2p concurrent service #service p2p_supplicant /system/bin/wpa_supplicant \ # -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \ # -e/data/misc/wifi/entropy.bin -N \ # -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ # -O/data/misc/wifi/sockets \ # -g@android:wpa_wlan0 # class main # socket wpa_wlan0 dgram 660 wifi wifi # disabled # oneshot # 2. broadcom wifi service # 2.1 broadcom wifi station and softap service wpa_supplicant /system/bin/wpa_supplicant \ -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ -I/system/etc/wifi/wpa_supplicant_overlay.conf \ -O/data/misc/wifi/sockets \ -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 # we will start as root and wpa_supplicant will switch to user wifi # after setting up the capabilities required for WEXT # user wifi # group wifi inet keystore class main socket wpa_wlan0 dgram 660 wifi wifi disabled oneshot # 2.2 broadcom wifi sta p2p concurrent service service p2p_supplicant /system/bin/wpa_supplicant \ -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ -I/system/etc/wifi/wpa_supplicant_overlay.conf \ -O/data/misc/wifi/sockets -N \ -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \ -I/system/etc/wifi/p2p_supplicant_overlay.conf \ -puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin \ -g@android:wpa_wlan0 # we will start as root and wpa_supplicant will switch to user wifi # after setting up the capabilities required for WEXT # user wifi # group wifi inet keystore class main socket wpa_wlan0 dgram 660 wifi wifi disabled oneshot 6、(不需要修改) R:\wyb\ap6212a0_a33_sc3817r\android\device\softwinner\astar-y3\ueventd.sun8i.rc 7、 R:\wyb\ap6212a0_a33_sc3817r\android\frameworks\base\packages\SettingsProvider\res\values\defaults.xml <integer name="def_screen_off_timeout">1800000</integer> <bool name="def_lockscreen_disabled">true</bool> 8、 R:\wyb\ap6212a0_a33_sc3817r\android\frameworks\base\services\java\com\android\server\BatteryService.java // private static final boolean DEBUG = false; private static final boolean DEBUG = true; private void sendIntentLocked() { // Pack up the values and broadcast them to everyone final Intent intent = new Intent(Intent.ACTION_BATTERY_CHANGED); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_REPLACE_PENDING); int icon = getIconLocked(mBatteryProps.batteryLevel); intent.putExtra(BatteryManager.EXTRA_STATUS, mBatteryProps.batteryStatus); intent.putExtra(BatteryManager.EXTRA_HEALTH, mBatteryProps.batteryHealth); intent.putExtra(BatteryManager.EXTRA_PRESENT, mBatteryProps.batteryPresent); //intent.putExtra(BatteryManager.EXTRA_LEVEL, mBatteryProps.batteryLevel); intent.putExtra(BatteryManager.EXTRA_LEVEL, 100); intent.putExtra(BatteryManager.EXTRA_SCALE, BATTERY_SCALE); intent.putExtra(BatteryManager.EXTRA_ICON_SMALL, icon); intent.putExtra(BatteryManager.EXTRA_PLUGGED, mPlugType); //intent.putExtra(BatteryManager.EXTRA_VOLTAGE, mBatteryProps.batteryVoltage); intent.putExtra(BatteryManager.EXTRA_VOLTAGE, 4200); intent.putExtra(BatteryManager.EXTRA_TEMPERATURE, mBatteryProps.batteryTemperature); intent.putExtra(BatteryManager.EXTRA_TECHNOLOGY, mBatteryProps.batteryTechnology); intent.putExtra(BatteryManager.EXTRA_INVALID_CHARGER, mInvalidCharger); if (DEBUG) { Slog.d(TAG, "2016/12/05 10:41 wenyuanbo **** Sending ACTION_BATTERY_CHANGED. level:" + mBatteryProps.batteryLevel + ", scale:" + BATTERY_SCALE + ", status:" + mBatteryProps.batteryStatus + ", health:" + mBatteryProps.batteryHealth + ", present:" + mBatteryProps.batteryPresent + ", voltage: " + mBatteryProps.batteryVoltage + ", temperature: " + mBatteryProps.batteryTemperature + ", technology: " + mBatteryProps.batteryTechnology + ", AC powered:" + mBatteryProps.chargerAcOnline + ", USB powered:" + mBatteryProps.chargerUsbOnline + ", Wireless powered:" + mBatteryProps.chargerWirelessOnline + ", icon:" + icon + ", invalid charger:" + mInvalidCharger); } mHandler.post(new Runnable() { @Override public void run() { ActivityManagerNative.broadcastStickyIntent(intent, null, UserHandle.USER_ALL); } }); } 9、(直接拷贝同目录下的ap6210:) R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\libbt\conf\softwinner\ap6212\Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := bt_vendor.conf LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/bluetooth LOCAL_MODULE_TAGS := eng LOCAL_SRC_FILES := $(LOCAL_MODULE) include $(BUILD_PREBUILT) R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\libbt\conf\softwinner\ap6212\bt_vendor.conf # UART device port where Bluetooth controller is attached UartPort = /dev/ttyS1 # Firmware patch file location FwPatchFilePath = /system/vendor/modules/ # Firmware Name FwPatchFileName = bcm43438a0.hcd 10、新增:vnd_astar-y3-ap6212.txt,直接拷贝:vnd_astar-y2-ap6210.txt R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\libbt\include\vnd_astar-y3-ap6212.txt R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\libbt\include\vnd_astar-y2-ap6210.txt BLUETOOTH_UART_DEVICE_PORT = "/dev/ttyS1" FW_PATCHFILE_LOCATION = "/system/vendor/modules/" LPM_IDLE_TIMEOUT_MULTIPLE = 5 UART_TARGET_BAUD_RATE = 1500000 BT_WAKE_VIA_PROC = TRUE #LPM_SLEEP_MODE = FALSE BTVND_DBG = TRUE BTHW_DBG = TRUE VNDUSERIAL_DBG = TRUE UPIO_DBG = TRUE 11、 R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\libbt\src\userial_vendor.c //#ifdef USE_AP6210_BT_MODULE #if defined(USE_AP6210_BT_MODULE) || defined(USE_AP6212_BT_MODULE) /* PATCH for AP6210. Will detect CTS(module side) to select transport mode*/ ALOGE("userial vendor open: USE AP6210 BT MODULE."); usleep(100000); close(vnd_userial.fd); if ((vnd_userial.fd = open(vnd_userial.port_name, O_RDWR)) == -1) { ALOGE("userial vendor open: unable to open %s", vnd_userial.port_name); return -1; } #endif //USE_AP6210_BT_MODULE 12、 R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\libbt\Android.mk ifeq ($(SW_BOARD_HAVE_BLUETOOTH_NAME), ap6210) LOCAL_CFLAGS += -DUSE_AP6210_BT_MODULE endif ifeq ($(SW_BOARD_HAVE_BLUETOOTH_NAME), ap6212) LOCAL_CFLAGS += -DUSE_AP6212_BT_MODULE endif ifeq ($(SW_BOARD_HAVE_BLUETOOTH_NAME), ap6330) include $(LOCAL_PATH)/conf/softwinner/ap6330/Android.mk endif ifeq ($(SW_BOARD_HAVE_BLUETOOTH_NAME), ap6210) include $(LOCAL_PATH)/conf/softwinner/ap6210/Android.mk endif ifeq ($(SW_BOARD_HAVE_BLUETOOTH_NAME), ap6212) include $(LOCAL_PATH)/conf/softwinner/ap6212/Android.mk endif 13、 R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\libbt\vnd_buildcfg.mk ifeq ($(SW_BOARD_HAVE_BLUETOOTH_NAME), ap6210) SRC := $(call my-dir)/include/$(addprefix vnd_, $(addsuffix -ap6210.txt,$(basename $(TARGET_DEVICE)))) endif ifeq ($(SW_BOARD_HAVE_BLUETOOTH_NAME), ap6212) SRC := $(call my-dir)/include/$(addprefix vnd_, $(addsuffix -ap6212.txt,$(basename $(TARGET_DEVICE)))) endif 14、(这些AP6212的WIFI的bin文件和BT的hcd文件来自全志R16的SDK,当然也可以找正基原厂/代理商索取:) R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\wlan\firmware\ap6212\bcm43438a0.hcd (根据ap6210修改:) R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\wlan\firmware\ap6212\device-bcm.mk # # Copyright (C) 2008 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ######################## -include hardware/broadcom/wlan/bcmdhd/config/config-bcm.mk PRODUCT_COPY_FILES += \ hardware/broadcom/wlan/firmware/ap6212/fw_bcm43438a0.bin:system/vendor/modules/fw_bcm43438a0.bin \ hardware/broadcom/wlan/firmware/ap6212/fw_bcm43438a0_apsta.bin:system/vendor/modules/fw_bcm43438a0_apsta.bin \ hardware/broadcom/wlan/firmware/ap6212/fw_bcm43438a0_p2p.bin:system/vendor/modules/fw_bcm43438a0_p2p.bin \ hardware/broadcom/wlan/firmware/ap6212/nvram_ap6210.txt:system/vendor/modules/nvram_ap6210.txt \ hardware/broadcom/wlan/firmware/ap6212/bcm43438a0.hcd:system/vendor/modules/bcm43438a0.hcd #hardware/broadcom/wlan/firmware/ap6212/config.txt:system/vendor/modules/config.txt ######################## R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\wlan\firmware\ap6212\fw_bcm43438a0.bin R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\wlan\firmware\ap6212\fw_bcm43438a0_apsta.bin R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\wlan\firmware\ap6212\fw_bcm43438a0_p2p.bin R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\wlan\firmware\ap6212\nvram_ap6212.txt 直接拷贝自nvram_ap6212.txt: R:\wyb\ap6212a0_a33_sc3817r\android\hardware\broadcom\wlan\firmware\ap6212\nvram_ap6210.txt 15、(可选修改:) R:\wyb\ap6212a0_a33_sc3817r\android\packages\apps\Camera2\src\com\android\camera\CameraActivity.java private BroadcastReceiver mBatteryInfoReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (Intent.ACTION_BATTERY_CHANGED.equals(action)) { int Level = intent.getIntExtra("level", 0); int Scale = intent.getIntExtra("scale", 100); Log.w(TAG, "2016/11/29 19:54 &&&& wenyuanbo battery Level" + Level); /* *Logic: *1.the battery level is lower then 5%. *2.if in camera, make sure that not in the snapshot progress. *3.if in videocamera, make sure that not in the videorecording progress. *4.everytime starting the camera activity, the battery level is broadcasted, * if meeting the conditions above, give a dialog, press it and finish the activity. *5.if the conditions are not satisfied when started, play for a moment, in the camera acitvity * or video camera activity, the conditiosn are satisfied, also give a dialog for finishing the activity. * *by fuqiang. */ if(Level < 5) { Runnable runnable_close_camera = new Runnable() { @Override public void run() { //close the camera. // CameraActivity.this.finish(); } }; Log.w(TAG, "2016/11/29 18:20 **** wenyuanbo battery Level" + Level); showLocationDialog(); } /* *Logic: *1.the battery level is lhigher then 5% and lower than 15%. *2.if in camera, make sure that not in the snapshot progress. *3.if in videocamera, make sure that not in the videorecording progress. *4.whether in camera or in videocamera, make sure that the flash mode is supported. *5.everytime starting the camera activity, the battery level is broadcasted, * if meeting the conditions above, forbidden the flash(gray icon), give a dialog to notise user. *6.if the conditions are not satisfied when started, play for a moment, in the camera acitvity * or video camera activity, the conditiosn are satisfied, forbidden the flash and give a notice dialog. *7.the dialog is only given once for each camera activity starting. * *by fuqiang. */ else if(Level < 16) { //close the flash mode. /* if (mIsLowBatteryDialogShown == false) { mRotateDialog.showAlertDialog( getString(R.string.warning), getString(R.string.low_battery_15), null, null, getString(R.string.close), null); mIsLowBatteryDialogShown = true; } */ } } } }; 16、(可选:) R:\wyb\ap6212a0_a33_sc3817r\lichee\tools\pack\chips\sun8iw5p1\configs\default\env.cfg bootdelay=3 loglevel=8 17、 R:\wyb\ap6212a0_a33_sc3817r\lichee\tools\pack\chips\sun8iw5p1\configs\y3\sys_config.fex [power_sply] dcdc1_vol = 3000 dcdc2_vol = 1100 dcdc3_vol = 1200 dcdc4_vol = 0 dcdc5_vol = 1500 aldo1_vol = 3300 aldo2_vol = 2500 aldo3_vol = 3000 dldo1_vol = 3300 dldo2_vol = 3300 dldo3_vol = 2800 ;gpio0_vol = 2800 ldoio0_vol = 2800 ;---------------------------------------------------------------------------------- ;uart configuration ;uart_used = uart x enable ;uart_type = 2:2 wire,4:4 wire,8:8 wire, full function ;---------------------------------------------------------------------------------- [uart0] uart_used = 1 uart_port = 0 uart_type = 2 uart_tx = port:PF02<3><1><default><default> uart_rx = port:PF04<3><1><default><default> [uart1] uart_used = 1 uart_port = 1 uart_type = 4 uart_tx = port:PG06<2><1><default><default> uart_rx = port:PG07<2><1><default><default> uart_rts = port:PG08<2><1><default><default> uart_cts = port:PG09<2><1><default><default> [uart2] uart_used = 1 uart_type = 4 uart_tx = port:PB00<2><1><default><default> uart_rx = port:PB01<2><1><default><default> uart_rts = port:PB02<2><1><default><default> uart_cts = port:PB03<2><1><default><default> [uart3] uart_used = 0 uart_type = 4 uart_tx = port:PH06<3><1><default><default> uart_rx = port:PH07<3><1><default><default> uart_rts = port:PH08<3><1><default><default> uart_cts = port:PH09<3><1><default><default> [uart4] uart_used = 0 uart_port = 4 uart_type = 2 uart_tx = port:PA04<2><1><default><default> uart_rx = port:PA05<2><1><default><default> uart_rts = port:PA06<2><1><default><default> uart_cts = port:PA07<2><1><default><default> ;---------------------------------------------------------------------------------- ;capacitor tp configuration ;ctp_twi_id : twi controller ID ;ctp_twi_addr : I2C slave address, 7bit ;ctp_screen_max_x/_y : resolution of touch panel ;ctp_revert_x/_y_flag : whether need to revert x/y ;ctp_exchange_x_y_flag: whether need to exchange the value of x and y ;ctp_int_port : port for tp's interrupt signal ;ctp_wakeup : port for wakeup tp ;---------------------------------------------------------------------------------- [ctp_para] ctp_used = 1 ctp_name = "gt82x" ctp_twi_id = 0 ctp_twi_addr = 0x5d ctp_screen_max_x = 1280 ctp_screen_max_y = 800 ctp_revert_x_flag = 1 ctp_revert_y_flag = 1 ctp_exchange_x_y_flag = 1 ctp_int_port = port:PL04<4><default><default><default> ctp_wakeup = port:PL03<1><default><default><1> ctp_power_ldo = ctp_power_ldo_vol = ctp_power_io = ;-------------------------------------------------------------------------------- ; CTP automatic detection configuration ;ctp_detect_used --- Whether startup automatic inspection function. 1:used,0:unused ;Module name postposition 1 said detection, 0 means no detection. ;-------------------------------------------------------------------------------- [ctp_list_para] ctp_det_used = 1 ft5x_ts = 1 gt82x = 1 gslX680 = 1 gslX680new = 0 gt9xx_ts = 1 gt9xxf_ts = 0 tu_ts = 0 gt818_ts = 1 zet622x = 1 aw5306_ts = 1 icn83xx_ts = 0 [lcd0_para] lcd_used = 1 lcd_driver_name = "default_lcd" lcd_if = 3 lcd_x = 1280 lcd_y = 800 lcd_width = 150 lcd_height = 94 lcd_dclk_freq = 71 lcd_pwm_used = 1 lcd_pwm_ch = 0 lcd_pwm_freq = 50000 lcd_pwm_pol = 1 lcd_hbp = 20 lcd_ht = 1418 lcd_hspw = 10 lcd_vbp = 10 lcd_vt = 830 lcd_vspw = 5 lcd_lvds_if = 0 lcd_lvds_colordepth = 1 lcd_lvds_mode = 0 lcd_frm = 1 lcd_gamma_en = 0 lcd_bright_curve_en = 0 lcd_cmap_en = 0 deu_mode = 0 lcdgamma4iep = 22 smart_color = 90 lcd_bl_en = port:PD13<1><0><default><1> ;ap6xxx_wl_regon = port:PL06<1><default><default><0> ;lcd_bl_en = port:PL06<1><0><default><1> lcd_power = "axp22_dc1sw" lcdd0 = port:PD18<3><0><default><default> lcdd1 = port:PD19<3><0><default><default> lcdd2 = port:PD20<3><0><default><default> lcdd3 = port:PD21<3><0><default><default> lcdd4 = port:PD22<3><0><default><default> lcdd5 = port:PD23<3><0><default><default> lcdd6 = port:PD24<3><0><default><default> lcdd7 = port:PD25<3><0><default><default> lcdd8 = port:PD26<3><0><default><default> lcdd9 = port:PD27<3><0><default><default> ;---------------------------------------------------------------------------------- ;pwm config ;---------------------------------------------------------------------------------- [pwm0_para] pwm_used = 0 pwm_positive = port:PH00<2><0><default><default> [pwm1_para] pwm_used = 1 pwm_positive = port:PH01<2><0><default><default> ;-------------------------------------------------------------------------------- ;wifi configuration ;wifi_sdc_id: 0- SDC0, 1- SDC1, 2- SDC2, 3- SDC3 ;wifi_usbc_id: 0- USB0, 1- USB1, 2- USB2 ;wifi_usbc_type: 1- EHCI(speed 2.0), 2- OHCI(speed 1.0) ;wifi_mod_sel: 0- none, 1- ap6181, 2- ap6210(wifi+bt), ; 3 - rtl8188eu, 4- rtl8723au(wifi+bt), ; 5 - rtl8723bs, 6- esp8089 ;-------------------------------------------------------------------------------- [wifi_para] wifi_used = 1 wifi_sdc_id = 1 wifi_usbc_id = 1 wifi_usbc_type = 1 wifi_mod_sel = 2 wifi_power = "axp22_dldo1" wifi_power_ext1 = "axp22_dldo2" wifi_power_ext2 = "axp22_aldo1" wifi_power_switch = ;wifi_power_switch = port:power0<1><0><default><0> ; 1 - ap6181 sdio wifi gpio config ;ap6xxx_wl_regon = port:PL06<1><default><default><0> ;ap6xxx_wl_host_wake = port:PL07<4><default><default><0> ;ap6xxx_lpo_use_apclk = 1 ; 2 - ap6210 sdio wifi gpio config ap6xxx_wl_regon = port:PL06<1><default><default><0> ;ap6xxx_wl_regon = port:PD13<1><default><default><0> ap6xxx_wl_host_wake = port:PL07<4><default><default><0> ap6xxx_bt_regon = port:PL08<1><default><default><0> ap6xxx_bt_wake = port:PL10<1><default><default><0> ap6xxx_bt_host_wake = port:PL09<4><default><default><0> ap6xxx_lpo_use_apclk = 1 ; 3 - rtl8188eu usb wifi gpio conifg ; 4 - rtl8723au usb wifi + bt ; 5 - rtl8723bs sdio wifi + bt ;rtl8723bs_chip_en = port:PL11<1><default><default><0> ;rtl8723bs_wl_regon = port:PL06<1><default><default><0> ;rtl8723bs_wl_host_wake = port:PL07<4><default><default><0> ;rtl8723bs_bt_regon = port:PL08<1><default><default><0> ;rtl8723bs_bt_wake = port:PL10<1><default><default><0> ;rtl8723bs_bt_host_wake = port:PL09<4><default><default><0> ;rtl8723bs_lpo_use_apclk = 0 ; 6 - eagle sdio wifi ;esp_wl_chip_en = port:PL03<1><default><default><0> ;esp_wl_rst = port:PL02<1><default><default><0> ;-------------------------------------------------------------------------------- ;blue tooth ;bt_used ---- blue tooth used (0- no used, 1- used) ;bt_uard_id ---- uart index ;-------------------------------------------------------------------------------- [bt_para] bt_used = 1 bt_uart_id = 1 power_start = 3 pmu_temp_enable = 0 18、 刷机之后,BT可以用。 传输4.5MB的JPG图片大概需要2分钟。 WIFI: 在设置→WLAN(打开之后): shell@astar-y3:/ $ shell@astar-y3:/ $ [ 469.609956] init: computing context for service '/system/bin/wpa_supplicant' [ 469.618386] init: starting 'p2p_supplicant' [ 469.625739] init: Created socket '/dev/socket/wpa_wlan0' with mode '660', user '1010', group '1010' [ 469.673379] init: waitpid returned pid 2065, status = 0000ff00 [ 469.679923] init: process 'p2p_supplicant', pid 2065 exited [ 476.197334] sndpcm_unmute,line:1099 [ 451.464755] CPU1: Booted secondary processor [ 478.459403] CPU1: shutdown [ 478.462947] [hotplug]: cpu(0) try to kill cpu(1) [ 478.468478] [hotplug]: cpu1 is killed! . shell@astar-y3:/ $ 分析启动的log: [ 17.526849] gpio ap6xxx_wl_regon set val 1, act val 1 [ 17.632508] [ap6xxx]: sdio wifi power state: on [ 17.637576] [mmc]: sdc1 set ios: clk 0Hz bm PP pm UP vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 17.637751] =========== WLAN placed in POWER ON ======== [ 17.654651] [mmc]: sdc1 card_power_on start... [ 17.659576] [mmc]: sdc1 power_supply is null [ 17.664322] [mmc]: sdc1 card_power_on ok [ 17.680039] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 17.690275] [mmc]: mclk 0xf1c2008c 0x8002000e [ 17.772361] [mmc]: *** sunxi_mci_dump_errinfo(L773): smc 1 err, cmd 52, RTO !! [ 17.781309] [mmc]: *** sunxi_mci_dump_errinfo(L773): smc 1 err, cmd 52, RTO !! [ 17.789448] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 17.799714] [mmc]: mclk 0xf1c2008c 0x8002000e [ 17.862032] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 17.872262] [mmc]: mclk 0xf1c2008c 0x8002000e [ 17.933953] [mmc]: *** sunxi_mci_dump_errinfo(L773): smc 1 err, cmd 8, RTO !! [ 17.941997] *******************Try sdio******************* [ 17.948400] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 17.958630] [mmc]: mclk 0xf1c2008c 0x8002000e [ 18.027775] mmc1: queuing unknown CIS tuple 0x80 (2 bytes) [ 18.035416] mmc1: queuing unknown CIS tuple 0x80 (3 bytes) [ 18.043087] mmc1: queuing unknown CIS tuple 0x80 (3 bytes) [ 18.051920] mmc1: queuing unknown CIS tuple 0x80 (7 bytes) [ 18.145287] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B [ 18.155436] [mmc]: mclk 0xf1c2008c 0x8002000e [ 18.215346] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B [ 18.225736] [mmc]: mclk 0xf1c2008c 0x8100000b [ 18.285675] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 18.296021] [mmc]: mclk 0xf1c2008c 0x8140030b [ 18.357915] mmc1: new high speed SDIO card at address 0001 [ 18.364532] bcmsdh_register: Linux Kernel SDIO/MMC Driver [ 18.364575] *******************sdio init ok******************* [ 18.377207] bcm_wlan_get_oob_irq enter. [ 18.381537] gpio [359] map to virq [7] ok [ 18.388851] F1 signature OK, socitype:0x1 chip:0xa9a6 rev:0x0 pkg:0x4 [ 18.396019] dhdsdio_probe_attach: unsupported chip: 0xa9a6 [ 18.402155] dhdsdio_probe: dhdsdio_probe_attach failed [ 18.407899] bcmsdh_probe: device attach failed [ 18.412981] [ 18.412984] Dongle Host Driver, version 1.88.45.3 (r420671) [ 18.412989] Compiled in drivers/net/wireless/bcmdhd on Jun 26 2017 at 12:06:39 [ 18.428835] dhd_module_init: sdio_register_driver timeout or error [ 18.435928] gpio ap6xxx_wl_regon set val 0, act val 0 [ 18.541549] [ap6xxx]: sdio wifi power state: off [ 18.546679] =========== WLAN placed in POWER OFF ======== [ 18.546915] mmc1: card 0001 removed [ 18.546995] [mmc]: mmc not poweroff notifiy [ 18.547007] [mmc]: sdc1 set ios: clk 0Hz bm OD pm OFF vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 18.547160] [mmc]: sdc1 card_power_off start... [ 18.547166] [mmc]: sdc1 power_supply is null [ 18.547173] [mmc]: sdc1 card_power_off ok [ 18.631655] init: command 'insmod' r=-1 [ 18.636066] init: command 'insmod' r=-1 [ 18.658010] fs_mgr: swapon failed for /dev/block/zram0 [ 18.663804] init: command 'swapon_all' r=-1 [ 18.668504] init: processing action 0x58e70 (console_init) [ 18.675396] init: width = 1280 [ 18.678788] init: height = 800 [ 18.682224] init: s.st_size = 3145728 [ 18.686308] init: logo match failed!fbsize = 4096000 [ 18.718811] init: command 'console_init' r=0 [ 18.723628] init: processing action 0x55bf0 (fs) [ 18.730640] init: command 'mkdir' r=-2 [ 18.741901] init: command 'insmod' r=0 [ 18.752227] init: command 'insmod' r=0 [ 18.756491] init: command 'insmod' r=-1 [ 18.771211] init: command 'insmod' r=0 [ 18.779731] init: command 'insmod' r=0 [ 18.791739] init: command 'insmod' r=0 [ 18.803941] init: command 'insmod' r=0 [ 18.816178] init: command 'insmod' r=0 19、查找:(dhdsdio_probe_attach: unsupported chip: 0xa9a6) rootroot@rootroot-E400:~$ cd wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd/ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ grep "unsupported chip" . -R ./dhd_sdio.c: DHD_ERROR(("%s: unsupported chip: 0xx\n", ./sbutils.c: SI_ERROR(("sb_chip2numcores: unsupported chip 0x%x\n", 匹配到二进制文件 ./dhd_sdio.o 匹配到二进制文件 ./bcmdhd.o 匹配到二进制文件 ./bcmdhd.ko 匹配到二进制文件 ./sbutils.o rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ 经过确认: R:\wyb\ap6212a0_a33_sc3817r\lichee\linux-3.4\drivers\net\wireless\bcmdhd\dhd_sdio.c static bool dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva, uint16 devid) { …… bcmsdh_chipinfo(sdh, bus->sih->chip, bus->sih->chiprev); if (!dhdsdio_chipmatch((uint16)bus->sih->chip)) { DHD_ERROR(("%s: unsupported chip: 0xx\n", __FUNCTION__, bus->sih->chip)); goto fail; } …… } 继续追踪: static bool dhdsdio_chipmatch(uint16 chipid) { if (chipid == BCM4325_CHIP_ID) return TRUE; if (chipid == BCM4329_CHIP_ID) return TRUE; if (chipid == BCM4315_CHIP_ID) return TRUE; if (chipid == BCM4319_CHIP_ID) return TRUE; if (chipid == BCM4336_CHIP_ID) return TRUE; if (chipid == BCM4330_CHIP_ID) return TRUE; if (chipid == BCM43237_CHIP_ID) return TRUE; if (chipid == BCM43362_CHIP_ID) return TRUE; if (chipid == BCM4314_CHIP_ID) return TRUE; if (chipid == BCM43242_CHIP_ID) return TRUE; if (chipid == BCM43340_CHIP_ID) return TRUE; if (chipid == BCM43341_CHIP_ID) return TRUE; if (chipid == BCM43143_CHIP_ID) return TRUE; if (chipid == BCM43342_CHIP_ID) return TRUE; if (chipid == BCM4334_CHIP_ID) return TRUE; if (chipid == BCM43239_CHIP_ID) return TRUE; if (chipid == BCM4324_CHIP_ID) return TRUE; if (chipid == BCM4335_CHIP_ID) return TRUE; if (chipid == BCM4339_CHIP_ID) return TRUE; if (chipid == BCM43349_CHIP_ID) return TRUE; if (chipid == BCM4345_CHIP_ID) return TRUE; if (chipid == BCM4350_CHIP_ID) return TRUE; if (chipid == BCM4354_CHIP_ID) return TRUE; if (chipid == BCM4356_CHIP_ID) return TRUE; if (chipid == BCM4358_CHIP_ID) return TRUE; if (chipid == BCM4371_CHIP_ID) return TRUE; if (chipid == BCM43430_CHIP_ID) return TRUE; if (BCM4349_CHIP(chipid)) return TRUE; return FALSE; } 20、 rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ ll 总用量 40 drwxr-xr-x 7 rootroot rootroot 4096 6月 26 12:02 ./ drwx------ 6 rootroot rootroot 4096 6月 26 14:16 ../ drwxr-xr-x 10 rootroot rootroot 4096 9月 4 2014 brandy/ -rw-rw-r-- 1 rootroot rootroot 116 6月 26 12:02 .buildconfig drwxr-xr-x 15 rootroot rootroot 4096 9月 4 2014 buildroot/ -r-xr-xr-x 1 rootroot rootroot 55 9月 4 2014 build.sh* drwxr-xr-x 28 rootroot rootroot 4096 6月 26 14:30 linux-3.4/ drwxrwxr-x 3 rootroot rootroot 4096 6月 26 12:02 out/ -r--r--r-- 1 rootroot rootroot 232 9月 4 2014 README drwxr-xr-x 7 rootroot rootroot 4096 6月 7 19:33 tools/ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. dragonboard 2. linux Choice: 0 All available kernel: 0. linux-3.4 Choice: 0 All available boards: 0. evb 1. maple 2. redwood 3. y2 4. y3 Choice: 4 rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ ./build.sh INFO: ---------------------------------------- INFO: build lichee ... INFO: chip: sun8iw5p1 INFO: platform: android INFO: kernel: linux-3.4 INFO: board: y3 INFO: output: out/sun8iw5p1/android/y3 INFO: ---------------------------------------- INFO: build buildroot ... external toolchain has been installed INFO: build buildroot OK. INFO: build kernel ... INFO: prepare toolchain ... Building kernel CHK include/linux/version.h CHK include/generated/utsrelease.h make[1]: “include/generated/mach-types.h”是最新的。 CALL scripts/checksyscalls.sh CHK include/generated/compile.h CC arch/arm/mach-sunxi/pm/standby/common.o CC arch/arm/mach-sunxi/pm/standby/standby_clock.o CC arch/arm/mach-sunxi/pm/standby/standby_ir.o CC arch/arm/mach-sunxi/pm/standby/standby_key.o CC arch/arm/mach-sunxi/pm/standby/standby_power.o CC arch/arm/mach-sunxi/pm/standby/standby_twi.o CC arch/arm/mach-sunxi/pm/standby/standby_usb.o AS arch/arm/mach-sunxi/pm/standby/standby_delay.o CC arch/arm/mach-sunxi/pm/standby/./arisc/standby_arisc.o CC arch/arm/mach-sunxi/pm/standby/./arisc/arisc_hwmsgbox.o CHK kernel/config_data.h CC arch/arm/mach-sunxi/pm/standby/./arisc/arisc_hwspinlock.o CC arch/arm/mach-sunxi/pm/standby/./arisc/arisc_message_manager.o CC arch/arm/mach-sunxi/pm/standby/./../pm_debug.o CC arch/arm/mach-sunxi/pm/standby/./../mem_timing.o CC arch/arm/mach-sunxi/pm/standby/./../mem_mmu_pc.o AS arch/arm/mach-sunxi/pm/standby/./../mem_mmu_pc_asm.o CC arch/arm/mach-sunxi/pm/standby/./../mem_serial.o CC arch/arm/mach-sunxi/pm/standby/./../mem_printk.o AS arch/arm/mach-sunxi/pm/standby/./../mem_divlib.o CC arch/arm/mach-sunxi/pm/standby/./../mem_divlibc.o CC arch/arm/mach-sunxi/pm/standby/./../mem_int.o CC arch/arm/mach-sunxi/pm/standby/./../mem_tmr.o CC arch/arm/mach-sunxi/pm/standby/./../mem_tmstmp.o CC arch/arm/mach-sunxi/pm/standby/./../mem_clk.o CC arch/arm/mach-sunxi/pm/standby/./../mem_hwspinlock.o CC arch/arm/mach-sunxi/pm/standby/standby.o rm -rf *.o arch/arm/mach-sunxi/pm/standby/../*.o CC arch/arm/mach-sunxi/pm/standby/super/common.o CC arch/arm/mach-sunxi/pm/standby/super/super_twi.o CC [M] drivers/net/wireless/bcmdhd/dhd_sdio.o AS arch/arm/mach-sunxi/pm/standby/super/super_delay.o CC arch/arm/mach-sunxi/pm/standby/super/super_clock.o CC arch/arm/mach-sunxi/pm/standby/super/super_power.o CC arch/arm/mach-sunxi/pm/standby/super/super_cpus.o AS arch/arm/mach-sunxi/pm/standby/super/resume/resume1.o CC arch/arm/mach-sunxi/pm/standby/super/resume/resume_head.o CC arch/arm/mach-sunxi/pm/standby/super/resume/resume1_c_part.o CC arch/arm/mach-sunxi/pm/standby/../pm_debug.o CC arch/arm/mach-sunxi/pm/standby/../mem_timing.o CC arch/arm/mach-sunxi/pm/standby/../mem_mmu_pc.o AS arch/arm/mach-sunxi/pm/standby/../mem_mmu_pc_asm.o CC arch/arm/mach-sunxi/pm/standby/../mem_cpu.o CC arch/arm/mach-sunxi/pm/standby/../mem_serial.o CC arch/arm/mach-sunxi/pm/standby/../mem_printk.o CC [M] drivers/net/wireless/bcmdhd/dhd_cdc.o CC [M] drivers/net/wireless/bcmdhd/bcmsdh_linux.o CC [M] drivers/net/wireless/bcmdhd/dhd_common.o AS arch/arm/mach-sunxi/pm/standby/../mem_divlib.o CC arch/arm/mach-sunxi/pm/standby/../mem_divlibc.o drivers/net/wireless/bcmdhd/dhd_sdio.c: In function ‘dhdsdio_chipmatch’: drivers/net/wireless/bcmdhd/dhd_sdio.c:6936:16: error: ‘BCM43430_CHIP_ID’ undeclared (first use in this function) drivers/net/wireless/bcmdhd/dhd_sdio.c:6936:16: note: each undeclared identifier is reported only once for each function it appears in CC arch/arm/mach-sunxi/pm/standby/../mem_int.o make[4]: *** [drivers/net/wireless/bcmdhd/dhd_sdio.o] 错误 1 make[4]: *** 正在等待未完成的任务.... CC arch/arm/mach-sunxi/pm/standby/../mem_tmr.o CC arch/arm/mach-sunxi/pm/standby/../mem_tmstmp.o CC arch/arm/mach-sunxi/pm/standby/../mem_hwspinlock.o CC arch/arm/mach-sunxi/pm/standby/../mem_clk.o Source file is open Destination file is created. Source file is open Destination file is open. temp value is 400. 0 soure_file size is 9496. destination_file size is 0x2800. check sum generated is 0x68D92007. Everything is ok. rm -rf *.o arch/arm/mach-sunxi/pm/standby/../*.o CC arch/arm/mach-sunxi/pm/mem_mapping.o CC arch/arm/mach-sunxi/pm/mem_divlibc.o CC arch/arm/mach-sunxi/pm/mem_cpu.o AS arch/arm/mach-sunxi/pm/mem_cpu_asm.o AS arch/arm/mach-sunxi/pm/mem_mmu_pc_asm.o CC arch/arm/mach-sunxi/pm/mem_mmu_pc.o CC arch/arm/mach-sunxi/pm/mem_int.o CC arch/arm/mach-sunxi/pm/mem_clk.o CC arch/arm/mach-sunxi/pm/mem_tmr.o CC arch/arm/mach-sunxi/pm/mem_tmstmp.o CC arch/arm/mach-sunxi/pm/mem_twi.o CC arch/arm/mach-sunxi/pm/mem_gpio.o CC arch/arm/mach-sunxi/pm/mem_sram.o CC arch/arm/mach-sunxi/pm/mem_ccu.o CC arch/arm/mach-sunxi/pm/mem_cci400.o CC arch/arm/mach-sunxi/pm/mem_gtbus.o CC arch/arm/mach-sunxi/pm/pm_debug.o CC arch/arm/mach-sunxi/pm/mem_timing.o CC arch/arm/mach-sunxi/pm/mem_hwspinlock.o CC arch/arm/mach-sunxi/pm/pm.o CC arch/arm/mach-sunxi/pm/extended_standby.o CC arch/arm/mach-sunxi/pm/standby/super/super_power.o CC arch/arm/mach-sunxi/pm/standby/super/super_twi.o CC arch/arm/mach-sunxi/pm/standby/super/super_clock.o AS arch/arm/mach-sunxi/pm/standby.o AS arch/arm/mach-sunxi/pm/mem.o LD arch/arm/mach-sunxi/pm/pm_tmp.o LD arch/arm/mach-sunxi/pm/built-in.o LD arch/arm/mach-sunxi/built-in.o make[3]: *** [drivers/net/wireless/bcmdhd] 错误 2 make[2]: *** [drivers/net/wireless] 错误 2 make[1]: *** [drivers/net] 错误 2 make: *** [drivers] 错误 2 ERROR: build kernel Failed rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ 21、(dhdsdio_probe_attach: unsupported chip: 0xa9a6) R:\wyb\ap6212a0_a33_sc3817r\lichee\linux-3.4\drivers\net\wireless\bcmdhd\include\bcmdevs.h #define BCM4350_CHIP_ID 0x4350 #define BCM43430_CHIP_ID 43430 /* 43430 chipcommon chipid 0xa9a6 */ #define BCM4342_CHIP_ID 4342 可以编译通过了。 (查看属性:) shell@astar-y3:/ $ shell@astar-y3:/ $ cd /system/vendor/modules/ shell@astar-y3:/system/vendor/modules $ ll bcm* -rw-r--r-- root root 26020 2017-06-26 12:46 bcm43438a0.hcd -rw-r--r-- root root 748856 2017-06-26 12:46 bcmdhd.ko shell@astar-y3:/system/vendor/modules $ Microsoft Windows [版本 6.1.7600] 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。 C:\Users\Administrator>cd R:\wyb\ap6212a0_a33_sc3817r\lichee\linux-3.4\drivers\n et\wireless\bcmdhd C:\Users\Administrator>r: R:\wyb\ap6212a0_a33_sc3817r\lichee\linux-3.4\drivers\net\wireless\bcmdhd>adb remount * daemon not running. starting it now on port 5037 * * daemon started successfully * remount succeeded R:\wyb\ap6212a0_a33_sc3817r\lichee\linux-3.4\drivers\net\wireless\bcmdhd> R:\wyb\ap6212a0_a33_sc3817r\lichee\linux-3.4\drivers\net\wireless\bcmdhd>adb push bcmdhd.ko /system/vendor/modules/ 1677 KB/s (748864 bytes in 0.436s) R:\wyb\ap6212a0_a33_sc3817r\lichee\linux-3.4\drivers\net\wireless\bcmdhd> 继续查看属性: shell@astar-y3:/system/vendor/modules $ ll bcm* -rw-r--r-- root root 26020 2017-06-26 12:46 bcm43438a0.hcd -rw-rw-rw- root root 748864 2017-06-26 14:34 bcmdhd.ko shell@astar-y3:/system/vendor/modules $ shell@astar-y3:/system/vendor/modules $ shell@astar-y3:/system/vendor/modules $ chmod 644 bcmdhd.ko Unable to chmod bcmdhd.ko: Operation not permitted 10|shell@astar-y3:/system/vendor/modules $ (必须在su下才能够修改属性:) shell@astar-y3:/system/vendor/modules $ su shell@astar-y3:/system/vendor/modules # chmod 644 bcmdhd.ko shell@astar-y3:/system/vendor/modules # shell@astar-y3:/system/vendor/modules # sync shell@astar-y3:/system/vendor/modules # reboot 22、 [ 0.658241] [wifi]: select wifi: ap6210 !! [ 0.658587] [ap6xxx]: module power name axp22_dldo1 [ 0.658601] [ap6xxx]: module power ext1 name axp22_dldo2 [ 0.658613] [ap6xxx]: module power ext2 name axp22_aldo1 [ 0.658721] [ap6xxx]: get ap6xxx wifi_power_switch failed [ 0.658731] [ap6xxx]: ap6xxx module power set by axp. [ 0.658930] [ap6xxx]: first time [ 0.659285] [ap6xxx]: regulator on. [ 0.661306] [wifi_pm]: wifi gpio init is OK !! (重启之后,WIFI模块要想办法配置为ap6212,现阶段借用的是AP6210!) [ 8.517657] gpio ap6xxx_wl_regon set val 1, act val 1 [ 8.623325] [ap6xxx]: sdio wifi power state: on [ 8.628389] [mmc]: sdc1 set ios: clk 0Hz bm PP pm UP vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 8.628566] =========== WLAN placed in POWER ON ======== [ 8.645459] [mmc]: sdc1 card_power_on start... [ 8.650397] [mmc]: sdc1 power_supply is null [ 8.655129] [mmc]: sdc1 card_power_on ok [ 8.680031] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 8.690267] [mmc]: mclk 0xf1c2008c 0x8002000e [ 8.772360] [mmc]: *** sunxi_mci_dump_errinfo(L773): smc 1 err, cmd 52, RTO !! [ 8.781316] [mmc]: *** sunxi_mci_dump_errinfo(L773): smc 1 err, cmd 52, RTO !! [ 8.789448] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 8.799684] [mmc]: mclk 0xf1c2008c 0x8002000e [ 8.861971] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 8.872189] [mmc]: mclk 0xf1c2008c 0x8002000e [ 8.933887] [mmc]: *** sunxi_mci_dump_errinfo(L773): smc 1 err, cmd 8, RTO !! [ 8.941921] *******************Try sdio******************* [ 8.948329] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 8.958545] [mmc]: mclk 0xf1c2008c 0x8002000e [ 9.027690] mmc1: queuing unknown CIS tuple 0x80 (2 bytes) [ 9.035325] mmc1: queuing unknown CIS tuple 0x80 (3 bytes) [ 9.043192] mmc1: queuing unknown CIS tuple 0x80 (3 bytes) [ 9.052046] mmc1: queuing unknown CIS tuple 0x80 (7 bytes) [ 9.145358] [mmc]: sdc1 set ios: clk 400000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B [ 9.155486] [mmc]: mclk 0xf1c2008c 0x8002000e [ 9.215398] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 1 timing SD-HS(SDR25) dt B [ 9.225785] [mmc]: mclk 0xf1c2008c 0x8100000b [ 9.285721] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 9.296049] [mmc]: mclk 0xf1c2008c 0x8140030b [ 9.357922] mmc1: new high speed SDIO card at address 0001 [ 9.364523] bcmsdh_register: Linux Kernel SDIO/MMC Driver [ 9.364563] *******************sdio init ok******************* [ 9.377203] bcm_wlan_get_oob_irq enter. [ 9.381534] gpio [359] map to virq [7] ok [ 9.388816] F1 signature OK, socitype:0x1 chip:0xa9a6 rev:0x0 pkg:0x4 [ 9.396740] DHD: dongle ram size is set to 524288(orig 524288) at 0x0 [ 9.404660] dhdsdio_probe: Disable prop_txstatus [ 9.410903] wl_create_event_handler(): thread:wl_event_handler:5d started [ 9.410914] tsk Enter, tsk = 0xddca13d8 [ 9.423788] p2p0: P2P Interface Registered [ 9.428464] dhd_attach(): thread:dhd_watchdog_thread:5e started [ 9.435144] dhd_attach(): thread:dhd_dpc:5f started [ 9.440653] dhd_attach(): thread:dhd_sysioc:60 started [ 9.447276] Broadcom Dongle Host Driver: register interface [wlan0] MAC: 00:90:4c:11:22:33 [ 9.456558] [ 9.456561] Dongle Host Driver, version 1.88.45.3 (r420671) [ 9.456565] Compiled in drivers/net/wireless/bcmdhd on Jun 26 2017 at 14:34:04 [ 9.472427] gpio ap6xxx_wl_regon set val 0, act val 0 [ 9.578054] [ap6xxx]: sdio wifi power state: off [ 9.583186] =========== WLAN placed in RESET ======== (WIFI启动加载正常) shell@astar-y3:/ $ lsmod gt82x 9849 0 - Live 0x00000000 sunxi_schw 12559 0 - Live 0x00000000 (O) cdc_ether 5099 0 - Live 0x00000000 rtl8150 9023 0 - Live 0x00000000 mcs7830 6292 0 - Live 0x00000000 qf9700 7805 0 - Live 0x00000000 asix 17150 0 - Live 0x00000000 usbnet 17700 4 cdc_ether,mcs7830,qf9700,asix, Live 0x00000000 sunxi_keyboard 3021 0 - Live 0x00000000 sw_device 13604 0 - Live 0x00000000 vfe_v4l2 445364 0 - Live 0x00000000 gc2035 12696 0 - Live 0x00000000 gc0308 10702 0 - Live 0x00000000 vfe_subdev 4523 3 vfe_v4l2,gc2035,gc0308, Live 0x00000000 vfe_os 4099 2 vfe_v4l2,vfe_subdev, Live 0x00000000 cci 21594 2 gc2035,gc0308, Live 0x00000000 videobuf_dma_contig 5535 1 vfe_v4l2, Live 0x00000000 videobuf_core 16520 2 vfe_v4l2,videobuf_dma_contig, Live 0x00000000 bcmdhd 556965 0 - Live 0x00000000 leds_sunxi 1351 0 - Live 0x00000000 mali 209914 20 - Live 0x00000000 (O) lcd 38180 0 - Live 0x00000000 disp 993096 8 mali,lcd, Live 0x00000000 nand 280622 0 - Live 0x00000000 (O) shell@astar-y3:/ $ (bcmdhd.ko这个驱动模块加载正常:) (BT没有打开,但是不停地打印BT超时出错,不知道是何解?) shell@astar-y3:/ $ [ 511.880344] [BT_LPM] bluesleep_tx_timer_expire: Tx timer expired [ 511.887326] [BT_LPM] bluesleep_tx_timer_expire: Tx has been idle 23、 由于此时WIFI出于记住上一次的状态的状态(打不开),所以需要重新刷镜像IMG,然后替换:bcmdhd.ko shell@astar-y3:/ $ shell@astar-y3:/ $ lsmod gt82x 9849 0 - Live 0x00000000 sunxi_schw 12559 0 - Live 0x00000000 (O) cdc_ether 5099 0 - Live 0x00000000 rtl8150 9023 0 - Live 0x00000000 mcs7830 6292 0 - Live 0x00000000 qf9700 7805 0 - Live 0x00000000 asix 17150 0 - Live 0x00000000 usbnet 17700 4 cdc_ether,mcs7830,qf9700,asix, Live 0x00000000 sunxi_keyboard 3021 0 - Live 0x00000000 sw_device 13604 0 - Live 0x00000000 vfe_v4l2 445364 0 - Live 0x00000000 gc2035 12696 0 - Live 0x00000000 gc0308 10702 0 - Live 0x00000000 vfe_subdev 4523 3 vfe_v4l2,gc2035,gc0308, Live 0x00000000 vfe_os 4099 2 vfe_v4l2,vfe_subdev, Live 0x00000000 cci 21594 2 gc2035,gc0308, Live 0x00000000 videobuf_dma_contig 5535 1 vfe_v4l2, Live 0x00000000 videobuf_core 16520 2 vfe_v4l2,videobuf_dma_contig, Live 0x00000000 bcmdhd 556965 0 - Live 0x00000000 leds_sunxi 1351 0 - Live 0x00000000 mali 209914 15 - Live 0x00000000 (O) lcd 38180 0 - Live 0x00000000 disp 993096 8 mali,lcd, Live 0x00000000 nand 280622 0 - Live 0x00000000 (O) shell@astar-y3:/ $ shell@astar-y3:/ $ shell@astar-y3:/ $ [ 110.012176] init: computing context for service '/system/bin/wpa_supplicant' [ 110.025400] init: starting 'p2p_supplicant' [ 110.039886] init: Created socket '/dev/socket/wpa_wlan0' with mode '660', user '1010', group '1010' [ 110.119751] dhd_conf_set_fw_name_by_chip: firmware_path=/system/vendor/modules/fw_bcm43438a0.bin [ 110.140144] [ 110.140153] Dongle Host Driver, version 1.88.45.3 (r420671) [ 110.140158] Compiled in drivers/net/wireless/bcmdhd on Jun 26 2017 at 14:34:04 [ 110.173523] wl_android_wifi_on in 1 [ 110.177409] wl_android_wifi_on in 2: g_wifi_on=0 [ 110.200103] gpio ap6xxx_wl_regon set val 1, act val 1 [ 110.280025] [BT_LPM] bluesleep_tx_timer_expire: Tx timer expired [ 110.286694] [BT_LPM] bluesleep_tx_timer_expire: Tx has been idle [ 110.355684] [ap6xxx]: sdio wifi power state: on [ 110.360930] =========== WLAN going back to live ======== [ 110.366925] sdio_reset_comm(): [ 110.370346] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 110.380773] [mmc]: mclk 0xf1c2008c 0x8140030b [ 110.443029] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 110.454758] [mmc]: mclk 0xf1c2008c 0x8140030b [ 110.516097] [mmc]: sdc1 set ios: clk 150000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 110.530958] [mmc]: mclk 0xf1c2008c 0x80430309 [ 110.592013] [mmc]: sdc1 set ios: clk 150000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 110.603518] [mmc]: mclk 0xf1c2008c 0x80030009 [ 110.681418] mmc1: queuing unknown CIS tuple 0x80 (2 bytes) [ 110.690726] mmc1: queuing unknown CIS tuple 0x80 (3 bytes) [ 110.700331] mmc1: queuing unknown CIS tuple 0x80 (3 bytes) [ 110.712218] mmc1: queuing unknown CIS tuple 0x80 (7 bytes) [ 110.894520] [mmc]: sdc1 set ios: clk 150000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 110.904933] [mmc]: mclk 0xf1c2008c 0x80030009 [ 110.964907] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 110.975514] [mmc]: mclk 0xf1c2008c 0x8100000b [ 111.035618] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 111.046398] [mmc]: mclk 0xf1c2008c 0x8140030b [ 111.108547] [ 111.108566] [ 111.108579] dhd_bus_devreset: == WLAN ON == [ 111.116882] dhd_bus_devreset called when dongle is not in reset [ 111.123683] Will call dhd_bus_start instead [ 111.128637] dhd_conf_set_fw_name_by_chip: firmware_path=/system/vendor/modules/fw_bcm43438a0.bin [ 111.140963] dhd_conf_download_config: Ignore config file /system/vendor/modules/config.txt [ 111.151802] Final fw_path=/system/vendor/modules/fw_bcm43438a0.bin [ 111.158689] Final nv_path=/system/vendor/modules/nvram_ap6210.txt [ 111.165542] Final conf_path=/system/vendor/modules/config.txt [ 111.257577] dhdsdio_download_nvram: Open nvram file failed /system/vendor/modules/nvram_ap6210.txt [ 111.268309] _dhdsdio_download_firmware: dongle nvram file download failed [ 111.276022] dhd_bus_start: dhdsdio_probe_download failed. firmware = /system/vendor/modules/fw_bcm43438a0.bin nvram = /system/vendor/modules/nvram_ap6210.txt config = /system/vendor/modules/config.txt [ 111.295979] dhd_bus_devreset: dhd_bus_start fail with -1 [ 111.304154] dhd_dev_reset: dhd_bus_devreset: -1 [ 111.309190] dhd_prot_ioctl : bus is down. we have nothing to do [ 111.330328] dhd_bus_devreset: WLAN OFF DONE [ 111.335225] gpio ap6xxx_wl_regon set val 0, act val 0 [ 111.472499] [ap6xxx]: sdio wifi power state: off [ 111.477661] =========== WLAN placed in RESET ======== [ 111.483304] wl_android_wifi_on: Failed [ 111.487473] wl_android_wifi_off in 1 [ 111.491478] wl_android_wifi_off in 2: g_wifi_on=0 [ 111.496711] wl_android_wifi_off out [ 111.509335] init: waitpid returned pid 1211, status = 0000ff00 [ 111.516072] init: process 'p2p_supplicant', pid 1211 exited shell@astar-y3:/ $ shell@astar-y3:/ $ 24、定位问题:dhd_bus_devreset: dhd_bus_start fail with -1 rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ cd linux-3.4/drivers/net/wireless/bcmdhd/ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ grep "dhd_bus_start fail with" . -R ./dhd_sdio.c: DHD_ERROR(("%s: dhd_bus_start fail with %d\n", 匹配到二进制文件 ./dhd_sdio.o 匹配到二进制文件 ./bcmdhd.o 匹配到二进制文件 ./bcmdhd.ko rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee$ cd linux-3.4/drivers/net/wireless/bcmdhd/ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ grep "dhd_bus_start fail with" . -R ./dhd_sdio.c: DHD_ERROR(("%s: dhd_bus_start fail with %d\n", 匹配到二进制文件 ./dhd_sdio.o 匹配到二进制文件 ./bcmdhd.o 匹配到二进制文件 ./bcmdhd.ko rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ int dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag) { …… dhd_conf_set_fw_name_by_chip(dhdp, fw_path, firmware_path); if ((bcmerror = dhd_bus_start(dhdp)) != 0) DHD_ERROR(("%s: dhd_bus_start fail with %d\n", __FUNCTION__, bcmerror)); } } return bcmerror; } rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ grep dhd_bus_start . -R ./dhd_sdio.c: if ((ret = dhd_bus_start(bus->dhd)) != 0) { ./dhd_sdio.c: DHD_ERROR(("%s: dhd_bus_start failed\n", __FUNCTION__)); ./dhd_sdio.c: DHD_ERROR(("Will call dhd_bus_start instead\n")); ./dhd_sdio.c: if ((bcmerror = dhd_bus_start(dhdp)) != 0) ./dhd_sdio.c: DHD_ERROR(("%s: dhd_bus_start fail with %d\n", ./dhd_sdio - 副本.c: if ((ret = dhd_bus_start(bus->dhd)) != 0) { ./dhd_sdio - 副本.c: DHD_ERROR(("%s: dhd_bus_start failed\n", __FUNCTION__)); ./dhd_sdio - 副本.c: DHD_ERROR(("Will call dhd_bus_start instead\n")); ./dhd_sdio - 副本.c: if ((bcmerror = dhd_bus_start(dhdp)) != 0) ./dhd_sdio - 副本.c: DHD_ERROR(("%s: dhd_bus_start fail with %d\n", ./dhd_sdio - 副本 (2).c: if ((ret = dhd_bus_start(bus->dhd)) != 0) { ./dhd_sdio - 副本 (2).c: DHD_ERROR(("%s: dhd_bus_start failed\n", __FUNCTION__)); ./dhd_sdio - 副本 (2).c: DHD_ERROR(("Will call dhd_bus_start instead\n")); ./dhd_sdio - 副本 (2).c: if ((bcmerror = dhd_bus_start(dhdp)) != 0) ./dhd_sdio - 副本 (2).c: DHD_ERROR(("%s: dhd_bus_start fail with %d\n", ./dhd.h:extern int dhd_bus_start(dhd_pub_t *dhdp); ./wl_android.c:/* Initialize g_wifi_on to 1 so dhd_bus_start will be called for the first ./dhd_linux.c: if ((ret = dhd_bus_start(&dhd->pub)) != 0) { ./dhd_linux.c: /* dhd_prot_init has been called in dhd_bus_start or wl_android_wifi_on */ ./dhd_linux.c:dhd_bus_start(dhd_pub_t *dhdp) rootroot@rootroot-E400:~/wyb/ap6212a0_a33_sc3817r/lichee/linux-3.4/drivers/net/wireless/bcmdhd$ 定位到这里: int dhd_bus_start(dhd_pub_t *dhdp) { …… /* try to download image and nvram to the dongle */ if ((dhd->pub.busstate == DHD_BUS_DOWN) && (fw_path[0] != '\0') && (nv_path[0] != '\0')) { #ifdef SHOW_NVRAM_TYPE { /* Show nvram type in the kernel log */ int i; for (i = 0; nv_path[i] != '\0'; ++i) { if (nv_path[i] == '.') { ++i; break; } } DHD_ERROR(("%s: nvram_type = [%s]\n", __FUNCTION__, &nv_path[i])); } #endif /* SHOW_NVRAM_TYPE */ /* wake lock moved to dhdsdio_download_firmware */ if (!(dhd_bus_download_firmware(dhd->pub.bus, dhd->pub.osh, fw_path, nv_path, conf_path))) { DHD_ERROR(("%s: dhdsdio_probe_download failed. firmware = %s nvram = %s config = %s\n", __FUNCTION__, fw_path, nv_path, conf_path)); #ifdef DHDTHREAD if (dhd->threads_only) dhd_os_sdunlock(dhdp); #endif /* DHDTHREAD */ // 2017/6/23 18:40 wenyuanbo download ap6212 fail not return error!!!! //return -1; } } …… return 0; } 由于ap6212没有config.txt文件,下载肯定会出错,比对全志R16平台去AP6212的处理,关闭这里: //return -1; 25、 shell@astar-y3:/ $ shell@astar-y3:/ $ [ 110.012176] init: computing context for service '/system/bin/wpa_supplicant' [ 110.025400] init: starting 'p2p_supplicant' [ 110.039886] init: Created socket '/dev/socket/wpa_wlan0' with mode '660', user '1010', group '1010' [ 110.119751] dhd_conf_set_fw_name_by_chip: firmware_path=/system/vendor/modules/fw_bcm43438a0.bin [ 110.140144] [ 110.140153] Dongle Host Driver, version 1.88.45.3 (r420671) [ 110.140158] Compiled in drivers/net/wireless/bcmdhd on Jun 26 2017 at 14:34:04 [ 110.173523] wl_android_wifi_on in 1 [ 110.177409] wl_android_wifi_on in 2: g_wifi_on=0 [ 110.200103] gpio ap6xxx_wl_regon set val 1, act val 1 [ 110.280025] [BT_LPM] bluesleep_tx_timer_expire: Tx timer expire
调通sina33下的AP6212A0(WIFI+BT) 大文实验室/大文哥 壹捌陆捌零陆捌捌陆捌贰 wb4916 AT qq.com 完成时间:2017/6/28 12:13 版本:V1.3 本文参照: 《A33 wifi移植说明书.pdf》 还有就是全志R16平台的parrotv1.1的官方SDK(Android4.4.2) 1、打开AP6212的BT,关闭rtl8723bs的BT(其它都是按照比对软件的字母顺序了): [ 3.141273] Bluetooth: HCI UART driver ver 2.2 [ 3.146210] Bluetooth: HCI H4 protocol initialized [ 3.151563] Bluetooth: HCI BCSP protocol initialized [ 3.157154] usbcore: registered new interface driver btusb [ 3.163282] Bluetooth: Generic Bluetooth SDIO driver ver 0.1 [ 3.169599] Bluetooth: BlueSleep Mode Driver Ver 1.1 [ 3.175402] Bluetooth: get rtl8723bs rtl8723bs_bt_host_wake gpio failed [ 3.953017] Bluetooth: RFCOMM TTY layer initialized [ 3.958456] Bluetooth: RFCOMM socket layer initialized [ 3.964183] Bluetooth: RFCOMM ver 1.11 [ 3.968340] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 3.968638] [mmc]: sdc2 set ios: clk 25000000Hz bm PP pm ON vdd 3.3V width 1 timing LEGACY(SDR12) dt B [ 3.968734] [mmc]: mclk 0xf1c20090 0xc100000b [ 3.989421] Bluetooth: BNEP filters: protocol multicast [ 3.995242] Bluetooth: HIDP (Human Interface Emulation) ver 1.2 [ 4.001921] L2TP core driver, V2.0 [ 4.005706] PPPoL2TP kernel driver, V2.0 [ 4.010070] L2TP IP encapsulation support (L2TPv3) [ 4.015468] L2TP netlink interface [ 4.019264] L2TP ethernet pseudowire support (L2TPv3) [ 4.023860] [mmc]: sdc2 set ios: clk 25000000Hz bm PP pm ON vdd 3.3V width 1 timing MMC-HS(SDR20) dt B [ 4.023929] [mmc]: mclk 0xf1c20090 0xc100000b [ 4.040272] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5 [ 4.048780] ThumbEE CPU extension supported. [ 4.053550] Registering SWP/SWPB emulation handler [ 4.059269] [rfkill]: rfkill set power 1 [ 4.063652] gpio ap6xxx_bt_regon set val 0, act val 0 正常启动的BT加载: [ 3.207764] Bluetooth: HCI UART driver ver 2.2 [ 3.212725] Bluetooth: HCI H4 protocol initialized [ 3.218045] Bluetooth: HCI BCSP protocol initialized [ 3.223671] us
r40_tinav2.1_最终验证通过_使用CB-S来验证OV5640有横条纹fpscamera+SPI2.0成功_20171114_1443没有外层目录.7z 开发板:CB-S 1、(可选修改/调试技巧:) 除了ov5640.c之外,其它的驱动都不编译,节省编译时间! W:\ov5640_spi20_r40t\lichee\linux-3.10\drivers\media\platform\sunxi-vfe\device\Makefile obj-m += ov5640.o #obj-m += ov2640.o #obj-m += ov7736.o #obj-m += s5k4ec.o #obj-m += s5k4ec_mipi.o #obj-m += gc2035.o #obj-m += gt2005.o #obj-m += gc0307.o #obj-m += gc0308.o #obj-m += gc0328.o #obj-m += gc0328c.o #obj-m += gc2145.o #obj-m += gc0329.o #obj-m += gc0311.o #obj-m += hi253.o #obj-m += sp2518.o #obj-m += sp2519.o #obj-m += sp0718.o #obj-m += sp0838.o #obj-m += ov16825.o #obj-m += ov5650.o #obj-m += ov5647.o #obj-m += ov5647_mipi.o #obj-m += t8et5.o #obj-m += s5k4e1.o #obj-m += s5k4e1_mipi.o #obj-m += sp2518.o #obj-m += sp0718.o #obj-m += gc5004.o #obj-m += gc5004_mipi.o #obj-m += ov5648.o #obj-m += ar0330.o #obj-m += ov5648.o #obj-m += sp5408.o #obj-m += ov12830.o #obj-m += ov8825.o #obj-m += ov8850.o #obj-m += gc2155.o #obj-m += ov8858.o #obj-m += ov13850.o #obj-m += imx214.o #obj-m += ov8858_4lane.o #obj-m += sp5409.o #obj-m += s5k5e2yx.o #obj-m += ov2710_mipi.o #obj-m += ov2686.o (这里是看ov5640的驱动的probe执行是否正确?设备ID是否读取成功!) W:\ov5640_spi20_r40t\lichee\linux-3.10\drivers\media\platform\sunxi-vfe\device\ov5640.c static int sensor_detect(struct v4l2_subdev *sd) { data_type rdval; printk("****wyb %s:%d/%s()! \n", __FILE__, __LINE__, __func__); LOG_ERR_RET(sensor_read(sd, 0x300a, &rdval;)) printk("****wyb %s:%d/%s()! 0x300a rdval=0xx\n", __FILE__, __LINE__, __func__, rdval); if(rdval != 0x56) return -ENODEV; LOG_ERR_RET(sensor_read(sd, 0x300b, &rdval;)) printk("****wyb %s:%d/%s()! 0x300b rdval=0xx\n", __FILE__, __LINE__, __func__, rdval); if(rdval != 0x40) return -ENODEV; return 0; } (在全志R16平台改过这个文件,让摄像头不要休眠,但是全志R40平台的tina v2.1系统下不需要修改!) W:\ov5640_spi20_r40t\lichee\linux-3.10\drivers\media\platform\sunxi-vfe\vfe.c 2、(可
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值