Lucas2 에서 사용하는 MTG Tool(labtool, mfgbridge)에 대해 설명한다.

개요

MFG Software 는 아래와 같이 구성된다.

  1. Firmware(Production, MFG) - 양산용, 검증용으로 나뉜다
  2. Driver - mlan.ko, sd8xxx.ko(wifi), mbt8xxx.ko(bluetooth)
  3. Bridge, bridge_init.conf(Labtool-Bridge configuration file) - bridge_init.conf 로 포트번호를 변경할 수 있다
  4. Labtool(Windows, Standalone) - 윈도우용의 경우, bridge 이고, 리눅스용의 경우, bridge 와 labtool 이 타겟에서 사용가능하다
  5. Cal Data(CalWlanData_ext.conf) - Tx 보정하는 역할을 한다. 각 벤더에서 제공하는 PC Software 를 사용하여 golden cal 을 추출한다
  6. Setup.ini - labtool 설정 파일

이외 더 자세한 내용은 labtool_at_command.pptx 를 참고한다.

개발 환경 이해하기

먼저 개발환경 자체를 잘 이해할 필요가 있는데, 컴파일 및 빌드를 개인 개발 PC 에서 할 수 없다. 지정된 노트북에서만 가능하며, 이것 또한 삼성으로부터 전달받은 것이라고 한다.
또다른 제약 사항은 root 권한을 사용할 수 없고, 스크립트를 실행하여 진입하게되는 개발환경 내에서는 웬만한 명령어는 사용할 수 없다.
로그인 가능한 계정은 아래 표와 같다.

ID lucas
Password test123

따라서 여기서 기술하는 명령어들은 지정된 노트북에서만 사용이 가능하다.

컴파일 하기

먼저 지정된 PC 에 앞서 언급한 계정으로 로그인을 하고 아래와 같이 실행한다.

$cd /home/lucas/chromeos/lucas2-newrelease-tot/chromite/bin
$./cros_sdk
[sudo] password for lucas:

여기서 'test123' 을 입력한다.

(cr) ((5d9e143...)) lucas@lucas-pc

이제 lucas 개발 환경으로 진입한 것이다.
Marvell 소스코드들이 저장된 경로는 '/mnt/host/source/src/third_party/marvell' 이다.

$find -name labtool
./mnt/host/source/src/third_party/marvell/labtool_8897_12_16_for_8897_org/labtool
./mnt/host/source/src/third_party/marvell/labtool_8897_12_16_for_8897_org/labtool/labtool
./mnt/host/source/src/third_party/marvell/labtool_8897_12_16_for_8897_org/DutApiWiFiBt/labtool
./mnt/host/source/src/third_party/marvell/labtool_8897_backup_01_15/labtool
./mnt/host/source/src/third_party/marvell/labtool_8897_backup_01_15/labtool/labtool
./mnt/host/source/src/third_party/marvell/labtool_8897_backup_01_15/DutApiWiFiBt/labtool
./mnt/host/source/src/third_party/marvell/eric/labtool_8897_12_16_for_8897_org/labtool
./mnt/host/source/src/third_party/marvell/eric/labtool_8897_12_16_for_8897_org/labtool/labtool
./mnt/host/source/src/third_party/marvell/eric/labtool_8897_12_16_for_8897_org/DutApiWiFiBt/labtool
./mnt/host/source/src/third_party/marvell/labtool_8897_12_26/labtool
./mnt/host/source/src/third_party/marvell/labtool_8897_12_26/labtool/labtool
./mnt/host/source/src/third_party/marvell/labtool_8897_12_26/DutApiWiFiBt/labtool
 
$find -name mfgbridge
./mnt/host/source/src/third_party/marvell/labtool_8897_12_16_for_8897_org/bridge/mfgbridge
./mnt/host/source/src/third_party/marvell/labtool_8897_backup_01_15/bridge_android/mfgbridge
./mnt/host/source/src/third_party/marvell/labtool_8897_backup_01_15/bridge/mfgbridge
./mnt/host/source/src/third_party/marvell/eric/labtool_8897_12_16_for_8897_org/bridge/mfgbridge
./mnt/host/source/src/third_party/marvell/eric/bridge_p98/bridge_linux_0.1.0.30/bridge/mfgbridge
./mnt/host/source/src/third_party/marvell/labtool_8897_12_26/bridge_android/mfgbridge
./mnt/host/source/src/third_party/marvell/labtool_8897_12_26/bridge/mfgbridge
$cd /mnt/host/source/src/third_party/marvell/labtool_8897_12_26/DutApiWiFiBt
$make clean
$make
$cd /mnt/host/source/src/third_party/marvell/labtool_8897_12_26/bridge
$make clean
$make

