2014년 2월 28일 금요일

지그비 모듈 소모 전류 관련



제가 측정한바로는 rx 만 놓았을 경우에 3.3v 27mA 정도 소모하는 것으로 측정 하였습니다.
3일 이면, 27mA X 24(시간) X 3 = 1944mA 정도 입니다.

AA 사이즈 배터리의 경우, 네어버에 찾아보니 회사에 따라 다르지만 2000mA 내외 인 것으로보입니다.

따라서 RX를 계속 하고 있다고 하면 그정도 가는 것이 맞다고 봅니다.

더 오랜 시간을 구동 시칸다고 하면, POWER 모드를 변경하는 것이 맞는 것 같습니다.
데이터 시트에도 아래와 같이 되어 있습니다.

본문 이미지 1

따라서 슬립 모드로 있다가 RF 로 RX 가 들어오면 깨어나는 그러한 것을 구현 해야 할 듯 싶습니다.

2014년 2월 27일 목요일

(CM-V310 ) 3GB RAM




(CM-V310 ) 3GB RAM

[root@icanjji-pc image]# df
Filesystem      1K-blocks       Used Available Use% Mounted on
/dev/sda2      1947374844 1607249888 242662848  87% /
udev              2006136          4   2006132   1% /dev
tmpfs              805972       1860    804112   1% /run
none                 5120          0      5120   0% /run/lock
none              2014924         76   2014848   1% /run/shm
/dev/sda1           96880        124     96756   1% /boot/efi
/dev/sdg1         6673712          4   6673708   1% /media/0000-3333
/dev/sdg3          301416      16576    269284   6% /media/0a09e951-c99a-a8e3-c1ea-a133ba3a9a83
/dev/sdg2          302608     101884    200724  34% /media/57f8f4bc-abf4-0000-675f-946fc0f9f25b
/dev/sdg4          301416      16576    269284   6% /media/5546348f-4e96-2ddf-46e6-262f3f361f7f
[root@icanjji-pc image]# sudo ./sdwriter sdg 310 bin
Mango SD Writer V1.0

Unmount all : success

Write Mango310 BL1 : success
Write Mango310 Uboot : success
Write Mango310 Kernel : success

Unmount all : success

Success
SD write를 하고 bootargs 3GB에서 부팅하는 경우
Mango310 # setenv bootargs 'root=/dev/mmcblk0p2 rw rootfstype=ext4 init=/sbin/init console=ttySAC1,115200 mem=0xbfffffff rootwait'

위와 같이 세팅을 해야 부팅을 한다.
1byte를 작게 bootargs에 넘겼다.

커널에서 1byte를 사용하지 못한다.

왜 그런지 잘 모르겠다

2014년 2월 26일 수요일

망고 안드로이드 CTS 테스트




망고 안드로이드 CTS 테스트

https://source.android.com/compatibility/cts-intro.html


[icanjji@icanjji-pc Downloads]$ ls
adt-bundle-linux-x86_64-20131030.zip  android-sdk_r22.3-linux.tgz
[icanjji@icanjji-pc Downloads]$ sudo cp * /opt/

android-cts-4.0.3_r3-linux_x86-arm.zip 압축을 풀었다.





 [root@icanjji-pc tools]# export PATH=/opt/java/bin:$PATH
[root@icanjji-pc tools]# ./cts-tradefed
02-26 20:34:52 W/DeviceManager: You are running an older version of fastboot, please update it.
Android CTS 4.0.3_r3
cts-tf > 02-26 20:34:52 I/DeviceManager: Detected new device BABABEEFBABABEEF

cts-tf >
cts-tf >
cts-tf > run cts

Java
cts-tf > run cts --plan CTS
02-26 21:30:55 I/TestInvocation: Starting invocation for 'cts' on build '4.0.3_r3' on device BABABEEFBABABEEF
02-26 21:30:55 I/BABABEEFBABABEEF: Created result dir 2014.02.26_21.30.55
cts-tf > 02-26 21:31:24 I/BABABEEFBABABEEF: Collecting device info
02-26 21:31:25 I/BABABEEFBABABEEF: -----------------------------------------
02-26 21:31:25 I/BABABEEFBABABEEF: Test package android.apidemos.cts started
02-26 21:31:25 I/BABABEEFBABABEEF: -----------------------------------------
02-26 21:31:35 I/BABABEEFBABABEEF: android.apidemos.cts.ApiDemosTest#testNumberOfItemsInListView PASS
02-26 21:31:38 I/BABABEEFBABABEEF: android.apidemos.cts package complete: Passed 1, Failed 0, Not Executed 0
02-26 21:31:38 I/BABABEEFBABABEEF: -----------------------------------------
02-26 21:31:38 I/BABABEEFBABABEEF: Test package android.acceleration started
02-26 21:31:38 I/BABABEEFBABABEEF: -----------------------------------------
02-26 21:31:40 I/BABABEEFBABABEEF: android.acceleration.cts.HardwareAccelerationTest#testIsHardwareAccelerated PASS
02-26 21:31:40 I/BABABEEFBABABEEF: android.acceleration.cts.HardwareAccelerationTest#testNotAttachedView PASS
02-26 21:31:40 I/BABABEEFBABABEEF: android.acceleration.cts.SoftwareAccelerationTest#testIsHardwareAccelerated PASS
02-26 21:31:41 I/BABABEEFBABABEEF: android.acceleration.cts.SoftwareAccelerationTest#testNotAttachedView PASS

