string resource id #0x0的问题

原因:

        在setText()方法中设置了一个int型变量,在运行的时候就会报String resource id #0x0的错误,

解决方法:

是把int型数据改成String类型,如setText(5+""); 
因为这样Android系统就会主动去资源文件当中寻找, 但是它不是一个资源文件ID, 所以就会报出这个bug。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
全志R16平台的tinav2.0系统下调通HM1375 2017/8/24 14:04 开发板:SC3817R OS:tina V2.0 1、最新的驱动程序请直接联系HiMax原厂/代理商! R:\wyb\thl_r16_tinav2.0_hm1375\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\hm1375.c 2、 R:\wyb\thl_r16_tinav2.0_hm1375\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\Makefile EXTRA_LDFLAGS += --strip-debug ifneq ($(strip $(CONFIG_ARCH_SUN8IW8)),) obj-$(CONFIG_OV2710_MIPI)+= ov2710_mipi.o obj-$(CONFIG_OV4689)+= ov4689.o obj-$(CONFIG_OV4689_60FPS)+= ov4689_60fps.o obj-$(CONFIG_AR0330_MIPI)+= ar0330_mipi.o obj-$(CONFIG_OV4689_SDV)+= ov4689_sdv.o obj-$(CONFIG_GC1004_MIPI)+= gc1004_mipi.o obj-$(CONFIG_H22_MIPI)+= h22_mipi.o obj-$(CONFIG_NT99231_MIPI)+= nt99231_mipi.o else obj-m+= hm1375.o #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+= 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+= gc2145.o #obj-m+= gc2145d.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+= siv121d.o #obj-m+= ov2710_mipi.o #obj-m+= bg0703.o #obj-m+= gc1014_mipi.o #obj-m+= imx219.o #obj-m+= imx224.o #obj-m+= imx322.o #obj-m+= ov8858_r2a_4lane.o #obj-m+= ov8865_4lane.o #obj-m+= ps1210.o #obj-m+= imx291.o endif 3、让tinav2.0启动之后不让摄像头camera休眠: R:\wyb\thl_r16_tinav2.0_hm1375\lichee\linux-3.4\drivers\media\video\sunxi-vfe\vfe.c static void probe_work_handle(struct work_struct *work) { struct vfe_dev *dev= container_of(work, struct vfe_dev, probe_work.work); int ret = 0; int input_num; int device_valid_count = 0; struct video_device *vfd; char vfe_name[16] = {0}; mutex_lock(&probe_hdl_lock); vfe_print("probe_work_handle start!\n"); vfe_dbg(0,"v4l2_device_register\n"); #ifdef USE_SPECIFIC_CCI vfe_clk_open(dev); #endif /* v4l2 device register */ ret = v4l2_device_register(&dev->pdev->dev, &dev->v4l2_dev); if (ret) { vfe_err("Error registering v4l2 device\n"); goto probe_hdl_free_dev; } dev_set_drvdata(&dev->pdev->dev, (dev)); vfe_dbg(0,"v4l2 subdev register\n"); /* v4l2 subdev register */ dev->is_same_module = 0; for(input_num=0; input_num<dev->dev_qty; input_num++) { vfe_print("v4l2 subdev register input_num = %d\n",input_num); if(!strcmp(dev->ccm_cfg[input_num]->ccm,"")) { vfe_err("Sensor name is NULL!\n"); goto snesor_register_end; } if(dev->is_same_module) { dev->ccm_cfg[input_num]->sd = dev->ccm_cfg[input_num-1]->sd; vfe_dbg(0,"num = %d , sd_0 = %p,sd_1 = %p\n",input_num,dev->ccm_cfg[input_num]->sd,dev->ccm_cfg[input_num-1]->sd); goto snesor_register_end; } if((dev->dev_qty > 1) && (input_num+1<dev->dev_qty)) { if((!strcmp(dev->ccm_cfg[input_num]->ccm,dev->ccm_cfg[input_num+1]->ccm))) dev->is_same_module = 1; } if(dev->vip_define_sensor_list == 1) { if(dev->ccm_cfg[input_num]->sensor_cfg_ini->power_settings_enable == 1) { cpy_ccm_power_settings(dev->ccm_cfg[input_num]); } } #ifdef _REGULATOR_CHANGE_ #else if(vfe_device_regulator_get(dev->ccm_cfg[input_num])) { vfe_err("vfe_device_regulator_get error at input_num = %d\n",input_num); goto snesor_register_end; } #endif vfe_print("vfe sensor detect start! input_num = %d\n",input_num); dev->input = input_num; if(vfe_sensor_register_check(dev,&dev->v4l2_dev,dev->ccm_cfg[input_num],&dev->dev_sensor[input_num],input_num) == NULL) { vfe_err("vfe sensor register check error at input_num = %d\n",input_num); dev->device_valid_flag[input_num] = 0; //goto snesor_register_end; } else{ dev->device_valid_flag[input_num] = 1; device_valid_count ++; } if(dev->ccm_cfg[input_num]->is_isp_used && dev->ccm_cfg[input_num]->is_bayer_raw) { if(read_ini_info(dev,input_num, "/system/etc/hawkview/")) { vfe_warn("read ini info fail\n"); } } if(dev->ccm_cfg[input_num]->act_used == 1) { dev->dev_act[input_num].addr = (unsigned short)(dev->ccm_cfg[input_num]->act_slave>>1); strcpy(dev->dev_act[input_num].type,dev->ccm_cfg[input_num]->act_name); if(vfe_actuator_subdev_register(dev,dev->ccm_cfg[input_num], &dev->dev_act[input_num]) != 0) ;//goto probe_hdl_free_dev; } snesor_register_end: vfe_dbg(0,"dev->ccm_cfg[%d] = %p\n",input_num,dev->ccm_cfg[input_num]); vfe_dbg(0,"dev->ccm_cfg[%d]->sd = %p\n",input_num,dev->ccm_cfg[input_num]->sd); vfe_dbg(0,"dev->ccm_cfg[%d]->power.iovdd = %p\n",input_num,dev->ccm_cfg[input_num]->power.iovdd); vfe_dbg(0,"dev->ccm_cfg[%d]->power.avdd = %p\n",input_num,dev->ccm_cfg[input_num]->power.avdd); vfe_dbg(0,"dev->ccm_cfg[%d]->power.dvdd = %p\n",input_num,dev->ccm_cfg[input_num]->power.dvdd); vfe_dbg(0,"dev->ccm_cfg[%d]->power.afvdd = %p\n",input_num,dev->ccm_cfg[input_num]->power.afvdd); } dev->input = -1; /*video device register */ ret = -ENOMEM; vfd = video_device_alloc(); if (!vfd) { goto probe_hdl_unreg_dev; } *vfd = vfe_template[dev->id]; vfd->v4l2_dev = &dev->v4l2_dev; sprintf(vfe_name,"vfe-%d",dev->id); dev_set_name(&vfd->dev, vfe_name); if (0 != device_valid_count) { ret = video_register_device(vfd, VFL_TYPE_GRABBER, dev->id); if (ret < 0) { goto probe_hdl_rel_vdev; } } video_set_drvdata(vfd, dev); /*add device list*/ /* Now that everything is fine, let's add it to device list */ list_add_tail(&dev->devlist, &devlist); dev->vfd = vfd; vfe_print("V4L2 device registered as %s\n",video_device_node_name(vfd)); /*initial video buffer queue*/ videobuf_queue_dma_contig_init(&dev->vb_vidq, &vfe_video_qops, NULL, &dev->slock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE,//default format, can be changed by s_fmt sizeof(struct vfe_buffer), dev,NULL); ret = sysfs_create_group(&dev->pdev->dev.kobj, &vfe_attribute_group); #ifdef CONFIG_ES dev->early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB + 1; dev->early_suspend.suspend = vfe_early_suspend; dev->early_suspend.resume = vfe_late_resume; // [hawkview_err]xxxxcan't open /dev/video0(Resource temporarily unavailable) // 2016/10/25 14:33 wenyuanbo cloase suspend. // register_early_suspend(&dev->early_suspend); vfe_print("register_early_suspend @ probe handle!\n"); #endif #ifdef USE_SPECIFIC_CCI vfe_clk_close(dev); #endif vfe_print("probe_work_handle end!\n"); mutex_unlock(&probe_hdl_lock); return ; probe_hdl_rel_vdev: video_device_release(vfd); vfe_print("video_device_release @ probe_hdl!\n"); probe_hdl_unreg_dev: vfe_print("v4l2_device_unregister @ probe_hdl!\n"); v4l2_device_unregister(&dev->v4l2_dev); probe_hdl_free_dev: vfe_print("vfe_resource_release @ probe_hdl!\n"); #ifdef USE_SPECIFIC_CCI csi_cci_exit_helper(dev->cci_sel); vfe_clk_close(dev); #endif //vfe_resource_release(dev); vfe_err("Failed to install at probe handle\n"); mutex_unlock(&probe_hdl_lock); return ; } 4、 R:\wyb\thl_r16_tinav2.0_hm1375\package\allwinner\cameratest\src\common\hawkview.c int fetch_sub_cmd(const char* buf,int buf_len,char** cmd,int* cmd_num,int lenght) { int i = 0,j = 0,n = 0; while(buf[i] != '#'){ //the sub cmd end by '#' while(buf[i] != 'x' && buf[i] != ':' && buf[i] != '#') { if((i+1) > buf_len) return 0; 修改为: if(i++ > buf_len) return 0; *((char*)cmd + n*lenght + j++) = buf[i++]; if(j > lenght) { hv_err("sub cmd over long\n"); *cmd_num = n + 1; return -1; } } *((char*)cmd + n*lenght + j++) = '\0'; n++; j = 0; if(buf[i] != '#'){ i++; } if(n > *cmd_num){ hv_err("the max cmd num is %d\n",*cmd_num); return -1; } } *cmd_num = n; return 0; } R:\wyb\thl_r16_tinav2.0_hm1375\package\allwinner\cameratest\src\common\video.c static int capture_frame(void* capture,int (*set_disp_addr)(int,int,unsigned int*),pthread_mutex_t* mutex) { capture_handle* cap = (capture_handle*)capture; int ret; int i; struct v4l2_buffer buf; enum v4l2_buf_type type; fd_set fds; struct timeval tv; pthread_mutex_lock(mutex); //used for cammand and status debug if (old_vi_cmd != cap->cmd){ hv_dbg("capture frame command %d --> %d\n",old_vi_cmd,cap->cmd); old_vi_cmd = (int)cap->cmd; } if(old_status != cap->status){ hv_dbg("capture frame status %d --> %d\n",old_status,cap->status); old_status = cap->status; } if(cap->status == OFF && cap->cmd == START_STREAMMING){ hv_dbg("capture start streaming\n"); type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (ioctl(videofh, VIDIOC_STREAMON, &type) == -1) { hv_err("VIDIOC_STREAMON error! %s\n",strerror(errno)); goto quit; } cap->status = ON; cap->cmd = COMMAND_UNUSED; pthread_mutex_unlock(mutex); return 0; } if(cap->status == ON && cap->cmd == STOP_STREAMMING){ hv_dbg("capture stop streaming\n"); type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(-1 == ioctl(videofh, VIDIOC_STREAMOFF, &type)){ hv_err("VIDIOC_STREAMOFF error! %s\n",strerror(errno)); goto quit; } cap->status = OFF; cap->cmd = COMMAND_UNUSED; capture_quit(capture); pthread_mutex_unlock(mutex); return 2; } if(cap->status == OFF) { pthread_mutex_unlock(mutex); return 0; } FD_ZERO(&fds); FD_SET(videofh, &fds); tv.tv_sec = 2; tv.tv_usec = 0; pthread_mutex_unlock(mutex); ret = select(videofh + 1, &fds, NULL, NULL, &tv); pthread_mutex_lock(mutex); //hv_dbg("select video ret: %d\n",ret); if (ret == -1) { if (errno == EINTR) { return 0; } hv_err("select error\n"); goto stream_off; } else if (ret == 0) { hv_err("select timeout\n"); pthread_mutex_unlock(mutex); return 0; } memset(&buf, 0, sizeof(struct v4l2_buffer)); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_MMAP; ret = ioctl(videofh, VIDIOC_DQBUF, &buf); if (ret == -1) { hv_err("VIDIOC_DQBUF failed!\n"); goto stream_off; } float framerate; framerate = get_framerate((long long)(buf.timestamp.tv_sec),(long long)(buf.timestamp.tv_usec)); if(framerate > 1.0){ cap->cap_fps = framerate; //hv_dbg("framerate: %0.2ffps\n",cap->cap_fps); } //sync capture info perp x second #define M_SECOND 200 if(is_x_msec(M_SECOND,(long long)(buf.timestamp.tv_sec),(long long)(buf.timestamp.tv_usec))){ getExifInfo(&(cap->frame.exif)); set_cap_info((void*)cap); 修改为: // set_cap_info((void*)cap); } if(cap->cmd == STOP_SAVE_FRAME && cap->save_status == ON) cap->save_status = OFF; //save frame , the frame will be get by PC Tool to preview on PC screen //frame format: /dev/frame_x (x:0~21) if(cap->cmd == SAVE_FRAME || cap->save_status == ON ) { if(cap->cmd == SAVE_FRAME){ cap->save_status = ON; cap->cmd = COMMAND_UNUSED; } ret = do_save_frame(capture,buf.index); } //take yuv image,it will save the target frame exif info in the same time //image name: xxxx (set by usered through command) //exif info name: xxxx.exif if(cap->cmd == SAVE_IMAGE ) { ret = 0;//getExifInfo(&(cap->picture.exif)); //get target frame exif info successfully then save the target image //if get the exif info fail,it will try next frame if(ret == 0){ buffers[buf.index].phy_addr = buf.m.offset - 0x20000000; hv_dbg("index: %d buffers[buf.index].start = %p\n",buf.index,buffers[buf.index].start); //do_save_image(capture,buf.index); do_save_sub_image(capture,buf.index); cap->cmd = COMMAND_UNUSED; } } //get display addr int w,h; unsigned int addr; get_disp_addr(capture, buf.m.offset,&addr,&w,&h); // set disp buffer if (set_disp_addr){ set_disp_addr(w,h,&addr); } ret = ioctl(videofh, VIDIOC_QBUF, &buf); if (ret == -1) { hv_err("VIDIOC_DQBUF failed!\n"); goto stream_off; } pthread_mutex_unlock(mutex); return 0; stream_off: hv_err("err stream off\n"); ioctl(videofh, VIDIOC_STREAMOFF, &type); quit: capture_quit(capture); pthread_mutex_unlock(mutex); return -1; } R:\wyb\thl_r16_tinav2.0_hm1375\package\allwinner\cameratest\src\common\video_helper.c int set_cap_info(void* capture) { char info[500]; char exif[500]; char file_path[20]; capture_handle* cap = (capture_handle*)capture; memset(info,0,sizeof(info)); strcpy(file_path,"dev/info"); 修改为: //strcpy(file_path, "dev/info"); sprintf(file_path, "%s/%s.info", PATH, cap->picture.path_name); //sync string: sensor_type:save_status:framrate:capture_w:capture_h,sub_w,sub_h# sprintf(info, \ "sensor_type = %s\n" \ "status = %d\n" \ "framerate = %0.2f\n" \ "subchanel_width = %d\n" \ "subchanel_height = %d\n" \ "rotation = %d\n\n", \ (cap->sensor_type == 1)?"raw":"yuv", \ cap->save_status, \ cap->cap_fps, \ cap->sub_w, \ cap->sub_h, \ cap->sub_rot); make_exif_info(exif,"none",&(cap->frame.exif),cap->cap_w,cap->cap_h); strcat(info,exif); //hv_dbg("info str:\n%s\n",info); return write_file(file_path,info,sizeof(info)); } int do_save_sub_image(void* capture,int buf_index) { int ret; char image_name[30]; capture_handle* cap = (capture_handle*)capture; memset(image_name,0,sizeof(image_name)); sprintf(image_name,"%s/%s", PATH,cap->picture.path_name); hv_dbg("image_name: %s\n",image_name); (建议增加这里) set_cap_info(capture); set_exif_info(capture); hv_dbg("--------set_exif_info end\n"); void* vir_sub_start = NULL; unsigned int phy_sub_start = 0; int w,h; if(cap->sensor_type == V4L2_SENSOR_TYPE_RAW){ vir_sub_start = (unsigned int)(buffers[buf_index].start) + ALIGN_4K(ALIGN_16B(cap->cap_w) * cap->cap_h * 3 >> 1); phy_sub_start = buffers[buf_index].phy_addr + ALIGN_4K(ALIGN_16B(cap->cap_w) * cap->cap_h * 3 >> 1); w = cap->sub_w; h = cap->sub_h; } else { vir_sub_start = buffers[buf_index].start; phy_sub_start = buffers[buf_index].phy_addr; w = cap->cap_w; h = cap->cap_h; } #ifdef ANDROID_ENV ret = save_jpeg_frame(image_name,phy_sub_start,w,h); //sprintf(image_name,"/data/camera/yuv%s", cap->picture.path_name); //ret = save_jpeg_frame_by_viraddr(image_name,(void*)vir_sub_start,cap->sub_w,cap->sub_h); #else sprintf(image_name,"%s/yuv%s", PATH,cap->picture.path_name); ret = save_frame_to_file(image_name, \ (void*)(vir_sub_start), \ w,h,cap->cap_fmt, \ 1); #endif if(ret == -1) hv_err("save image failed!\n"); return 0; } 5、可选增加fpscamera: R:\wyb\thl_r16_tinav2.0_hm1375\package\allwinner\fpscamera 6、 define KernelPackage/sunxi-vfe SUBMENU:=$(VIDEO_MENU) TITLE:=sunxi-vfe support FILES:=$(LINUX_DIR)/drivers/media/video/videobuf-core.ko FILES+=$(LINUX_DIR)/drivers/media/video/videobuf-dma-contig.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/csi_cci/cci.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_os.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_subdev.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/device/gc0308.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_v4l2.ko AUTOLOAD:=$(call AutoLoad,90,videobuf-core videobuf-dma-contig cci vfe_os vfe_subdev gc0308 vfe_v4l2) endef 修改为: define KernelPackage/sunxi-vfe SUBMENU:=$(VIDEO_MENU) TITLE:=sunxi-vfe support FILES:=$(LINUX_DIR)/drivers/media/video/videobuf-core.ko FILES+=$(LINUX_DIR)/drivers/media/video/videobuf-dma-contig.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/csi_cci/cci.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_os.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_subdev.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/device/hm1375.ko FILES+=$(LINUX_DIR)/drivers/media/video/sunxi-vfe/vfe_v4l2.ko AUTOLOAD:=$(call AutoLoad,90,videobuf-core videobuf-dma-contig cci vfe_os vfe_subdev hm1375 vfe_v4l2) endef 7、 R:\wyb\thl_r16_tinav2.0_hm1375\target\allwinner\astar-parrot\configs\sys_config.fex ;---------------------------------------------------------------------------------- ;dcdc1_vol ---set dcdc1 voltage,mV,1600-3400,100mV/step ;dcdc2_vol ---set dcdc2 voltage,mV,600-1540,20mV/step ;dcdc3_vol ---set dcdc3 voltage,mV,600-1860,20mV/step ;dcdc4_vol ---set dcdc4 voltage,mV,600-1540,20mV/step ;dcdc5_vol ---set dcdc5 voltage,mV,1000-2550,50mV/step ;aldo2_vol ---set aldo2 voltage,mV,700-3300,100mV/step ;aldo3_vol ---set aldo3 voltage,mV,700-3300,100mV/step ;---------------------------------------------------------------------------------- [power_sply] dcdc1_vol = 3000 dcdc2_vol = 1100 dcdc3_vol = 1200 dcdc4_vol = 0 dcdc5_vol = 1500 aldo2_vol = 2500 aldo3_vol = 3000 dldo3_vol = 2800 ;gpio0_vol = 2800 ldoio0_vol = 2800 [twi2] twi_used = 1 twi_scl = port:PE12<3><default><default><default> twi_sda = port:PE13<3><default><default><default> ;-------------------------------------------------------------------------------- ;vip (video input port) configuration ;vip_used: 0:disable 1:enable ;vip_mode: 0:sample one interface to one buffer 1:sample two interface to one buffer ;vip_dev_qty: The quantity of devices linked to capture bus ; ;vip_define_sensor_list: If you want use sensor detect function, please set vip_define_sensor_list = 1, and ; verify that file /system/etc/hawkview/sensor_list_cfg.ini is properly configured! ; ;vip_dev(x)_pos: sensor position, "rear" or "front", if vip_define_sensor_list = 1,vip_dev(x)_pos must be configured! ; ;vip_dev(x)_isp_used 0:not use isp 1:use isp ;vip_dev(x)_fmt: 0:yuv 1:bayer raw rgb ;vip_dev(x)_stby_mode: 0:not shut down power at standby 1:shut down power at standby ;vip_dev(x)_vflip: flip in vertical direction 0:disable 1:enable ;vip_dev(x)_hflip: flip in horizontal direction 0:disable 1:enable ;vip_dev(x)_iovdd: camera module io power handle string, pmu power supply ;vip_dev(x)_iovdd_vol: camera module io power voltage, pmu power supply ;vip_dev(x)_avdd: camera module analog power handle string, pmu power supply ;vip_dev(x)_avdd_vol: camera module analog power voltage, pmu power supply ;vip_dev(x)_dvdd: camera module core power handle string, pmu power supply ;vip_dev(x)_dvdd_vol: camera module core power voltage, pmu power supply ;vip_dev(x)_afvdd: camera module vcm power handle string, pmu power supply ;vip_dev(x)_afvdd_vol: camera module vcm power voltage, pmu power supply ;x indicates the index of the devices which are linked to the same capture bus ;fill voltage in uV, e.g. iovdd = 2.8V, vip_devx_iovdd_vol = 2800000 ;fill handle string as below: ;axp22_eldo3 ;axp22_dldo4 ;axp22_eldo2 ;fill handle string "" when not using any pmu power supply ;-------------------------------------------------------------------------------- [csi0] vip_used = 1 vip_mode = 0 vip_dev_qty = 1 vip_define_sensor_list = 0 vip_csi_pck = port:PE00<2><default><default><default> vip_csi_mck = port:PE01<2><default><default><default> vip_csi_hsync = port:PE02<2><default><default><default> vip_csi_vsync = port:PE03<2><default><default><default> vip_csi_d0 = port:PE04<2><default><default><default> vip_csi_d1 = port:PE05<2><default><default><default> vip_csi_d2 = port:PE06<2><default><default><default> vip_csi_d3 = port:PE07<2><default><default><default> vip_csi_d4 = port:PE08<2><default><default><default> vip_csi_d5 = port:PE09<2><default><default><default> vip_csi_d6 = port:PE10<2><default><default><default> vip_csi_d7 = port:PE11<2><default><default><default> ;vip_csi_sck = port:PE12<2><default><default><default> ;vip_csi_sda = port:PE13<2><default><default><default> vip_dev0_mname = "hm1375" vip_dev0_pos = "rear" vip_dev0_lane = 1 vip_dev0_twi_id = 2 vip_dev0_twi_addr = 0x48 vip_dev0_isp_used = 0 vip_dev0_fmt = 0 (调试的时候推荐选0,给摄像头时钟供电,方便测量电压:) vip_dev0_stby_mode = 0 vip_dev0_vflip = 0 vip_dev0_hflip = 0 vip_dev0_iovdd = "" vip_dev0_iovdd_vol = 2800000 vip_dev0_avdd = "axp22_ldoio0" vip_dev0_avdd_vol = 2800000 vip_dev0_dvdd = "" vip_dev0_dvdd_vol = 1800000 vip_dev0_afvdd = "" vip_dev0_afvdd_vol = 2800000 vip_dev0_power_en = vip_dev0_reset = port:PE14<1><default><default><0> vip_dev0_pwdn = port:PE15<1><default><default><1> vip_dev0_flash_en = vip_dev0_flash_mode = vip_dev0_af_pwdn = 8、可选: rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ make menuconfig 内核的修改保存在这里: R:\wyb\thl_r16_tinav2.0_hm1375\target\allwinner\astar-parrot\config-3.4 rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ make menuconfig 系统的修改保存在这里: R:\wyb\thl_r16_tinav2.0_hm1375\target\allwinner\astar-parrot\defconfig 9、为了调试方便,可选修改: R:\wyb\thl_r16_tinav2.0_hm1375\target\allwinner\generic\configs\env.cfg bootdelay=3 #default bootcmd, will change at runtime according to key press bootcmd=run setargs_nand boot_normal#default nand boot #kernel command arguments console=ttyS0,115200 nor_root=/dev/mtdblock4 nand_root=/dev/nandd mmc_root=/dev/mmcblk0p7 init=/sbin/init loglevel=8 #set kernel cmdline if boot.img or recovery.img has no cmdline we will use this setargs_nor=setenv bootargs console=${console} root=${nor_root} rootwait init=${init} ion_cma_list="8m,32m,64m,128m,256m"loglevel=${loglevel} partitions=${partitions} setargs_nand=setenv bootargs console=${console} root=${nand_root} rootwait init=${init} ion_cma_list="8m,32m,64m,128m,256m" loglevel=${loglevel} partitions=${partitions} setargs_mmc=setenv bootargs console=${console} root=${mmc_root} rootwait init=${init} ion_cma_list="8m,32m,64m,128m,256m" loglevel=${loglevel} partitions=${partitions} #nand command syntax: sunxi_flash read address partition_name read_bytes #0x40007800 = 0x40008000(kernel entry) - 0x800(boot.img header 2k) boot_normal=fatload sunxi_flash boot 43800000 uImage;bootm 43800000 boot_recovery=fatload sunxi_flash extend 43800000 uImage;bootm 43800000 boot_fastboot=fastboot #recovery key recovery_key_value_max=0x13 recovery_key_value_min=0x10 #fastboot key fastboot_key_value_max=0x8 fastboot_key_value_min=0x2 10、先编译一遍tianv2.0的系统,然后增加sunxi-vfe support支持: rootroot@rootroot-E400:~$ cd wyb/thl_r16_tinav2.0_hm1375/ rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ 7za x thl_r16_tinav2.0_hm1375等待最终验证_20170824_1141.7z -r -o./ rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ source build/envsetup.sh including target/allwinner/octopus-dev/vendorsetup.sh including target/allwinner/astar-parrot/vendorsetup.sh including target/allwinner/astar-evb/vendorsetup.sh including target/allwinner/generic/vendorsetup.sh including target/allwinner/tulip-d1/vendorsetup.sh including target/allwinner/astar-spk/vendorsetup.sh rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ lunch You're building on Linux Lunch menu... pick a combo: 1. octopus_dev-tina 2. octopus_dev-dragonboard 3. astar_parrot-tina 4. astar_parrot-dragonboard 5. astar_evb-tina 6. tulip_d1-tina 7. tulip_d1-dragonboard 8. astar_spk-tina 9. astar_spk-dragonboard Which would you like?3 ============================================ PLATFORM_VERSION_CODENAME=Neptune PLATFORM_VERSION=2.0.0 TARGET_PRODUCT=astar_parrot TARGET_BUILD_VARIANT=tina TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a-neon TARGET_CPU_VARIANT=cortex-a7 TARGET_2ND_ARCH= TARGET_2ND_ARCH_VARIANT= TARGET_2ND_CPU_VARIANT= HOST_ARCH=x86_64 HOST_OS=linux HOST_OS_EXTRA=Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty HOST_BUILD_TYPE=release BUILD_ID=57513AA3 OUT_DIR= ============================================ rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ make -j8 rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ pack -d rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ make menuconfig Allwinner ---> < > fpscamera................................. fpscamera just test the camera 修改为: <*> fpscamera................................. fpscamera just test the camera Kernel modules ---> Video Support ---> < > kmod-sunxi-vfe......................................... sunxi-vfe support 修改为: <*> kmod-sunxi-vfe......................................... sunxi-vfe support rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ make -j12 rootroot@rootroot-E400:~/wyb/thl_r16_tinav2.0_hm1375$ pack -d 11、加载hm1375的驱动的时候查看I2C是否是通的: R:\wyb\thl_r16_tinav2.0_hm1375\lichee\linux-3.4\drivers\media\video\sunxi-vfe\device\hm1375.c static int sensor_detect(struct v4l2_subdev *sd) { int ret; unsigned char rdval; printk("****wyb %s:%d/%s()! verify HM1375\n", __FILE__, __LINE__, __func__); LOG_ERR_RET(sensor_read(sd, 0x0001, &rdval)) ret = sensor_read(sd, 0x0001,&rdval); printk("****wyb %s:%d/%s()! reg:0x0001=value:0xx right=0x03/0x13\n", __FILE__, __LINE__, __func__, rdval); if (ret < 0) { vfe_dev_err("sensor_read err at sensor_detect!\n"); return ret; } if((rdval != 0x03) && (rdval != 0x13)) { vfe_dev_err("read high val: %d\n", rdval); return -ENODEV; } LOG_ERR_RET(sensor_read(sd, 0x0002, &rdval)) printk("****wyb %s:%d/%s()! reg:0x0002=value:0xx right=0x75\n", __FILE__, __LINE__, __func__, rdval); if(rdval != 0x75) { vfe_dev_err("read low val: %d\n", rdval); return -ENODEV; } printk("HM1375 sensor_detect OK\r\n"); return 0; } (奇怪的时候HM1375的0x0001号寄存器,第一次读是0x03,以后都是0x13,好神奇!) [ 16.030894] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2891/sensor_detect()! verify HM1375 [ 16.042100] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2895/sensor_detect()! reg:0x0001=value:0x03 right=0x03/0x13 [ 16.055259] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2909/sensor_detect()! reg:0x0002=value:0x75 right=0x75 [ 16.067560] HM1375 sensor_detect OK [ 47.398156] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2891/sensor_detect()! verify HM1375 [ 47.409351] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2895/sensor_detect()! reg:0x0001=value:0x13 right=0x03/0x13 [ 47.422492] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2909/sensor_detect()! reg:0x0002=value:0x75 right=0x75 [ 47.434769] HM1375 sensor_detect OK [ 88.217828] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2891/sensor_detect()! verify HM1375 [ 88.228920] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2895/sensor_detect()! reg:0x0001=value:0x13 right=0x03/0x13 [ 88.242056] ****wyb drivers/media/video/sunxi-vfe/device/hm1375.c:2909/sensor_detect()! reg:0x0002=value:0x75 right=0x75 [ 88.254325] HM1375 sensor_detect OK
给全志R58增加一个lunch为cb5801.txt 开发板:全志R58的官方开发板R58_PER3_LPDDR3_32X1_V1_1.pdf 目标:给全志R58增加一个lunch为cb5801 BSP:r58_20160823.tar.gz(2016/8/22从全志的git服务器拿下来的系统) 显示:HDMI输出1080p分辨率的LCD显示器。 编译R18的时候,看lichee和android选择的是不一样的选项。 初步判断:在android中执行extract-bsp的时候,只是去上一级目录中查找lichee编译生成的内核。 先依葫芦画瓢,依照octopus-perf修改一个octopus-cb5801。下文是例子。 wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58$ cd android/device/softwinner/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ ll 总用量 44 drwxrwxr-x 11 wenyuanbo wenyuanbo 4096 8月 22 12:32 ./ drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 12:32 ../ drwxrwxr-x 7 wenyuanbo wenyuanbo 4096 8月 22 12:32 astar-common/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 8月 22 12:32 astar-y3/ drwxrwxr-x 8 wenyuanbo wenyuanbo 4096 8月 22 12:32 common/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 8月 22 12:32 kylin-common/ drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 12:32 kylin-p1/ drwxrwxr-x 12 wenyuanbo wenyuanbo 4096 8月 22 12:32 octopus-common/ drwxrwxr-x 11 wenyuanbo wenyuanbo 4096 8月 22 12:32 octopus-f1/ drwxrwxr-x 11 wenyuanbo wenyuanbo 4096 8月 22 12:32 octopus-n1/ drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 12:32 octopus-perf/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ cp octopus-perf/ octopus-cb5801/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ cd octopus-cb5801/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner/octopus-cb5801$ ll 总用量 12384 drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 9月 6 18:31 ./ drwxrwxr-x 12 wenyuanbo wenyuanbo 4096 9月 6 18:31 ../ -rwxrwxr-x 1 wenyuanbo wenyuanbo 28 9月 6 18:31 AndroidBoard.mk* -rwxrwxr-x 1 wenyuanbo wenyuanbo 53 9月 6 18:31 AndroidProducts.mk* drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 9月 6 18:31 bluetooth/ -rwxrwxr-x 1 wenyuanbo wenyuanbo 1835 9月 6 18:31 BoardConfig.mk* drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 9月 6 18:31 configs/ -rwxrwxr-x 1 wenyuanbo wenyuanbo 2175 9月 6 18:31 fstab.sun8i* drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 9月 6 18:31 .git/ -rwxrwxr-x 1 wenyuanbo wenyuanbo 15 9月 6 18:31 .gitignore* drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 9月 6 18:31 hawkview/ -rwxrwxr-x 1 wenyuanbo wenyuanbo 12582912 9月 6 18:31 initlogo.rle* -rwxrwxr-x 1 wenyuanbo wenyuanbo 293 9月 6 18:31 init.recovery.sun8i.rc* -rwxrwxr-x 1 wenyuanbo wenyuanbo 5149 9月 6 18:31 init.sun8i.rc* drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 9月 6 18:31 media/ -rwxrwxr-x 1 wenyuanbo wenyuanbo 6039 9月 6 18:31 octopus_perf.mk* drwxrwxr-x 3 wenyuanbo wenyuanbo 4096 9月 6 18:31 overlay/ -rwxrwxr-x 1 wenyuanbo wenyuanbo 692 9月 6 18:31 package.sh* drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 9月 6 18:31 recovery/ -rwxrwxr-x 1 wenyuanbo wenyuanbo 727 9月 6 18:31 recovery.fstab* drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 9月 6 18:31 tp/ -rwxrwxr-x 1 wenyuanbo wenyuanbo 1373 9月 6 18:31 ueventd.sun8i.rc* -rwxrwxr-x 1 wenyuanbo wenyuanbo 875 9月 6 18:31 vendorsetup.sh* wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner/octopus-cb5801$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner/octopus-cb5801$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner/octopus-cb5801$ grep perf . -R 匹配到二进制文件 ./.git/index grep: ./.git/svn: 没有那个文件或目录 ./.git/config: url = ssh://[email protected]/git_repo/R58/device/softwinner/octopus-perf.git ./.git/config: projectname = device/softwinner/octopus-perf 对于git文件,直接删除。 wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner/octopus-cb5801$ rm .git -rf ./package.sh:board=perf3_v1_0 看文件名,应该是在打包IMG文件时候的板文件的选择。 ./BoardConfig.mk:TARGET_RECOVERY_UI_LIB := librecovery_ui_octopus_perf ./BoardConfig.mk:BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/softwinner/octopus-perf/bluetooth/ 直接用cb5801搜索替换perf即可。 ./recovery/Android.mk:ifneq (,$(findstring $(TARGET_DEVICE),octopus-perf)) ./recovery/Android.mk:LOCAL_MODULE := librecovery_ui_octopus_perf ./recovery/Android.mk:LOCAL_MODULE := librecovery_updater_octopus_perf 直接用cb5801搜索替换perf即可。 ./AndroidProducts.mk: $(LOCAL_DIR)/octopus_perf.mk 直接用cb5801搜索替换perf即可。 ./octopus_perf.mk: device/softwinner/octopus-perf/overlay \ ./octopus_perf.mk:# Abandon useless system app. Add which module name in apk/Android.mk octopus_perf_app section. ./octopus_perf.mk: octopus_perf_app ./octopus_perf.mk:# device/softwinner/octopus-perf/tp/GT927_1040_9CD8.BIN:/system/vendor/firmware/GT927_1040_9CD8.BIN ./octopus_perf.mk: device/softwinner/octopus-perf/recovery.fstab:recovery.fstab \ ./octopus_perf.mk: device/softwinner/octopus-perf/modules/modules/sunxi_tr.ko:obj/sunxi_tr.ko \ ./octopus_perf.mk: device/softwinner/octopus-perf/modules/modules/disp.ko:obj/disp.ko \ ./octopus_perf.mk:# device/softwinner/octopus-perf/modules/modules/hdcp.ko:obj/hdcp.ko \ ./octopus_perf.mk: device/softwinner/octopus-perf/modules/modules/sw-device.ko:obj/sw-device.ko ./octopus_perf.mk: device/softwinner/octopus-perf/kernel:kernel \ ./octopus_perf.mk: device/softwinner/octopus-perf/fstab.sun8i:root/fstab.sun8i \ ./octopus_perf.mk: device/softwinner/octopus-perf/init.sun8i.rc:root/init.sun8i.rc \ ./octopus_perf.mk: device/softwinner/octopus-perf/init.recovery.sun8i.rc:root/init.recovery.sun8i.rc \ ./octopus_perf.mk: device/softwinner/octopus-perf/ueventd.sun8i.rc:root/ueventd.sun8i.rc \ ./octopus_perf.mk: device/softwinner/octopus-perf/modules/modules/nand.ko:root/nand.ko ./octopus_perf.mk: device/softwinner/octopus-perf/configs/tablet_core_hardware.xml:system/etc/permissions/tablet_core_hardware.xml ./octopus_perf.mk: device/softwinner/octopus-perf/configs/camera.cfg:system/etc/camera.cfg \ ./octopus_perf.mk: device/softwinner/octopus-perf/configs/gsensor.cfg:system/usr/gsensor.cfg \ ./octopus_perf.mk: device/softwinner/octopus-perf/configs/media_profiles.xml:system/etc/media_profiles.xml \ ./octopus_perf.mk: device/softwinner/octopus-perf/configs/sunxi-keyboard.kl:system/usr/keylayout/sunxi-keyboard.kl \ ./octopus_perf.mk: device/softwinner/octopus-perf/configs/sunxi-ir.kl:system/usr/keylayout/sunxi-ir.kl \ ./octopus_perf.mk: device/softwinner/octopus-perf/configs/tp.idc:system/usr/idc/tp.idc ./octopus_perf.mk:#device/softwinner/octopus-perf/media/initlogo.bmp:system/media/initlogo.bmp ./octopus_perf.mk: device/softwinner/octopus-perf/initlogo.rle:root/initlogo.rle \ ./octopus_perf.mk: device/softwinner/octopus-perf/media/boot.wav:system/media/boot.wav \ ./octopus_perf.mk: device/softwinner/octopus-perf/media/bootlogo.bmp:system/media/bootlogo.bmp \ ./octopus_perf.mk: device/softwinner/octopus-perf/media/bootanimation.zip:system/media/bootanimation.zip ./octopus_perf.mk:$(call inherit-product-if-exists, device/softwinner/octopus-perf/modules/modules.mk) ./octopus_perf.mk:PRODUCT_NAME := octopus_perf ./octopus_perf.mk:PRODUCT_DEVICE := octopus-perf ./octopus_perf.mk:PRODUCT_MODEL := UltraOcta A83 perf 将octopus_perf.mk另存为:octopus_cb5801.mk,直接用cb5801搜索替换perf即可。 ./configs/media_profiles.xml: not perform any checks at all. 不用修改 ./vendorsetup.sh:add_lunch_combo octopus_perf-eng ./vendorsetup.sh:add_lunch_combo octopus_perf-user 直接用cb5801搜索替换perf即可。 ./bluetooth/bdroid_buildcfg.h:#define BTM_DEF_LOCAL_NAME "octopus-perf" 直接用cb5801搜索替换perf即可。 删除其他lunch: wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner/octopus-cb5801$ cd .. wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ ll 总用量 48 drwxrwxr-x 12 wenyuanbo wenyuanbo 4096 9月 6 18:31 ./ drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 12:32 ../ drwxrwxr-x 7 wenyuanbo wenyuanbo 4096 8月 22 12:32 astar-common/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 8月 22 12:32 astar-y3/ drwxrwxr-x 8 wenyuanbo wenyuanbo 4096 8月 22 12:32 common/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 8月 22 12:32 kylin-common/ drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 12:32 kylin-p1/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 9月 6 18:48 octopus-cb5801/ drwxrwxr-x 12 wenyuanbo wenyuanbo 4096 8月 22 12:32 octopus-common/ drwxrwxr-x 11 wenyuanbo wenyuanbo 4096 8月 22 12:32 octopus-f1/ drwxrwxr-x 11 wenyuanbo wenyuanbo 4096 8月 22 12:32 octopus-n1/ drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 12:32 octopus-perf/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ rm octopus-f1/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ rm octopus-n1/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ rm octopus-perf/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ ll 总用量 36 drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 9月 6 18:50 ./ drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 12:32 ../ drwxrwxr-x 7 wenyuanbo wenyuanbo 4096 8月 22 12:32 astar-common/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 8月 22 12:32 astar-y3/ drwxrwxr-x 8 wenyuanbo wenyuanbo 4096 8月 22 12:32 common/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 8月 22 12:32 kylin-common/ drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 12:32 kylin-p1/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 9月 6 18:48 octopus-cb5801/ drwxrwxr-x 12 wenyuanbo wenyuanbo 4096 8月 22 12:32 octopus-common/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ ll 总用量 36 drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 9月 6 18:50 ./ drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 12:32 ../ drwxrwxr-x 7 wenyuanbo wenyuanbo 4096 8月 22 12:32 astar-common/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 8月 22 12:32 astar-y3/ drwxrwxr-x 8 wenyuanbo wenyuanbo 4096 8月 22 12:32 common/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 8月 22 12:32 kylin-common/ drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 12:32 kylin-p1/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 9月 6 18:48 octopus-cb5801/ drwxrwxr-x 12 wenyuanbo wenyuanbo 4096 8月 22 12:32 octopus-common/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android/device/softwinner$ cd ../../.. wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58$ ll 总用量 16 drwxrwxr-x 4 wenyuanbo wenyuanbo 4096 8月 22 14:35 ./ drwxrwxrwx 9 root root 4096 9月 6 18:00 ../ drwxrwxr-x 26 wenyuanbo wenyuanbo 4096 8月 22 12:35 android/ drwxrwxr-x 7 wenyuanbo wenyuanbo 4096 8月 22 14:13 lichee/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58$ cd lichee/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun50iw1p1 1. sun8iw1p1 2. sun8iw3p1 3. sun8iw5p1 4. sun8iw6p1 5. sun8iw7p1 6. sun8iw8p1 7. sun8iw9p1 8. sun9iw1p1 Choice: 4 All available platforms: 0. android 1. dragonboard 2. linux 3. camdroid Choice: 0 All available kernel: 0. linux-3.4 Choice: 0 All available boards: 0. f1 1. fpga 2. n1 3. perf1_v1_0 4. perf2_v1_0 5. perf3_v1_0 6. qc Choice: 5 wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee$ ./build.sh wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee$ cd ../android/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ source build/envsetup.sh including device/softwinner/kylin-p1/vendorsetup.sh including device/softwinner/common/vendorsetup.sh including device/softwinner/astar-y3/vendorsetup.sh including device/softwinner/octopus-cb5801/vendorsetup.sh including device/lge/mako/vendorsetup.sh including device/lge/hammerhead/vendorsetup.sh including device/samsung/manta/vendorsetup.sh including device/generic/x86/vendorsetup.sh including device/generic/mips/vendorsetup.sh including device/generic/armv7-a-neon/vendorsetup.sh including device/asus/tilapia/vendorsetup.sh including device/asus/deb/vendorsetup.sh including device/asus/grouper/vendorsetup.sh including device/asus/flo/vendorsetup.sh including sdk/bash_completion/adb.bash wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ lunch You're building on Linux Lunch menu... pick a combo: 1. aosp_arm-eng 2. aosp_x86-eng 3. aosp_mips-eng 4. vbox_x86-eng 5. kylin_p1-eng 6. kylin_p1-user 7. astar_y3-eng 8. astar_y3-user 9. octopus_cb5801-eng 10. octopus_cb5801-user 11. aosp_mako-userdebug 12. aosp_hammerhead-userdebug 13. aosp_manta-userdebug 14. mini_x86-userdebug 15. mini_mips-userdebug 16. mini_armv7a_neon-userdebug 17. aosp_tilapia-userdebug 18. aosp_deb-userdebug 19. aosp_grouper-userdebug 20. aosp_flo-userdebug Which would you like? [aosp_arm-eng] 9 ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=4.4.4 TARGET_PRODUCT=octopus_cb5801 TARGET_BUILD_VARIANT=eng TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a-neon TARGET_CPU_VARIANT=cortex-a7 HOST_ARCH=x86 HOST_OS=linux HOST_OS_EXTRA=Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty HOST_BUILD_TYPE=release BUILD_ID=KTU84Q OUT_DIR=out ============================================ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ extract-bsp /home/wwt/lunch_cb5801_r58/android/device/softwinner/octopus-cb5801/bImage copied! /home/wwt/lunch_cb5801_r58/android/device/softwinner/octopus-cb5801/modules copied! wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ make -j12 wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ pack copying tools file copying configs file ./out/aultls32.fex ./out/aultools.fex ./out/cardscript.fex ./out/cardtool.fex ./out/diskfs.fex ./out/env_burn.cfg ./out/env.cfg ./out/image.cfg ./out/image_linux.cfg ./out/split_xxxx.fex ./out/sys_config.fex ./out/sys_partition_dragonboard.fex ./out/sys_partition_dump.fex ./out/sys_partition.fex ./out/sys_partition_linux.fex ./out/sys_partition_private.fex ./out/test_config.fex ./out/toc0.fex ./out/toc1.fex ./out/usbtool.fex ./out/usbtool_test.fex copying boot resource copying boot file packing for android normal /home/wwt/lunch_cb5801_r58/lichee/tools/pack/pctools/linux/eDragonEx/ /home/wwt/lunch_cb5801_r58/lichee/tools/pack/out Begin Parse sys_partion.fex Add partion boot-resource.fex BOOT-RESOURCE_FEX Add partion very boot-resource.fex BOOT-RESOURCE_FEX FilePath: boot-resource.fex FileLength=4fbc00Add partion env.fex ENV_FEX000000000 Add partion very env.fex ENV_FEX000000000 FilePath: env.fex FileLength=20000Add partion boot.fex BOOT_FEX00000000 Add partion very boot.fex BOOT_FEX00000000 FilePath: boot.fex FileLength=afe000Add partion system.fex SYSTEM_FEX000000 Add partion very system.fex SYSTEM_FEX000000 FilePath: system.fex FileLength=24f6eb58Add partion recovery.fex RECOVERY_FEX0000 Add partion very recovery.fex RECOVERY_FEX0000 FilePath: recovery.fex FileLength=d5b800sys_config.fex Len: 0x110ae config.fex Len: 0xcc38 split_xxxx.fex Len: 0x200 sys_partition.fex Len: 0xe45 boot0_nand.fex Len: 0x8000 boot0_sdcard.fex Len: 0x8000 u-boot.fex Len: 0xd4000 toc1.fex Len: 0x8 toc0.fex Len: 0x8 fes1.fex Len: 0x3080 usbtool.fex Len: 0x23000 aultools.fex Len: 0x26ead aultls32.fex Len: 0x238dd cardtool.fex Len: 0x14000 cardscript.fex Len: 0x6ea sunxi_mbr.fex Len: 0x10000 dlinfo.fex Len: 0x4000 arisc.fex Len: 0x367a9 boot-resource.fex Len: 0x4fbc00 Vboot-resource.fex Len: 0x4 env.fex Len: 0x20000 Venv.fex Len: 0x4 boot.fex Len: 0xafe000 Vboot.fex Len: 0x4 system.fex Len: 0x24f6eb58 Vsystem.fex Len: 0x4 recovery.fex Len: 0xd5b800 Vrecovery.fex Len: 0x4 BuildImg 0 Dragon execute image.cfg SUCCESS ! ----------image is at---------- /home/wwt/lunch_cb5801_r58/lichee/tools/pack/sun8iw6p1_android_perf3_v1_0_uart0.img pack finish wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ 刷机之后,可以看见cb5801了。 shell@octopus-cb5801:/ $ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ cd ../lichee/linux-3.4/tools/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/linux-3.4/tools$ ll 总用量 52 drwxrwxr-x 13 wenyuanbo wenyuanbo 4096 8月 22 14:13 ./ drwxrwxr-x 28 wenyuanbo wenyuanbo 4096 9月 6 18:55 ../ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 firewire/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 hv/ drwxrwxr-x 3 wenyuanbo wenyuanbo 4096 8月 22 14:13 include/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 lguest/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 nfsd/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 8月 22 14:13 perf/ drwxrwxr-x 4 wenyuanbo wenyuanbo 4096 8月 22 14:13 power/ drwxrwxr-x 4 wenyuanbo wenyuanbo 4096 8月 22 14:13 testing/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 usb/ drwxrwxr-x 4 wenyuanbo wenyuanbo 4096 8月 22 14:13 virtio/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 vm/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/linux-3.4/tools$ cd ../ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/linux-3.4$ cd .. wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee$ ll 总用量 44 drwxrwxr-x 8 wenyuanbo wenyuanbo 4096 9月 6 18:51 ./ drwxrwxr-x 4 wenyuanbo wenyuanbo 4096 8月 22 14:35 ../ drwxrwxr-x 11 wenyuanbo wenyuanbo 4096 8月 22 14:13 brandy/ -rw-rw-r-- 1 wenyuanbo wenyuanbo 124 9月 6 18:51 .buildconfig drwxrwxr-x 15 wenyuanbo wenyuanbo 4096 8月 22 14:13 buildroot/ -r-xr-xr-x 1 wenyuanbo wenyuanbo 55 8月 22 14:13 build.sh* drwxrwxr-x 28 wenyuanbo wenyuanbo 4096 9月 6 18:55 linux-3.4/ drwxrwxr-x 3 wenyuanbo wenyuanbo 4096 9月 6 18:51 out/ -r--r--r-- 1 wenyuanbo wenyuanbo 232 8月 22 14:13 README drwxrwxr-x 6 wenyuanbo wenyuanbo 4096 8月 22 14:13 .repo/ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 8月 22 14:13 tools/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee$ cd tools/pack/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack$ ll 总用量 637756 drwxrwxr-x 6 wenyuanbo wenyuanbo 4096 9月 7 08:55 ./ drwxrwxr-x 9 wenyuanbo wenyuanbo 4096 8月 22 14:13 ../ drwxrwxr-x 11 wenyuanbo wenyuanbo 4096 8月 22 14:13 chips/ drwxrwxr-x 7 wenyuanbo wenyuanbo 4096 8月 22 14:13 common/ -rwxrwxr-x 1 wenyuanbo wenyuanbo 1323 8月 22 14:13 createkeys* -rwxrwxr-x 1 wenyuanbo wenyuanbo 11 8月 22 14:13 .gitignore* drwxrwxr-x 3 wenyuanbo wenyuanbo 4096 9月 7 08:55 out/ -rwxrwxr-x 1 wenyuanbo wenyuanbo 15707 8月 22 14:13 pack* -rwxrwxr-x 1 wenyuanbo wenyuanbo 1087 8月 22 14:13 parser.sh* drwxrwxr-x 4 wenyuanbo wenyuanbo 4096 8月 22 14:13 pctools/ -rwxrwxr-x 1 wenyuanbo wenyuanbo 653002752 9月 7 08:55 sun8iw6p1_android_perf3_v1_0_uart0.img* wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack$ cd chips/sun8iw6p1/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1$ ll 总用量 24 drwxrwxr-x 6 wenyuanbo wenyuanbo 4096 8月 22 14:13 ./ drwxrwxr-x 11 wenyuanbo wenyuanbo 4096 8月 22 14:13 ../ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 bin/ drwxrwxr-x 3 wenyuanbo wenyuanbo 4096 8月 22 14:13 boot-resource/ drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 14:13 configs/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 tools/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1$ cd configs/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ ll 总用量 40 drwxrwxr-x 10 wenyuanbo wenyuanbo 4096 8月 22 14:13 ./ drwxrwxr-x 6 wenyuanbo wenyuanbo 4096 8月 22 14:13 ../ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 default/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 f1/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 fpga/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 n1/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 perf1_v1_0/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 perf2_v1_0/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 perf3_v1_0/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 qc/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ cp perf3_v1_0/ cb5801/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ ll 总用量 44 drwxrwxr-x 11 wenyuanbo wenyuanbo 4096 9月 7 09:06 ./ drwxrwxr-x 6 wenyuanbo wenyuanbo 4096 8月 22 14:13 ../ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 9月 7 09:06 cb5801/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 default/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 f1/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 fpga/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 n1/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 perf1_v1_0/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 perf2_v1_0/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 perf3_v1_0/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 qc/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ rm perf1_v1_0/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ rm perf2_v1_0/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ rm perf3_v1_0/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ ll 总用量 32 drwxrwxr-x 8 wenyuanbo wenyuanbo 4096 9月 7 09:06 ./ drwxrwxr-x 6 wenyuanbo wenyuanbo 4096 8月 22 14:13 ../ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 9月 7 09:06 cb5801/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 default/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 f1/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 fpga/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 n1/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 qc/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ rm f1/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ rm fpga/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ rm n1/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ rm qc/ -rf wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ ll 总用量 16 drwxrwxr-x 4 wenyuanbo wenyuanbo 4096 9月 7 09:06 ./ drwxrwxr-x 6 wenyuanbo wenyuanbo 4096 8月 22 14:13 ../ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 9月 7 09:06 cb5801/ drwxrwxr-x 2 wenyuanbo wenyuanbo 4096 8月 22 14:13 default/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ Z:\home\wwt\lunch_cb5801_r58\lichee\tools\pack\chips\sun8iw6p1\configs\cb5801 打包之后出错: wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee/tools/pack/chips/sun8iw6p1/configs$ cd ../../../../../ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/lichee$ cd ../android/ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ pack ERROR: board dir or path do not exist. All avaiable chips, platforms and boards: Chip Board sun8iw6p1 cb5801 default sun8iw9p1 default evb qc fpga sun8iw8p1 ipc v3s-perf v3-perf default CDR fpga sun8iw5p1 y3 y2 default h7 evb qc fpga yh sun8iw7p1 perf dolphin default fpga sun50iw1p1 default fpga sun8iw1p1 aw_w02 default evb qc aw_w01 sun8iw3p1 default w01 evb w02 sun9iw1p1 optimus p1 perf g200 wt097 mb976a9 default perf-lpddr3 p2 perf5 For Usage: pack -h wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ ;A83 PAD application ;--------------------------------------------------------------------------------------------------------- ; 说明: 脚本中的字符串区分大小写,用户可以修改"="后面的数值,但是不要修改前面的字符串 ; 描述gpio的形式:Port:端口+组内序号<功能分配><内部电阻状态><驱动能力><输出电平状态> ;--------------------------------------------------------------------------------------------------------- [product] version = "100" machine = "cb5801" Z:\home\wwt\lunch_cb5801_r58\android\device\softwinner\octopus-cb5801\package.sh #!/bin/bash cd $PACKAGE chip=sun8iw6p1 platform=android board=perf3_v1_0 这里没有修改。 修改之后正常了: wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$ pack copying tools file copying configs file ./out/aultls32.fex ./out/aultools.fex ./out/cardscript.fex ./out/cardtool.fex ./out/diskfs.fex ./out/env_burn.cfg ./out/env.cfg ./out/image.cfg ./out/image_linux.cfg ./out/split_xxxx.fex ./out/sys_config.fex ./out/sys_partition_dragonboard.fex ./out/sys_partition_dump.fex ./out/sys_partition.fex ./out/sys_partition_linux.fex ./out/sys_partition_private.fex ./out/test_config.fex ./out/toc0.fex ./out/toc1.fex ./out/usbtool.fex ./out/usbtool_test.fex copying boot resource copying boot file packing for android normal /home/wwt/lunch_cb5801_r58/lichee/tools/pack/pctools/linux/eDragonEx/ /home/wwt/lunch_cb5801_r58/lichee/tools/pack/out Begin Parse sys_partion.fex Add partion boot-resource.fex BOOT-RESOURCE_FEX Add partion very boot-resource.fex BOOT-RESOURCE_FEX FilePath: boot-resource.fex FileLength=4fbc00Add partion env.fex ENV_FEX000000000 Add partion very env.fex ENV_FEX000000000 FilePath: env.fex FileLength=20000Add partion boot.fex BOOT_FEX00000000 Add partion very boot.fex BOOT_FEX00000000 FilePath: boot.fex FileLength=afe000Add partion system.fex SYSTEM_FEX000000 Add partion very system.fex SYSTEM_FEX000000 FilePath: system.fex FileLength=24f6eb58Add partion recovery.fex RECOVERY_FEX0000 Add partion very recovery.fex RECOVERY_FEX0000 FilePath: recovery.fex FileLength=d5b800sys_config.fex Len: 0x110aa config.fex Len: 0xcc34 split_xxxx.fex Len: 0x200 sys_partition.fex Len: 0xe45 boot0_nand.fex Len: 0x8000 boot0_sdcard.fex Len: 0x8000 u-boot.fex Len: 0xd4000 toc1.fex Len: 0x8 toc0.fex Len: 0x8 fes1.fex Len: 0x3080 usbtool.fex Len: 0x23000 aultools.fex Len: 0x26ead aultls32.fex Len: 0x238dd cardtool.fex Len: 0x14000 cardscript.fex Len: 0x6ea sunxi_mbr.fex Len: 0x10000 dlinfo.fex Len: 0x4000 arisc.fex Len: 0x367a9 boot-resource.fex Len: 0x4fbc00 Vboot-resource.fex Len: 0x4 env.fex Len: 0x20000 Venv.fex Len: 0x4 boot.fex Len: 0xafe000 Vboot.fex Len: 0x4 system.fex Len: 0x24f6eb58 Vsystem.fex Len: 0x4 recovery.fex Len: 0xd5b800 Vrecovery.fex Len: 0x4 BuildImg 0 Dragon execute image.cfg SUCCESS ! ----------image is at---------- /home/wwt/lunch_cb5801_r58/lichee/tools/pack/sun8iw6p1_android_cb5801_uart0.img pack finish wenyuanbo@cm-System-Product-Name:/home/wwt/lunch_cb5801_r58/android$
pcf8563_i2c1_r8_ruoge_ov2640通过给RTC驱动增加设备节点读取秒钟成功+直接读取I2C1获取秒钟值20160626_2201.7z http://blog.csdn.net/21cnbao/article/details/7919055 在Android源码树中添加userspace I2C读写工具(i2c-util) 本文使用的开发板是:杭州若格科技有限公司的全志R8。CPU:CPUARM Cortex-A8 更多芯片资料请参见全志官网: http://www.allwinnertech.com/clq/r/R8.html 通过/dev/i2c-n节点,用户可以在userspace直接访问板上的i2c外设寄存器,主要是透过I2C_RDWR这个IO控制命令将i2c_msg数组传递给kernel去执行。 开发板的/dev/i2c-1总线下挂有一片I2C的RTC:pcf8563。 root@android:/dev # cd /sys/class/i2c-adapter/ root@android:/sys/class/i2c-adapter # ll lrwxrwxrwx root root 1970-01-02 08:31 i2c-0 -> ../../devices/platform/sun5i-i2c.0/i2c-0 lrwxrwxrwx root root 1970-01-02 08:31 i2c-1 -> ../../devices/platform/sun5i-i2c.1/i2c-1 lrwxrwxrwx root root 1970-01-02 08:31 i2c-2 -> ../../devices/platform/sun5i-i2c.2/i2c-2 root@android:/sys/class/i2c-adapter # cd i2c-1 root@android:/sys/class/i2c-adapter/i2c-1 # ll drwxr-xr-x root root 1970-01-02 08:31 1-0051 --w------- root root 4096 1970-01-02 08:31 delete_device lrwxrwxrwx root root 1970-01-02 08:31 device -> ../../sun5i-i2c.1 drwxr-xr-x root root 1970-01-01 08:00 i2c-dev -r--r--r-- root root 4096 1970-01-02 08:31 name --w------- root root 4096 1970-01-02 08:31 new_device drwxr-xr-x root root 1970-01-01 08:00 power lrwxrwxrwx root root 1970-01-02 08:31 subsystem -> ../../../../bus/i2c -rw-r--r-- root root 4096 1970-01-01 08:00 uevent root@android:/sys/class/i2c-adapter/i2c-1 # root@android:/sys/class/i2c-adapter/i2c-1 # cd 1-0051/ root@android:/sys/class/i2c-adapter/i2c-1/1-0051 # ll lrwxrwxrwx root root 1970-01-02 10:18 driver -> ../../../../../bus/i2c/drivers/pcf8563 -r--r--r-- root root 4096 1970-01-02 10:18 modalias -r--r--r-- root root 4096 1970-01-02 10:18 name drwxr-xr-x root root 1970-01-02 10:18 power drwxr-xr-x root root 1970-01-02 10:18 rtc lrwxrwxrwx root root 1970-01-02 10:18 subsystem -> ../../../../../bus/i2c -rw-r--r-- root root 4096 1970-01-02 10:18 uevent root@android:/sys/class/i2c-adapter/i2c-1/1-0051 # cat name pcf8563 root@android:/sys/class/i2c-adapter/i2c-1/1-0051 # 注释:1-0051 1 表示 i2c-1这条I2C1总线上挂载的设备,如果是I2C2总线上挂载的设备,路径就是2-00XX了。 0051 一般的I2C设备的从机地址都是一个字节的,因为前两位为0x00(16进制的),后两位为pcf8563移位自后的I2C从机地址0x51(也是16进制的) 压缩包中的PCF8563-CN.pdf,datasheet告诉我们:I2C总线从地址:读,0A3H;写,0A2H。右移一位之后正好是0x51。 下面的代码可以完成这个功能: #include #include #include #include #include #include #include #include #include #include #include /* This is the structure as used in the I2C_RDWR ioctl call */ struct i2c_rdwr_ioctl_data { struct i2c_msg __user *msgs; /* pointers to i2c_msgs */ __u32 nmsgs; /* number of i2c_msgs */ }; int i2c_read_reg(char *dev, unsigned char *buf, unsigned slave_address, unsigned reg_address, int len) { struct i2c_rdwr_ioctl_data work_queue; unsigned char w_val = reg_address; int ret; int fd = open(dev, O_RDWR); if (!fd) { printf("Error on opening the device file\n"); return 0; } work_queue.nmsgs = 2; work_queue.msgs = (struct i2c_msg*)malloc(work_queue.nmsgs *sizeof(struct i2c_msg)); if (!work_queue.msgs) { printf("Memory alloc error\n"); close(fd); return 0; } ioctl(fd, I2C_TIMEOUT, 2); ioctl(fd, I2C_RETRIES, 1); (work_queue.msgs[0]).len = 1; (work_queue.msgs[0]).addr = slave_address; (work_queue.msgs[0]).buf = &w_val; (work_queue.msgs[1]).len = len; (work_queue.msgs[1]).flags = I2C_M_RD; (work_queue.msgs[1]).addr = slave_address; (work_queue.msgs[1]).buf = buf; ret = ioctl(fd, I2C_RDWR, (unsigned long) &work_queue); if (ret < 0) { printf("Error during I2C_RDWR ioctl with error code: %d\n", ret); close(fd); free(work_queue.msgs); return 0; } else { printf("read salve:x reg:x\n", slave_address, reg_address); close(fd); free(work_queue.msgs); return len; } } int i2c_write_reg(char *dev, unsigned char *buf, unsigned slave_address, unsigned reg_address, int len) { struct i2c_rdwr_ioctl_data work_queue; unsigned char w_val = reg_address; unsigned char w_buf[len+1]; int ret; w_buf[0] = reg_address; int fd = open(dev, O_RDWR); if (!fd) { printf("Error on opening the device file\n"); return 0; } work_queue.nmsgs = 1; work_queue.msgs = (struct i2c_msg*)malloc(work_queue.nmsgs *sizeof(struct i2c_msg)); if (!work_queue.msgs) { printf("Memory alloc error\n"); close(fd); return 0; } ioctl(fd, I2C_TIMEOUT, 2); ioctl(fd, I2C_RETRIES, 1); (work_queue.msgs[0]).len = 1 + len; (work_queue.msgs[0]).addr = slave_address; (work_queue.msgs[0]).buf = w_buf; memcpy(w_buf + 1, buf, len); ret = ioctl(fd, I2C_RDWR, (unsigned long) &work_queue); if (ret < 0) { printf("Error during I2C_RDWR ioctl with error code: %d\n", ret); close(fd); free(work_queue.msgs); return 0; } else { printf("write salve:x reg:x\n", slave_address, reg_address); close(fd); free(work_queue.msgs); return len; } } int main(int argc, char **argv) { unsigned int fd; unsigned int slave_address, reg_address; unsigned r_w; unsigned w_val; unsigned char rw_val; if (argc < 5) { printf("Usage:\n%s /dev/i2c-x start_addr reg_addr rw[0|1] [write_val]\n", argv[0]); return 0; } fd = open(argv[1], O_RDWR); if (!fd) { printf("Error on opening the device file %s\n", argv[1]); return 0; } sscanf(argv[2], "%x", &slave_address); sscanf(argv[3], "%x", &reg_address); sscanf(argv[4], "%d", &r_w); if (r_w == 0) { i2c_read_reg(argv[1], &rw_val, slave_address, reg_address, 1); printf("Read %s-%x reg %x, read value:%x\n", argv[1], slave_address, reg_address, rw_val); } else { if (argc < 6) { printf("Usage:\n%s /dev/i2c-x start_addr reg_addr r|w[0|1] [write_val]\n", argv[0]); return 0; } sscanf(argv[5], "%d", &w_val); if ((w_val & ~0xff) != 0) printf("Error on written value %s\n", argv[5]); rw_val = (unsigned char)w_val; i2c_write_reg(argv[1], &rw_val, slave_address, reg_address, 1); } return 0; } 在android/external/新建i2c-util目录,上述源代码存入android/external/i2c-util/i2c-util.c, R:\wyb\pcf8563_i2c1_r8_ruoge_ov2640\android\i2c-util\i2c-util.c 编写对应的Android.mk: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE_TAGS := optional LOCAL_MODULE = i2c-util # LOCAL_SRC_FILES := $(call all-subdir-c-files) LOCAL_SRC_FILES := i2c-util.c include $(BUILD_EXECUTABLE) 编译Android后,上述工具会位于/system/bin目录。在电路板上使用它: R:\wyb\pcf8563_i2c1_r8_ruoge_ov2640\android\out\target\product\nuclear-evb\system\bin\i2c-util 如果android已经编译了,只需要执行: rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ source build/envsetup.sh rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ lunch 选择:18. nuclear_evb-eng (注意:不同的ubuntu电脑,序号可能不同,但是只需要选择nuclear_evb-eng编译选项前面的序号既可!!!!) rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ cd i2c-util/ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android/i2c-util$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android/i2c-util$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android/i2c-util$ mm 详细的编译步骤: Connecting to 192.168.1.103:22... Connection established. To escape to local shell, press 'Ctrl+Alt+]'. Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64) * Documentation: https://help.ubuntu.com/ Last login: Sun Jun 26 19:23:30 2016 from 192.168.1.101 rootroot@rootroot-E400:~$ cd wyb/pcf8563_i2c1_r8_ruoge_ov2640/ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640$ ll total 8606460 drwxr-xr-x 4 rootroot rootroot 4096 Jun 26 20:46 ./ drwxr-xr-x 19 rootroot rootroot 4096 Jun 25 06:50 ../ drwxrwxr-x 29 rootroot rootroot 4096 Jun 26 19:51 android/ drwxrwxr-x 8 rootroot rootroot 4096 Jun 26 16:35 lichee/ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640$ cd android/ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ source build/envsetup.sh including device/asus/grouper/vendorsetup.sh including device/asus/tilapia/vendorsetup.sh including device/generic/armv7-a-neon/vendorsetup.sh including device/generic/armv7-a/vendorsetup.sh including device/generic/mips/vendorsetup.sh including device/generic/x86/vendorsetup.sh including device/samsung/maguro/vendorsetup.sh including device/samsung/manta/vendorsetup.sh including device/samsung/toroplus/vendorsetup.sh including device/samsung/toro/vendorsetup.sh including device/softwinner/common/vendorsetup.sh including device/softwinner/crane-evb/vendorsetup.sh including device/softwinner/nuclear-256m/vendorsetup.sh including device/softwinner/nuclear-evb/vendorsetup.sh including device/softwinner/nuclear-r8m-evb/vendorsetup.sh including device/ti/panda/vendorsetup.sh including sdk/bash_completion/adb.bash rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ lunch You're building on Linux Lunch menu... pick a combo: 1. full-eng 2. full_x86-eng 3. vbox_x86-eng 4. full_mips-eng 5. full_grouper-userdebug 6. full_tilapia-userdebug 7. mini_armv7a_neon-userdebug 8. mini_armv7a-userdebug 9. mini_mips-userdebug 10. mini_x86-userdebug 11. full_maguro-userdebug 12. full_manta-userdebug 13. full_toroplus-userdebug 14. full_toro-userdebug 15. crane_evb-eng 16. nuclear_256m-user 17. nuclear_256m-eng 18. nuclear_evb-eng 19. nuclear_r8m_evb-eng 20. full_panda-userdebug Which would you like? [full-eng] 18 ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=4.2.2 TARGET_PRODUCT=nuclear_evb TARGET_BUILD_VARIANT=eng TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a-neon HOST_ARCH=x86 HOST_OS=linux HOST_OS_EXTRA=Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty HOST_BUILD_TYPE=release BUILD_ID=JDQ39 OUT_DIR=out ============================================ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ ll total 156 drwxrwxr-x 29 rootroot rootroot 4096 Jun 26 19:51 ./ drwxr-xr-x 4 rootroot rootroot 4096 Jun 26 20:46 ../ drwxrwxr-x 3 rootroot rootroot 4096 Jun 13 11:38 abi/ drwxrwxr-x 10 rootroot rootroot 4096 Jun 13 11:38 bionic/ drwxrwxr-x 5 rootroot rootroot 4096 Jun 13 11:38 bootable/ drwxrwxr-x 7 rootroot rootroot 4096 Jun 13 11:38 build/ drwxrwxr-x 11 rootroot rootroot 4096 Jun 13 11:38 cts/ drwxrwxr-x 18 rootroot rootroot 4096 Jun 13 11:38 dalvik/ drwxrwxr-x 18 rootroot rootroot 4096 Jun 13 11:38 development/ drwxrwxr-x 10 rootroot rootroot 4096 Jun 13 11:38 device/ drwxrwxr-x 3 rootroot rootroot 4096 Jun 13 11:38 docs/ drwxrwxr-x 159 rootroot rootroot 4096 Jun 13 11:39 external/ drwxrwxr-x 14 rootroot rootroot 4096 Jun 13 11:40 frameworks/ drwxrwxr-x 10 rootroot rootroot 4096 Jun 13 11:40 gdk/ drwxrwxr-x 10 rootroot rootroot 4096 Jun 13 11:40 hardware/ drwxr-xr-x 2 rootroot rootroot 4096 Jun 26 19:37 i2cscan/ drwxr-xr-x 2 rootroot rootroot 4096 Jun 26 19:52 i2c-util/ drwxrwxr-x 11 rootroot rootroot 4096 Jun 13 11:40 libcore/ drwxrwxr-x 4 rootroot rootroot 4096 Jun 13 11:40 libnativehelper/ -r--r--r-- 1 rootroot rootroot 87 Jun 13 11:38 Makefile drwxrwxr-x 8 rootroot rootroot 4096 Jun 13 11:40 ndk/ drwxrwxr-x 4 rootroot rootroot 4096 Jun 26 16:43 out/ drwxrwxr-x 8 rootroot rootroot 4096 Jun 13 11:40 packages/ drwxrwxr-x 5 rootroot rootroot 4096 Jun 13 11:40 pdk/ drwxrwxr-x 10 rootroot rootroot 4096 Jun 13 11:41 prebuilts/ drwxr-xr-x 2 rootroot rootroot 4096 Jun 25 13:01 read_pcf8563/ drwxrwxr-x 6 rootroot rootroot 4096 Jun 13 11:38 .repo/ drwxrwxr-x 51 rootroot rootroot 4096 Jun 13 11:41 sdk/ drwxrwxr-x 9 rootroot rootroot 4096 Jun 13 11:41 system/ drwxrwxr-x 4 rootroot rootroot 4096 Jun 13 11:41 tools/ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android$ cd i2c-util/ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android/i2c-util$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android/i2c-util$ rootroot@rootroot-E400:~/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android/i2c-util$ mm ============================================ PLATFORM_VERSION_CODENAME=REL PLATFORM_VERSION=4.2.2 TARGET_PRODUCT=nuclear_evb TARGET_BUILD_VARIANT=eng TARGET_BUILD_TYPE=release TARGET_BUILD_APPS= TARGET_ARCH=arm TARGET_ARCH_VARIANT=armv7-a-neon HOST_ARCH=x86 HOST_OS=linux HOST_OS_EXTRA=Linux-3.13.0-24-generic-x86_64-with-Ubuntu-14.04-trusty HOST_BUILD_TYPE=release BUILD_ID=JDQ39 OUT_DIR=out ============================================ PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/Effect_Tick.ogg:system/media/audio/ui/Effect_Tick.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/KeypressStandard.ogg:system/media/audio/ui/KeypressStandard.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/KeypressSpacebar.ogg:system/media/audio/ui/KeypressSpacebar.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/KeypressDelete.ogg:system/media/audio/ui/KeypressDelete.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/KeypressReturn.ogg:system/media/audio/ui/KeypressReturn.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/VideoRecord.ogg:system/media/audio/ui/VideoRecord.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/camera_click.ogg:system/media/audio/ui/camera_click.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/LowBattery.ogg:system/media/audio/ui/LowBattery.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/Dock.ogg:system/media/audio/ui/Dock.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/Undock.ogg:system/media/audio/ui/Undock.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/Lock.ogg:system/media/audio/ui/Lock.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/Unlock.ogg:system/media/audio/ui/Unlock.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Sceptrum.ogg:system/media/audio/ringtones/Sceptrum.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/KeypressStandard_120.ogg:system/media/audio/ui/KeypressStandard.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/KeypressSpacebar_120.ogg:system/media/audio/ui/KeypressSpacebar.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/KeypressDelete_120.ogg:system/media/audio/ui/KeypressDelete.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/effects/ogg/KeypressReturn_120.ogg:system/media/audio/ui/KeypressReturn.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/notifications/ogg/Capella.ogg:system/media/audio/notifications/Capella.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/notifications/ogg/CetiAlpha.ogg:system/media/audio/notifications/CetiAlpha.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/notifications/ogg/Polaris.ogg:system/media/audio/notifications/Polaris.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/notifications/ogg/Pollux.ogg:system/media/audio/notifications/Pollux.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/notifications/ogg/Procyon.ogg:system/media/audio/notifications/Procyon.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Aquila.ogg:system/media/audio/ringtones/Aquila.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/ArgoNavis.ogg:system/media/audio/ringtones/ArgoNavis.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Carina.ogg:system/media/audio/ringtones/Carina.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Centaurus.ogg:system/media/audio/ringtones/Centaurus.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Cygnus.ogg:system/media/audio/ringtones/Cygnus.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Draco.ogg:system/media/audio/ringtones/Draco.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Machina.ogg:system/media/audio/ringtones/Machina.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Orion.ogg:system/media/audio/ringtones/Orion.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Pegasus.ogg:system/media/audio/ringtones/Pegasus.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Pyxis.ogg:system/media/audio/ringtones/Pyxis.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Rigel.ogg:system/media/audio/ringtones/Rigel.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Scarabaeus.ogg:system/media/audio/ringtones/Scarabaeus.ogg ignored. PRODUCT_COPY_FILES frameworks/base/data/sounds/ringtones/ogg/Solarium.ogg:system/media/audio/ringtones/Solarium.ogg ignored. PRODUCT_COPY_FILES device/softwinner/nuclear-common/googleservice/gapps-jb-20121130-signed/system/tts/lang_pico/es-ES_zl0_sg.bin:system/tts/lang_pico/es-ES_zl0_sg.bin ignored. PRODUCT_COPY_FILES device/softwinner/nuclear-common/googleservice/gapps-jb-20121130-signed/system/tts/lang_pico/es-ES_ta.bin:system/tts/lang_pico/es-ES_ta.bin ignored. PRODUCT_COPY_FILES device/softwinner/nuclear-common/googleservice/gapps-jb-20121130-signed/system/tts/lang_pico/fr-FR_nk0_sg.bin:system/tts/lang_pico/fr-FR_nk0_sg.bin ignored. PRODUCT_COPY_FILES device/softwinner/nuclear-common/googleservice/gapps-jb-20121130-signed/system/tts/lang_pico/fr-FR_ta.bin:system/tts/lang_pico/fr-FR_ta.bin ignored. PRODUCT_COPY_FILES device/softwinner/nuclear-common/googleservice/gapps-jb-20121130-signed/system/tts/lang_pico/de-DE_gl0_sg.bin:system/tts/lang_pico/de-DE_gl0_sg.bin ignored. PRODUCT_COPY_FILES device/softwinner/nuclear-common/googleservice/gapps-jb-20121130-signed/system/tts/lang_pico/it-IT_cm0_sg.bin:system/tts/lang_pico/it-IT_cm0_sg.bin ignored. PRODUCT_COPY_FILES device/softwinner/nuclear-common/googleservice/gapps-jb-20121130-signed/system/tts/lang_pico/it-IT_ta.bin:system/tts/lang_pico/it-IT_ta.bin ignored. PRODUCT_COPY_FILES device/softwinner/nuclear-common/googleservice/gapps-jb-20121130-signed/system/tts/lang_pico/de-DE_ta.bin:system/tts/lang_pico/de-DE_ta.bin ignored. No private recovery resources for TARGET_DEVICE nuclear-evb make: Entering directory `/home/rootroot/wyb/pcf8563_i2c1_r8_ruoge_ov2640/android' target thumb C: i2c-util cd R:\wyb\pcf8563_i2c1_r8_ruoge_ov2640\android\out\target\product\nuclear-evb\system\bin C:\Users\Administrator.USER-20150913SZ>r: R:\wyb\pcf8563_i2c1_r8_ruoge_ov2640\android\out\target\product\nuclear-evb\system\bin>adb remount remount succeeded R:\wyb\pcf8563_i2c1_r8_ruoge_ov2640\android\out\target\product\nuclear-evb\system\bin> R:\wyb\pcf8563_i2c1_r8_ruoge_ov2640\android\out\target\product\nuclear-evb\system\bin>dir i2c* 驱动器 R 中的卷是 rootroot 卷的序列号是 1A1C-E71D R:\wyb\pcf8563_i2c1_r8_ruoge_ov2640\android\out\target\product\nuclear-evb\system\bin 的目录 2016/06/26 21:10 5,388 i2c-util 1 个文件 5,388 字节 0 个目录 268,337,782,784 可用字节 R:\wyb\pcf8563_i2c1_r8_ruoge_ov2640\android\out\target\product\nuclear-evb\system\bin> R:\wyb\pcf8563_i2c1_r8_ruoge_ov2640\android\out\target\product\nuclear-evb\system\bin>adb push i2c-util /data/ 29 KB/s (5388 bytes in 0.180s) R:\wyb\pcf8563_i2c1_r8_ruoge_ov2640\android\out\target\product\nuclear-evb\system\bin> 将R8的串口连接到windows电脑上。通过串口工具:比如Xshell5(有些人可能喜欢使用SecureCRT)读取R8的串口打印 (ubuntu下请使用minicom,使用方法请自行搜索了) 波特率选择:115200 N 8 1 等R8的android启动完成之后(LCD进android主界面),输入:su [ 37.990060] init: process 'ril-daemon', pid 950 exited [ 38.010049] init: process 'ril-daemon' killing any children in process group su root@android:/ # root@android:/ # root@android:/ # cd /data root@android:/data # root@android:/data # ll drwxrwxr-x system system 1970-01-11 08:58 anr drwxrwx--x system system 1970-01-02 08:01 app drwx------ root root 1980-10-01 11:03 app-asec drwxrwx--x system system 1970-01-02 08:01 app-lib drwxrwx--x system system 1980-10-01 11:03 app-private drwx------ system system 1980-10-01 11:04 backup drwxrwx--x system system 1970-01-02 08:00 dalvik-cache drwxrwx--x system system 2016-06-21 10:11 data drwxr-x--- root log 1980-10-01 11:03 dontpanic drwxrwx--- drm drm 1980-10-01 11:04 drm -rw-rw-rw- root root 5388 2016-06-26 21:10 i2c-util drwxr-x--x root root 1980-10-01 11:03 local drwxrwx--- root root 1970-01-01 08:00 lost+found drwxrwx--- media_rw media_rw 1980-10-01 11:03 media drwxrwx--t system misc 1980-10-01 11:03 misc -rw------- system system 154 1970-01-02 08:02 pointercal drwx------ root root 1970-01-02 08:00 property -rwxrwxrwx root root 5392 2016-06-25 13:01 read_pcf8563 drwxrwx--x system system 1980-10-01 11:03 resource-cache drwxr-x--- root shell 1980-10-01 11:03 ssh drwxrwxr-x system system 1970-01-02 08:00 system drwx------ system system 1970-01-02 08:03 tombstones drwx--x--x system system 1980-10-01 11:03 user root@android:/data # (让i2c-util具有可执行权限:) root@android:/data # chmod 777 i2c-util root@android:/data # root@android:/data # ll i2c* -rwxrwxrwx root root 5388 2016-06-26 21:10 i2c-util root@android:/data # root@android:/data # root@android:/data # (可选执行) root@android:/data # sync root@android:/data # 注意:串口打印会打印很多log信息。上面的步骤中的状态信息已经被过滤了。 如果你的串口打印过量的log信息,属于正常现象! 如果不想要这么多的状态信息,可以考虑使用adb shell。 不过windows命令行中的adb shell不能够按TAB键自动补充,ubuntu的可以。 也许我们可以把windows的命令行特别设计一下(给它修正一下),让它也可以通过按TAB键来自动补全!^_ 读取pcf8563的第2个寄存器(秒钟值): 表 5:BCD 格式寄存器概况 标明“-”的位无效 地址 寄存器名称 Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 02h 秒 VL 00~59BCD 码格式数 root@android:/data # ./i2c-util /dev/i2c-1 0x51 0x02 0 read salve:51 reg:02 Read /dev/i2c-1-51 reg 2, read value:11 root@android:/data # ./i2c-util /dev/i2c-1 0x51 0x02 0 read salve:51 reg:02 Read /dev/i2c-1-51 reg 2, read value:12 root@android:/data # ./i2c-util /dev/i2c-1 0x51 0x02 0 read salve:51 reg:02 Read /dev/i2c-1-51 reg 2, read value:12 root@android:/data # ./i2c-util /dev/i2c-1 0x51 0x02 0 read salve:51 reg:02 Read /dev/i2c-1-51 reg 2, read value:13 root@android:/data # ./i2c-util /dev/i2c-1 0x51 0x02 0 read salve:51 reg:02 Read /dev/i2c-1-51 reg 2, read value:14 root@android:/data # ./i2c-util /dev/i2c-1 0x51 0x02 0 read salve:51 reg:02 Read /dev/i2c-1-51 reg 2, read value:14 root@android:/data # ./i2c-util /dev/i2c-1 0x51 0x02 0 read salve:51 reg:02 Read /dev/i2c-1-51 reg 2, read value:15 可以知道秒钟的值是变化的,基本上是一秒钟递增一次,I2C读取成功。 如果感兴趣的话,在执行读取命令的时候通过协议分析仪或者示波器来抓取I2C1的SCL/SDA的波形,来进行更加详尽的分析!^_ 方法二: 给出了一种复杂的解决办法(步骤从简,更多请参考开头的方法): R:\wyb\pcf8563_i2c1_r8_ruoge_ov2640\lichee\linux-3.4\drivers\rtc\rtc-sun5i.c 给这个驱动文件增加设备节点:/dev/a20_r8_pcf8563 增加设备节点的方法请参考: http://blog.csdn.net/mirkerson/article/details/8844997 android驱动学习---led实验 然后在这个驱动文件的pcf8563_probe函数处截获它的client指针(struct i2c_client *client) client2 = client; 用户可以通过在userspace直接访问设备节点:/dev/a20_r8_pcf8563(open) 然后调用ioctl:ioctl(fd, 0x00000001, 0x02); 来获取第2个寄存器:秒钟的值了。 #include #include #include #include #include #include #include #include #include #include #include int fd; int main(int argc, char **argv) { fd = open("/dev/a20_r8_pcf8563", O_RDWR); ioctl(fd, 0x00000001, 0x02); close(fd); return 0; } 执行过程(直接从内核打印秒钟值了,也可以看到秒钟值大概也是一秒钟递增一次!): root@android:/data # root@android:/data # ./read_pcf8563 [ 1397.060015] ****wyb drivers/rtc/rtc-sun5i.c:1169/r8_pcf8563_open()! open init.... [ 1397.071009] ****wyb drivers/rtc/rtc-sun5i.c:1130/r8_pcf8563_ioctl()! cmd=0x00000001 [ 1397.079076] ****wyb drivers/rtc/rtc-sun5i.c:1160/r8_pcf8563_ioctl()! cmd=0x00000001, value=0x00000046 [ 1397.088342] ****wyb drivers/rtc/rtc-sun5i.c:1177/r8_pcf8563_close()! close init root@android:/data # root@android:/data # ./read_pcf8563 [ 1398.409888] ****wyb drivers/rtc/rtc-sun5i.c:1169/r8_pcf8563_open()! open init.... [ 1398.411203] ****wyb drivers/rtc/rtc-sun5i.c:1130/r8_pcf8563_ioctl()! cmd=0x00000001 [ 1398.419273] ****wyb drivers/rtc/rtc-sun5i.c:1160/r8_pcf8563_ioctl()! cmd=0x00000001, value=0x00000047 [ 1398.428546] ****wyb drivers/rtc/rtc-sun5i.c:1177/r8_pcf8563_close()! close init root@android:/data # root@android:/data # root@android:/data # ./read_pcf8563 [ 1399.668173] ****wyb drivers/rtc/rtc-sun5i.c:1169/r8_pcf8563_open()! open init.... [ 1399.670939] ****wyb drivers/rtc/rtc-sun5i.c:1130/r8_pcf8563_ioctl()! cmd=0x00000001 [ 1399.679022] ****wyb drivers/rtc/rtc-sun5i.c:1160/r8_pcf8563_ioctl()! cmd=0x00000001, value=0x00000048 [ 1399.688299] ****wyb drivers/rtc/rtc-sun5i.c:1177/r8_pcf8563_close()! close init root@android:/data #

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

撩得Android一次心动

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值