개발 & 수정하기

앞서 labtool 에 대해 설명했지만, labtool 은 실행 후 명령어(command)를 입력하여 원하는 동작을 확인하는 테스트 프로그램이다.

삼성의 요청에 의해 labtool 코드가 수정되거나 새로운 기능을 추가해야 하는 일이 빈번한데, 이런 경우 대부분은 기존의 명령어를 수정하거나, 새로운 명령어를 추가하는 작업이다.

따라서 수정이 일어나는 곳은 몇 군데로 요약할 수 있다. 주요한 함수들을 살펴보겠다.

labtool 을 실행했을 때, 출력되는 메뉴들과 이를 선택했을 때 호출되는 함수들을 정의하고 있다.

int WifiMenu(int OptionMode, void** theObj=0)
{
    int     status=0, vgcCtrl=0, BandAG=0, lnaMode = 0, Cnt = 0; 
...
 
        case 21: // Set Carrier Suppresion
            status = DutIf_SetBeaconInterval(parm1);
            DebugLogRite(" DutIf_SetBeaconInterval: 0x%08X\n", status);
            break;
 
        case 111:   // Set WL_ACTIVE / TX_CONF line
            {
                int bw=0;
                DebugLogRite("DutIf_GetChannelBw: 0x%08X\n",
                    DutIf_GetChannelBw(&bw));
                DebugLogRite("Channel Bw: %d\n", bw);
            }
            break;
...

따라서 특정 명령어에서의 동작 시퀀스를 알고 싶다면, 가장 먼저 위의 함수부터 시작하는 것이 좋다.
이제 몇가지 사례를 들어 실제 개발 하는 프로세스를 설명하겠다.

삼성에서 BT MAC 주소를 OTP 영역에 쓰고, CalBtDataFile.txt 파일 내의 BdAddress 항목에 MAC 주소를 write 해 달라는 요청이 들어왔다.
가장 먼저 확인해야할 사항은 labtool 에서 OTP 를 write 하는 명령어와 그에 관련한 루틴을 살펴보는 일이다. OTP 에 write 하는 명령어 번호는 149 번이다.

이제 labtool/DutApiWiFiBt/w878X_WifiMimo.cpp 의 WifiMenu 함수 내의 해당 명령어 루틴을 보자.

...
        case 149: //Write user data to OTP
            {
                int status=0, Extension=0;
                int NumCalOTP=0, NumDoneOrIncr=0;
 
                if (!Dut_Shared_SupportOTP())
                {
                    DebugLogRite("\tCurrent Storage Type is set to: %d, Not OTP\n", Dut_Shared_GetStorageType(DeviceId));
                }
                else
                {     
                    status = DutIf_WriteUserDataOTP(&Extension, NULL);               // 실제 데이터를 OTP 에 쓰는 함수로서 trace 한다
                    DebugLogRite("  DutIf_WriteUserDataOTP: 0x%d\n", status);
                    switch(status)
                    {
                        case 0:
                            DebugLogRite("\nSuccessfully Write User Data to OTP\n");
                            break;
                        case 1:
                            DebugLogRite("\nFail to write User Data to OTP, WritePatchBlockOTP(): %d\n", status);
                            DebugLogRite("Please check if this DUT supports OTP\n");
                            break;
                        case 2:
                            DebugLogRite("\nThe specified user data file doesn't exist\n");
                            break;
                        case 3:
                            DebugLogRite("\nThe user data file is empty\n");
                            break;
                        case 4:
                            DebugLogRite("\nThe length of user data file must be N times of 8 BYTE\n");
                            break;
                        case 5:
                            DebugLogRite("\nFail to check OTP free lines\n");
                            break;
                        case 6:
                            DebugLogRite("\nSize of the user data file excesses free OTP lines\n");
                            break;
 
                        default: status = ERROR_ERROR;
                    }
                }
                break;
            }
...

실제적인 동작 함수인 DutIf_WriteUserDataOTP() 를 추적하기 위해 labtool/DutApiWiFiBt/DutWlanApi878XDll/DutWlanApi878XDll.cpp 파일을 보자.

DUT_WLAN_API int STDCALL DutIf_WriteUserDataOTP(int *Extension, char *filename)
{
    return WLAN_OBJ WriteUserDataOTP(Extension, filename);                // 계속 trace 한다
}

WriteUserDataOTP() 를 찾아 labtool/DutApiWiFiBt/DutWlanApi878XDll/DutWlanApiClss.cpp 파일을 보자.

int DutWlanApiClssHeader WriteUserDataOTP( int  *pExtension, 
                                            char *fileName)
{
    int     status = 0, temp, i;
    int     *pFreeLinesOTP, UserDataSize = 0; 
    off_t   m_size = 0, SizeInLinesOTP;//SizeInDword;
    char    line[_MAX_PATH]="";
    char    *UserDataFileName;
    char    DefaultOTP_DataFileName[_MAX_PATH]="CalRevDataOTP.bin";     // jeremy
    char    FileName[_MAX_PATH]="";
    DWORD   *pDataBuff = NULL;
    DWORD   DataBuff[400] = {0}; 
    DWORD   CheckBuff;
    BYTE    UserSignBlock=0;
    FILE    *hFile = NULL;
 
    pFreeLinesOTP = &temp;
    pDataBuff = &DataBuff[0];
 
    if (fileName)
    {    
        strcpy(FileName, fileName);
    }    
    else 
    {    
        DebugLogRite("  Blank ENTER to use default user data file name: %s\n", DefaultOTP_DataFileName);
        DebugLogRite("  Or enter user defined data file name:");
    //  fgets(line, sizeof(line), stdin);
    //  sscanf(line, "%s", FileName);
    //  if(!FileName[0])
        strcpy(FileName, DefaultOTP_DataFileName);  
        DebugLogRite("  User Data File Name: %s\n", FileName);
    }    
 
    m_size = filelength(FileName);
    UserDataSize = m_size;
 
    if (m_size < 0) 
    {    
        status = 2; 
        return status;
    }    
    else if (m_size == 0)
    {    
        status = 3; 
        return status;
    }    
    else 
    {    
#ifndef _LINUX_ 
        SizeInLinesOTP = round(UserDataSize/BytePerOTP_Lines);
#else
        SizeInLinesOTP = mround(UserDataSize/BytePerOTP_Lines);
#endif
        if(double(SizeInLinesOTP) != (double(UserDataSize)/double(BytePerOTP_Lines)))
        {
            status = 4;
            return status;
        }
        status = Cf_GetFreeLinesInOTP(pExtension, pFreeLinesOTP);
        if(status)
        {
            status = 5;
            return status;
        }
        if ((*pFreeLinesOTP + 1) < (UserDataSize / BytePerOTP_Lines))
        {
            status = 6;
            return status;
        }
        else
        {
            pDataBuff = (DWORD *)malloc(UserDataSize+1);
            memset(pDataBuff, UserDataSize, 0);
 
            i = 0;
 
            hFile = fopen(FileName, "rb"); // check this  
            if (NULL == hFile)
            {
                return 1;
            }
            do
            {
                fread(pDataBuff + i, 4, 1, hFile);
                i++;
            }while (i < SizeInLinesOTP*2);
 
            status = Cf_WriteUserDataOTP(UserSignBlock, UserDataSize, pDataBuff);
            if(status)
            {
                status = 1;
                return status;
            }
        }
    }
    return  status;
}

가장 먼저 기능 구현을 위한 함수 작성을 상기 파일에 하였다.

#define CONF_FILE    "./CalBtDataFile.txt"
#define READ_CONF_FILE    "./CalBtDataFile.txt"
#define    ITEM        40
#define    LENGTH        100
#define LINE_BUF 512
 
#define  BUFF_SIZE   1024
#define  FILENAME   "CalBtDataFile.txt"
#define  BD         "BdAddress"
#define  NEW_FILE   "CalBtDataFile.txt-new"
 
void clarify_number(const char *str, char *buf)                // 인자 112233445566 를 11.22.33.44.55.66 으로 변경하는 함수 
{
    int len; 
 
    len = strlen(str);
    assert(len > 0);  
 
    while (*str) {
        *buf++ = *str++;
        if (--len && (len % 2) == 0)
            *buf++= '.'; 
    }    
 
    *buf = '\0';
}
 
int write_bdaddr(char* bdaddr)       //   CalBtDataFile.txt 파일에서 BdAddress 항목의 값을 인자 값으로 수정하는 함수
{
    char buf[BUFF_SIZE]={0,};
    char  buff[BUFF_SIZE];
    FILE *fp; 
    int line=0;
 
    sprintf(buf, "grep -n %s %s | awk -F: '{print $1}'", BD,FILENAME);  
 
    fp = popen( buf, "r");
    if ( NULL == fp)  
    {    
        perror( "popen() fail");
        return -1;  
    }    
 
    while( fgets( buff, BUFF_SIZE, fp) )
    {    
        line = atoi(buff);
    }    
 
    pclose(fp);
 
    sprintf(buf,"sed '%dd' %s > %s", line, FILENAME, NEW_FILE);
 
    system(buf);
 
    sprintf(buf, "sed -e '%d i BdAddress=%s' %s > %s && rm -f %s", line, bdaddr, NEW_FILE, FILENAME,NEW_FILE );
 
    system(buf);
 
    return 0;
}
/*
    function : MRVL_RFT_SetBDAddres
    date : 12-17-2013
    description :
    added 12-17 for reading BdAddress from CalBtDataFile_upload.txt after writing Cal data to CalBtDataFile_upload.txt.
*/
int MRVL_RFT_SetBDAddres(char *MacAddrC)
{
    int     Len=0, MAC_Err=0, status =0;
    char buff[1024]={0,};
    char    MacAddr[MAC_AddrByte]={0};
 
    MAC_Err = MacAddrValidation(MacAddrC);
    if(MAC_Err)
    {
        DebugLogRite ("\nInvalid MAC Address: %s\n", MacAddrC);
        status = ERROR_ERROR;
        return status;
    }
    Len = sscanf(MacAddrC, "%02X%02X%02X%02X%02X%02X",
            &MacAddr[0], &MacAddr[1], &MacAddr[2],
            &MacAddr[3], &MacAddr[4], &MacAddr[5]);                    // MacAddr 은 '112233445566' 형태의 데이터로 저장됨
 
    clarify_number((char*)MacAddr, buff);                                // buff 에는 11.22.33.44.55.66 형태의 데이터가 저장됨
 
    status = write_bdaddr(buff);                                              // CalBtDataFile.txt 파일에서 BdAddress 항목에 buff 데이터로 write 함
 
    if(status)
        DebugLogRite(" Fail at DutIf_SetMACAddress\n");
    else
        DebugLogRite(" MAC Address Saved: %02X%02X%02X%02X%02X%02X\n",
            MacAddr[0], MacAddr[1], MacAddr[2],
            MacAddr[3], MacAddr[4], MacAddr[5]);
 
    return status;
}
#rfTest.sh lucas2 13 
#cd /mnt/stateful_partition/mwifiex
#./initial.sh
#./labtool --bridge -c 24f5aabbccdd=24f5aabbccde             // Prompt 나오면, 위쪽으로 6번째 줄쯤에 OTP Success 나오는지 확인
#./labtool --bridge -r (버젼 정보 확인)
#rfTest.sh lucas2 14

ifconfig, hciconfig 명령어로 WiFi / BT MAC 을 각각 확인한다.

메뉴 설명

lucas2 에서 가장 핵심이 되는 rfTest.sh 스크립트의 메뉴 설명이다. 참고로 이 파일은 /sbin 디렉토리 아래에 있다.

#rfTest.sh lucas2
stop: Unknown instance: 
iptables v1.4.16.3: -P requires a chain and a policy
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.4.16.3: -P requires a chain and a policy
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.4.16.3: -P requires a chain and a policy
Try `iptables -h' or 'iptables --help' for more information.
cp: cannot stat '/tmp/lucasTool/rfTest.sh': No such file or directory
Wrong Parameter: ./rfTest.sh [lucas1/lucas2][1~18]
	01: Install Labtool Package
	02: Install EndPoint
	03: Install Bluetooth Cal. Driver
	04: Run labtool for local
	05: Run labtool for bridge with 192.168.100.100       // 타겟 IP 주소를 192.168.100.100 으로 변경후, labtool 실행, 보통 장비에 연결하여 측정할 때 주로 사용함
	06: Run labtool for bridge with DHCP
	07: Run remote-labtool for bridge(COB)          // 원격 상에서 labtool 을 사용할 때(특히 윈도우 labtool) bridge 를 실행하는 모드
	08: Run endpoint
	09: Run bluetooth test                                  // BT 신호세기 측정 시 사용함
	10: Run bluetooth test in Labtool Test Mode
	11: Run WIFI TIS/TRP DHCP Test Mode
	12: Change rootfs mode
	13: Change to Labtool Test Mode             // Labtool 사용할 시에는 이 모드를 사용해야 함
	14: Change to NormalMode                     // Normal mode 로 변경함. Labtool 모드에서 세팅 후 이를 확인할 때, 이 모드로 변경하여 확인함
	15: Change firewall and power mode
	16: Static IP with 192.168.0.111
	17: disabled DHCP & Static IP with 192.168.100.100
	18: Set Sigma for Marvell 11AC

rfTest.sh 분석

실제 rfTest.sh 파일을 분석해보자.

#!/bin/bash
 
stop powerd        // powerd 프로세스 중지(kill)
iw dev mlan0 set power_save off              //  
 
 
 
iptables --policy INPUT ACCEPT
iptables --policy FORWARD ACCEPT
iptables --policy OUTPUT ACCEPT
 
 
iptables -P INPUT -j ACCEPT
iptables -P OUTPUT -j ACCEPT
iptables -P FORWARD -j ACCEPT
 
iptables -I INPUT -p udp -j ACCEPT
iptables -I OUTPUT -p udp -j ACCEPT
iptables -I FORWARD -p udp -j ACCEPT
 
 
sudo mount -o remount,exec /mnt/stateful_partition
sudo mount -o remount,rw /
sudo mount -o remount,rw /mnt/stateful_partition
 
cp /tmp/lucasTool/rfTest.sh /sbin
 
if [ $# -lt 2 ]; then
 
printf "Wrong Parameter: ./rfTest.sh [lucas1/lucas2][1~18]\n"
printf "\t01: Install Labtool Package\n"
printf "\t02: Install EndPoint\n"
printf "\t03: Install Bluetooth Cal. Driver\n"
printf "\t04: Run labtool for local\n"
printf "\t05: Run labtool for bridge with 192.168.100.100\n"
printf "\t06: Run labtool for bridge with DHCP\n"
printf "\t07: Run remote-labtool for bridge(COB)\n"
printf "\t08: Run endpoint\n"
printf "\t09: Run bluetooth test\n"
printf "\t10: Run bluetooth test in Labtool Test Mode\n"
printf "\t11: Run WIFI TIS/TRP DHCP Test Mode\n"
printf "\t12: Change rootfs mode\n"
printf "\t13: Change to Labtool Test Mode\n"
printf "\t14: Change to NormalMode\n"
printf "\t15: Change firewall and power mode\n"
printf "\t16: Static IP with 192.168.0.111\n"
printf "\t17: disabled DHCP & Static IP with 192.168.100.100\n"
printf "\t18: Set Sigma for Marvell 11AC\n"
exit
fi
 
   if [ $2 -eq 1 ]; then
      printf  "Input:1\n"
          cp -rf /tmp/lucasTool/$1/mwifiex/ /mnt/stateful_partition
          sync
          cp -rf /tmp/lucasTool/$1/mfgbridge/ /mnt/stateful_partition
          sync
  elif [ $2 -eq 2 ]; then
      printf "Input:2\n"
          cp -rf /tmp/lucasTool/$1/end_arm/ /mnt/stateful_partition
          sync
          cd /mnt/stateful_partition/end_arm;tar xvf end_arm.tar
  elif [ $2 -eq 3 ]; then
      printf "Input:3\n"
          cp -rf /tmp/lucasTool/$1/bt_cal_driver/ /mnt/stateful_partition
          sync
          /mnt/stateful_partition/bt_cal_driver/copy_driver.sh
   elif [ $2 -eq 4 ]; then
      printf "Input:4\n"
          cd /mnt/stateful_partition/mwifiex;/mnt/stateful_partition/mwifiex/initial.sh
          cd /mnt/stateful_partition/mwifiex;/mnt/stateful_partition/mwifiex/labtool
   elif [ $2 -eq 5 ]; then
      printf "Input:5\n"
          ifconfig eth0 192.168.100.100 up
          cd /mnt/stateful_partition/mwifiex/;/mnt/stateful_partition/mwifiex/initial.sh
          cd /mnt/stateful_partition/mwifiex/;/mnt/stateful_partition/mwifiex/labtool --bridge -d 112233445566
   elif [ $2 -eq 6 ]; then
      printf "Input:6\n"
          cd /mnt/stateful_partition/mwifiex/;/mnt/stateful_partition/mwifiex/initial.sh
          cd /mnt/stateful_partition/mwifiex/;/mnt/stateful_partition/mwifiex/labtool --bridge -d 112233445566
   elif [ $2 -eq 7 ]; then
     printf "Input:7\n"
          cd /mnt/stateful_partition/mfgbridge;/mnt/stateful_partition/mwifiex/initial.sh
          ifconfig eth0 192.168.100.10 up
          cd /mnt/stateful_partition/mfgbridge;/mnt/stateful_partition/mfgbridge/mfgbridge
   elif [ $2 -eq 8 ]; then
     printf "Input:8\n"
          /mnt/stateful_partition/end_arm/endrun.sh
   elif [ $2 -eq 9 ]; then
      printf "Input:9\n"
          hciconfig hci0 reset
          hciconfig hci0 up
          hciconfig hci0 piscan
          hcitool -i hci0 cmd 0x06 0x03
   elif [ $2 -eq 10 ]; then
      printf "Input:10\n"
          cd /mnt/stateful_partition/mwifiex;/mnt/stateful_partition/mwifiex/insmod_bt.sh
          hciconfig hci0 reset
          hciconfig hci0 up
          hciconfig hci0 piscan
          hcitool -i hci0 cmd 0x06 0x03
 
   elif [ $2 -eq 11 ]; then
      printf "Input:11\n"
      stop powerd
      iw dev mlan0 set power_save off
 
 
   elif [ $2 -eq 12 ]; then
      printf "Input:12\n"
      sudo /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification
      sudo /usr/share/vboot/bin/make_dev_ssd.sh --partition 2 --remove_rootfs_verification
      sudo /usr/share/vboot/bin/make_dev_ssd.sh --partition 4 --remove_rootfs_verification
          sudo reboot
   elif [ $2 -eq 13 ]; then
      printf "Input:13\n"
     /mnt/stateful_partition/mwifiex/backup.sh
   elif [ $2 -eq 14 ]; then
      printf "Input:14\n"
     /mnt/stateful_partition/mwifiex/backup_restore_wifi_bt.sh
   elif [ $2 -eq 15 ]; then
      printf "Input:15\n"
 
 
        iptables --policy INPUT ACCEPT
        iptables --policy FORWARD ACCEPT
        iptables --policy OUTPUT ACCEPT
 
         iptables -P INPUT -j ACCEPT
         iptables -P OUTPUT -j ACCEPT
         iptables -P FORWARD -j ACCEPT
 
 
        iptables -I INPUT -p udp -j ACCEPT
        iptables -I OUTPUT -p udp -j ACCEPT
        iptables -I FORWARD -p udp -j ACCEPT
 
   elif [ $2 -eq 16 ]; then
      printf "Input:16\n"
      ifconfig mlan0 down
      iwconfig mlan0 essid test
      ifconfig mlan0 192.168.0.111 netmask 255.255.255.0 up
      route add default gw 192.168.0.1
   elif [ $2 -eq 17 ]; then
        printf "Input:17\n"
 
         echo 1 > /usr/share/power_manager/disable_idle_suspend
         stop powerd
         stop shill
         su wpa -s /bin/bash -c 'wpa_cli add_network'
         su wpa -s /bin/bash -c 'wpa_cli set_network 0 ssid \"wevo\"'
         su wpa -s /bin/bash -c 'wpa_cli set_network 0 key_mgmt NONE'
         su wpa -s /bin/bash -c 'wpa_cli select_network 0'
         ifconfig mlan0 192.168.0.111 netmask 255.255.255.0 up
         iw mlan0 link
         iw dev mlan0 set power_save off
   elif [ $2 -eq 18 ]; then
        printf "Input:18\n"
 
          cp -rf /tmp/lucasTool/$1/sigma/ /mnt/stateful_partition
          sync
          cd /mnt/stateful_partition/sigma;/mnt/stateful_partition/sigma/initial.sh
          sync
else
      printf "Wrong Input Vaule\t"
    fi
 
sync

FAQ

앞서 설명했듯이 rfTest.sh 스크립트를 사용하여 여러가지 테스트를 해볼 수 있는데, 여기서는 BT 의 관련한 성능 테스트를 할 수 있는 방법에 대해 설명하겠다.
BT 는 Wi-Fi 와 마찬가지로 2.4GHz 대역을 사용하고 있는 무선 프로토콜 중 하나다. lucas2 보드에 탑재된 8897 칩은 Wi-Fi 와 BT 를 지원한다.

타겟보드를 보면, 안테나 출력 부분이 두 군데(MAIN, AUX) 인 것을 볼 수 있다. MAIN 은 Wi-Fi 전용이며, BT 는 AUX 안테나를 사용한다. 따라서 BT 를 측정하려면, 장비에 연결된 케이블을 AUX 쪽에 연결해야 한다.
참고로 BT 의 신호세기를 측정하기 위한 장비로 Aglient 사의 N4010A 를 사용한다.

신호세기 측정은 Normal 모드에서 진행해야 한다.

#rfTest.sh lucas2 14    // 실행하면 재부팅하게 된다, 이후 로그인하여 프롬프트 쉘로 진입한다
#rfTest.sh lucas2 9
< HCI Command: ogf 0x06, ocf 0x0003, plen 0
> HCI Event: 0x0e plen 4
  01 1A 0C 00

측정 장비와 타겟보드를 연결하고, 장비의 'Run/Resume' 버튼을 누른다. 화면에 Test Plan Results 가 출력되면서 각 항목별로 측정을 시작한다.
첫번째 항목인 'Output Power' 가 'PASS' 면, 오른쪽의 'Detailed Results' 옆의 버튼을 누른다.

화면이 전환되면서, 아래와 같은 표가 보일 것이다.

Summary
Min Avg(dBm) 10.40
Max Avg(dBm) 11.05
Max Peak(dBm) 11.13

아래와 같이 실행한다.
<code text>
#./labtool –bridge -c 112233445581=112233445582
<code>

Normal mode 는 일반적인 사용자 사용 모드라고 볼 수 있다. 그에 반해 Labtool Test mode 는 테스트를 목적으로 하는 모드다. 이 두가지의 가장 큰 차이점은 Firmware 의 차이라고 하겠다.
official 과 mfg firmware 의 차이다. 또한 특정 파티션의 rw 가능 여부 또한 그렇다.
따라서 labtool 을 사용하여 작업을 해야 한다면, 반드시 Labtool Test mode 로 진입하여야 하고, 작업 이후에 다시 Normal mode 로 변경하여 제대로 적용이 되었는지 확인해야 한다.

최신 MFG 코드 다운로드

MFG F/W 가 업데이트 되었다고 해서 삼성에 릴리즈할 필요는 없다. 최신 코드는 '\\swrel\swrel\ENG_Internal_Release\mfg_rc\W8897\MFG-W8897-MF-LABTOOL-FC18' 에서 받을 수 있다.

  • computer/marvell/mfg_tool_핵심가이드.txt
  • Last modified: 4 years ago
  • by likewind