These media files are required for the CTS media stress tests.
·         CTS Media 1.0

Older Android Versions



 다운로드 받습니다.




Workflow


This section summarizes CTS setup. Please refer to the CTS User Manual for detailed instructions.
1.    Download the CTS and CTS media files.
2.    Attach at least one device (or emulator) to your machine.
3.    For CTS versions 2.1 R2 through 4.2 R4, set up your device (or emulator) to run the accessibility tests:
1.    adb install -r android-cts/repository/testcases/CtsDelegatingAccessibilityService.apk
2.    On the device, enable Settings > Accessibility > Accessibility > Delegating Accessibility Service
4.    For CTS 2.3 R4 and beyond, set up your device to run the device administration tests:
1.    adb install -r android-cts/repository/testcases/CtsDeviceAdmin.apk
2.    On the device, enable the two android.deviceadmin.cts.CtsDeviceAdminReceiver* device administrators under Settings > Location & security > Select device administrators
Note: Make sure the android.deviceadmin.cts.CtsDeviceAdminDeactivatedReceiver stays disabled in the same menu.
5.    For CTS 2.3 R12 and beyond, the CTS media files must be copied to the device's external storage. Check section 4.2 of the latest CTS manual for further details on copying these files:
1.    Unzip the CTS Media zip file.
2.    Run the following command. If no resolution is specified, the default maximum resolution of 480x360 is assumed:
copy_media.sh [720x480|1280x720|1920x1080|all] [-s serial]
6.    Launch the CTS. The CTS test harness loads the test plan onto the attached devices. For each test in the test harness:
o    The test harness pushes an .apk file to each device, executes the test through instrumentation, and records test results.
o    The test harness removes the .apk file from each device.
7.    Once all the tests are executed, view the test results in your browser and use them to adjust your design. You can continue to run the CTS throughout your development process.

Types of test cases


The CTS includes the following types of test cases:
·         Unit tests test atomic units of code within the Android platform; e.g. a single class, such as java.util.HashMap.
·         Functional tests test a combination of APIs together in a higher-level use-case.
·         Reference application tests instrument a complete sample application to exercise a full set of APIs and Android runtime services.
Future versions of the CTS will include the following types of test cases:
·         Robustness tests test the durability of the system under stress.
·         Performance tests test the performance of the system against defined benchmarks, for example rendering frames per second.

Areas Covered


The unit test cases cover the following areas to ensure compatibility:
Area
Description
Signature tests
For each Android release, there are XML files describing the signatures of all public APIs contained in the release. The CTS contains a utility to check those API signatures against the APIs available on the device. The results from signature checking are recorded in the test result XML file.
Platform API Tests
Test the platform (core libraries and Android Application Framework) APIs as documented in the SDK Class Index to ensure API correctness, including correct class, attribute and method signatures, correct method behavior, and negative tests to ensure expected behavior for incorrect parameter handling.
Dalvik VM Tests
The tests focus on testing the Dalvik VM.
Platform Data Model
The CTS tests the core platform data model as exposed to application developers through content providers, as documented in the SDK android.provider package: contacts, browser, settings, etc.
Platform Intents
The CTS tests the core platform intents, as documented in the SDK Available Intents.
Platform Permissions
The CTS tests the core platform permissions, as documented in the SDK Available Permissions.
Platform Resources
The CTS tests for correct handling of the core platform resource types, as documented in the SDK Available Resource Types. This includes tests for: simple values, drawables, nine-patch, animations, layouts, styles and themes, and loading alternate resources.
Except as noted, this content is licensed under Creative Commons Attribution 2.5. For details and restrictions, see the Content License.
About Android  |  Community  |  Legal  | 


2014년 2월 25일 화요일

make_ext4fs android 메모






make_ext4fs
에 대하여 안드로이드를 컴파일하면
out/host/linux-x86/bin
디렉토리에 생성이 된다.  

mkuserimg.sh

#!/bin/bash
#
# To call this script, make sure make_ext4fs is somewhere in PATH

function usage() {
cat<<EOT
Usage:
mkuserimg.sh [-s] SRC_DIR OUTPUT_FILE EXT_VARIANT MOUNT_POINT SIZE
EOT
}

echo "in mkuserimg.sh PATH=$PATH"

ENABLE_SPARSE_IMAGE=
if [ "$1" = "-s" ]; then
  ENABLE_SPARSE_IMAGE="-s"
  shift
fi

if [ $# -ne 4 -a $# -ne 5 ]; then
  usage
  exit 1
fi

SRC_DIR=$1
if [ ! -d $SRC_DIR ]; then
  echo "Can not find directory $SRC_DIR!"
  exit 2
fi

OUTPUT_FILE=$2
EXT_VARIANT=$3
MOUNT_POINT=$4
SIZE=$5

case $EXT_VARIANT in
  ext4) ;;
  *) echo "Only ext4 is supported!"; exit 3 ;;
esac

if [ -z $MOUNT_POINT ]; then
  echo "Mount point is required"
  exit 2
fi

if [ -z $SIZE ]; then
    SIZE=128M
fi

MAKE_EXT4FS_CMD="make_ext4fs $ENABLE_SPARSE_IMAGE -l $SIZE -a $MOUNT_POINT $OUTPUT_FILE $SRC_DIR"
echo $MAKE_EXT4FS_CMD
$MAKE_EXT4FS_CMD
if [ $? -ne 0 ]; then
  exit 4
fi

안드로이드

# $(1): src directory
# $(2): output file
# $(3): mount point
# $(4): ext variant (ext2, ext3, ext4)
# $(5): size of the partition
define build-userimage-ext-target
  @mkdir -p $(dir $(2))
  $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \
      $(MKEXTUSERIMG) $(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG) $(1) $(2) $(4) $(3) $(5)
Endef


./make_ext4fs -l 250M -a userdata ~/image/newuserdata.img  ~/work/android/out/target/product/mango210/data/

아래 사이트 참조
android ICS 포팅 3일차 - system.img ext4 파일 시스템으로 변환하기 http://blogimgs.naver.net/imgs/nblog/spc.gif 안드로이드 프레임워크 / 프로그래밍 http://blogimgs.naver.net/imgs/nblog/spc.gif
2011/12/23 15:53
안드로이드 소스를 빌드하면 out 폴더가 생성되게 된다.

ext4 변환하기 위해서는 make_ext4fs 라는 툴을 사용해야 한다. 툴의 위치는 아래와 같다.

out/host/linux-x86/bin

그리고 아래와 같은 명령어로 system.img.ext4 생성해주자.

make_ext4fs -l 170M -a system system.img.ext4 system/

-l : 파일 사이즈를 설정한다. 170M 세팅해줬다.
-a : android mountpoint 라고 한다. 기냥 system 이라고 해주자.
파일명: 생성 되는 파일명
폴더: system 폴더내의 파일들이 ext4 image 만들어진다


2014년 2월 20일 목요일

Mango220(Exynos4412) 이더넷 Iperf 테스트





1. 기본 iperf 테스트
1.1. 망고220 이 서버 일 때
<망고220 로그>
$ /data/data/com.magicandroidapps.iperf/bin/iperf -s -i 1&   
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec  2.54 MBytes  21.3 Mbits/sec
[  4]  1.0- 2.0 sec  3.25 MBytes  27.2 Mbits/sec
[  4]  2.0- 3.0 sec  3.30 MBytes  27.7 Mbits/sec
[  4]  3.0- 4.0 sec  3.27 MBytes  27.5 Mbits/sec
[  4]  4.0- 5.0 sec  3.21 MBytes  27.0 Mbits/sec
[  4]  5.0- 6.0 sec  3.28 MBytes  27.5 Mbits/sec
[  4]  6.0- 7.0 sec  3.28 MBytes  27.5 Mbits/sec
[  4]  7.0- 8.0 sec  3.29 MBytes  27.6 Mbits/sec
[  4]  8.0- 9.0 sec  3.31 MBytes  27.8 Mbits/sec
[  4]  9.0-10.0 sec  3.31 MBytes  27.8 Mbits/sec
[  4]  0.0-10.1 sec  32.2 MBytes  26.9 Mbits/sec



<HOST PC>
$ iperf -c 192.168.55.13
------------------------------------------------------------
Client connecting to 192.168.55.13, TCP port 5001
TCP window size: 23.5 KByte (default)
------------------------------------------------------------
[  3] local 192.168.55.8 port 59789 connected with 192.168.55.13 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.1 sec  32.2 MBytes  26.9 Mbits/sec












1.2. HOST PC가 서버 일 때
<망고220>
/data/data/com.magicandroidapps.iperf/bin/iperf -c 192.168.55.8

------------------------------------------------------------
Client connecting to 192.168.55.8, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.55.13 port 35105 connected with 192.168.55.8 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  35.6 MBytes  29.8 Mbits/sec



<HOSTPC>
$ iperf -s -i 1
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.55.8 port 5001 connected with 192.168.55.13 port 35105
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec  3.20 MBytes  26.9 Mbits/sec
[  4]  1.0- 2.0 sec  3.53 MBytes  29.6 Mbits/sec
[  4]  2.0- 3.0 sec  3.60 MBytes  30.2 Mbits/sec
[  4]  3.0- 4.0 sec  3.54 MBytes  29.7 Mbits/sec
[  4]  4.0- 5.0 sec  3.61 MBytes  30.3 Mbits/sec
[  4]  5.0- 6.0 sec  3.60 MBytes  30.2 Mbits/sec
[  4]  6.0- 7.0 sec  3.60 MBytes  30.2 Mbits/sec
[  4]  7.0- 8.0 sec  3.60 MBytes  30.2 Mbits/sec
[  4]  8.0- 9.0 sec  3.61 MBytes  30.3 Mbits/sec
[  4]  9.0-10.0 sec  3.63 MBytes  30.5 Mbits/sec
[  4]  0.0-10.0 sec  35.6 MBytes  29.8 Mbits/sec








2. 이더넷 속도 관련 kernel 소스 수정

$ vi arch/arm/mach-exynos/mach-mango220.c
static void __init smdk4x12_smsc911x_init(void)
… 생략…
__raw_writel((0x0 << S5P_SROM_BCX__PMC__SHIFT) |
            (0x0 << S5P_SROM_BCX__TACP__SHIFT) |
            (0x1 << S5P_SROM_BCX__TCAH__SHIFT) |
            (0x0 << S5P_SROM_BCX__TCOH__SHIFT) |
            (0x2 << S5P_SROM_BCX__TACC__SHIFT) |
            (0x0 << S5P_SROM_BCX__TCOS__SHIFT) |
            (0x0 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1);

$vi drivers/net/smsc911x.c
static inline void reg_write(u32 addr, u32 val)
{
   *(volatile u16*)addr = (u16)val;
   *(volatile u16*)(addr + 2) = (u16)(val >> 16);
}
static inline u32 reg_read(u32 addr)
{
   volatile unsigned short __force  *addr_16 = (unsigned short *)(addr);
   //printk("addr_16 = 0x%x, addr = 0x%x \n",*addr_16,addr);  //by crazyboy 20140220 by treego;
   return ((readw(addr) & 0xFFFF) |
           ((readw(addr + 2) & 0xFFFF) << 16));
}

#if 1
static inline void
smsc911x_tx_writefifo(struct smsc911x_data *pdata, unsigned int *buf,
     unsigned int wordcount)
{
   unsigned long flags;
   int val;
   spin_lock_irqsave(&pdata->dev_lock, flags);
//#ifdef CRZ_SPEED_UP//crazyboys
#if 1
   while (wordcount--)
   {
    val = *buf++;
//   printk("write == reg=0x%x buf = 0x%x val = 0x%x \n",pdata->ioaddr + TX_DATA_FIFO,*buf,(u16)val);
    *(volatile u16*)(pdata->ioaddr + TX_DATA_FIFO) = (u16)val;
    *(volatile u16*)(pdata->ioaddr + TX_DATA_FIFO + 2) = (u16)(val >> 16);
   }

#else
//MANGO_DBG("== wordcount=%d\n",wordcount);
while (wordcount--)
__smsc911x_reg_write(pdata, TX_DATA_FIFO, *buf++);
goto out;
#endif
   spin_unlock_irqrestore(&pdata->dev_lock, flags);
}

#if 1
static inline void
smsc911x_rx_readfifo(struct smsc911x_data *pdata, unsigned int *buf,
    unsigned int wordcount)
{
unsigned long flags;
unsigned int test_val;
unsigned short *sp = (unsigned short *)buf;
volatile u16 *addr_16 = (u16 *)(pdata->ioaddr);
   spin_lock_irqsave(&pdata->dev_lock, flags);
//#ifdef CRZ_SPEED_UP//crazyboys
//  printk("CCRRZZZZZZ- pdata->ioaddr=0x%x addr_16 = 0x%x\n",pdata->ioaddr + TX_DATA_FIFO,addr_16);
//  printk("CCRRZZZZZZ- pdata->ioaddr=0x%x addr_16 = 0x%x\n",pdata->ioaddr,*addr_16);
   while (wordcount--)
   {
   #if 0 //crazyboys test Remove it
   *buf++=reg_read(0xf1000000);
   *buf++=reg_read(0xf1000000);
   while(1);
   #endif
//   printk("write == reg=0x%x buf = 0x%x \n",pdata->ioaddr + RX_DATA_FIFO,*buf);
    //printk("read == wordcount=%d\n",wordcount);
    *buf++=reg_read(pdata->ioaddr);
//   *buf++=__smsc911x_reg_read(pdata,RX_DATA_FIFO);
//   *buf++ = ((*addr_16 & 0x0000ffff) | (*(addr_16 + 1) << 16));
   // *buf++ = reg_read(0xeed20000);
     // *sp++=(*(volatile u16*)(0xf1000000));
     //*sp++=*addr_16;
   // udelay(1);
   //*sp++=(*(volatile u16*)(0xf1000002));
   //*sp++=*(addr_16+1);
   // udelay(5);
   }
   spin_unlock_irqrestore(&pdata->dev_lock, flags);
}

3. 소스 수정 후 iperf 테스트
3.1. 망고220 이 서버 일 때
<망고220 로그>
# /data/data/com.magicandroidapps.iperf/bin/iperf -s -i 1
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.55.13 port 5001 connected with 192.168.55.8 port 50215
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec  4.65 MBytes  39.0 Mbits/sec
[  4]  1.0- 2.0 sec  4.49 MBytes  37.6 Mbits/sec
[  4]  2.0- 3.0 sec  4.51 MBytes  37.8 Mbits/sec
[  4]  3.0- 4.0 sec  4.62 MBytes  38.7 Mbits/sec
[  4]  4.0- 5.0 sec  4.54 MBytes  38.1 Mbits/sec
[  4]  5.0- 6.0 sec  4.56 MBytes  38.2 Mbits/sec
[  4]  6.0- 7.0 sec  4.64 MBytes  38.9 Mbits/sec
[  4]  7.0- 8.0 sec  4.63 MBytes  38.8 Mbits/sec
[  4]  8.0- 9.0 sec  4.82 MBytes  40.4 Mbits/sec
[  4]  9.0-10.0 sec  4.59 MBytes  38.5 Mbits/sec
[  4]  0.0-10.0 sec  46.2 MBytes  38.6 Mbits/sec



<HOST PC>
$ iperf -c 192.168.55.13
------------------------------------------------------------
Client connecting to 192.168.55.13, TCP port 5001
TCP window size: 23.5 KByte (default)
------------------------------------------------------------
[  3] local 192.168.55.8 port 50215 connected with 192.168.55.13 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  46.2 MBytes  38.6 Mbits/sec







3.2. HOST PC가 서버 일 때
<망고220>
/data/data/com.magicandroidapps.iperf/bin/iperf -c 192.168.55.8

------------------------------------------------------------
Client connecting to 192.168.55.8, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.55.13 port 55880 connected with 192.168.55.8 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  77.0 MBytes  64.5 Mbits/sec



<HOSTPC>
$ iperf -s -i 1
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 192.168.55.8 port 5001 connected with 192.168.55.13 port 55880
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec  6.90 MBytes  57.9 Mbits/sec
[  4]  1.0- 2.0 sec  7.50 MBytes  62.9 Mbits/sec
[  4]  2.0- 3.0 sec  7.50 MBytes  62.9 Mbits/sec
[  4]  3.0- 4.0 sec  7.51 MBytes  63.0 Mbits/sec
[  4]  4.0- 5.0 sec  7.49 MBytes  62.8 Mbits/sec
[  4]  5.0- 6.0 sec  7.52 MBytes  63.1 Mbits/sec
[  4]  6.0- 7.0 sec  8.03 MBytes  67.4 Mbits/sec
[  4]  7.0- 8.0 sec  8.11 MBytes  68.1 Mbits/sec
[  4]  8.0- 9.0 sec  8.16 MBytes  68.5 Mbits/sec
[  4]  9.0-10.0 sec  8.16 MBytes  68.5 Mbits/sec
[  4]  0.0-10.0 sec  77.0 MBytes  64.5 Mbits/sec