手机MODEM 开发(24)---93 modem如何打开GSM AMR-WB

xiaoxiao2021-02-28  40

93 modem如何打开GSM AMR-WB    93 modem如何打开GSM AMR-WB       

请完成以下四步:

1. 确保__AMR_WB_WHITE_LIST__ 和__AMRWB_LINK_SUPPORT__ 打开(如需验证,可以在mcu\build\[project]\[flavor]\bin\log\info.log中确认)

2. 修改NVRAM_EF_MSCAP_LID (以下两种方法均可,实际改动的效果相同)

(1) 通过meta tool读出NVRAM_EF_MSCAP_LID,将其中的speech_version_byte2改为02

(2) 或找到l4_nvram_def.c中的COMMON_NVRAM_EF_MSCAP_DEFAULT[],确认一下是否为以下内容。如果不是,请修改成以下

const kal_uint8 COMMON_NVRAM_EF_MSCAP_DEFAULT[NVRAM_EF_MSCAP_SIZE] =

{

/* Byte 1~4 describes MS supported codec

* 1. Codec types is coded as the definition in TS26.103, Sec. 6.2, Codec Bitmap

* 2. Spec Codec Bitmap combines GSM and UMTS together, whereas we separate codec

* types according to different radio access technologies. So GAS can directly

* read first 2 bytes for speech capability.

*/

#if defined(__AMR_SUPPORT__)

 0x1f, /* Supported speech version (FR,HR,EFR,AMR FR,AMR HR) */

#else

 0x07, /* Supported speech version (FR,HR,EFR) */

#endif

//0528_AMRWB: Restructure EF_MSCAP, put speech codec bytes together

#if defined(__AMRWB_LINK_SUPPORT__)

#if defined(__AMR_WB_WHITE_LIST__)

 0x02, /* byte 2 for GSM supported codec, (FR AMRWB) */

#else

 0x00, /* byte 2 for GSM supported codec */

#endif

#else

 0x00, /* byte 2 for GSM supported codec */

 

3. 查看meta tool确认在NVRAM_EF_SBP_MODEM_CONFIG_LID是否包含AMR_WB_GSM

(1) 如果没有NVRAM_EF_SBP_MODEM_CONFIG_LID或NVRAM_EF_SBP_MODEM_CONFIG_LID不包含AMR_WB_GSM,修改 mcu\custom\common\ps\Custom_l4_utility.c中的custom_check_white_list()如下:

void custom_check_white_list(kal_bool * is_gsm_white_list,kal_bool * is_umts_white_list,kal_uint32 plmn_id)

{

#ifdef __AMR_WB_FOR_T_MOBILE__  

    /* *is_gsm_white_list =KAL_TRUE; means that MS support AMR_WB in 2G rat of the selected PLMN*/

    /*check 2G white_list plmn [byte2:mcc1,mcc2; byte1:mcc3,mnc1; byte0:mnc2,mnc3]*/

    switch(plmn_id)

    {

    /*Please add white plmn list as specified below:

        case 0x0046000f:

        case 0x0046002f:

            *is_gsm_white_list =KAL_TRUE;

            break;

    */           

        default:

                      *is_gsm_white_list =KAL_FALSE;

            break;

    }         

#else

#ifdef __AMR_GSM_IOT_SUPPORT__

    *is_gsm_white_list =KAL_TRUE;

#else

    *is_gsm_white_list =KAL_TRUE; /*这是表示2G支持AMRWB*/

#endif

#endif   

#ifdef __OP11__

    /* *is_umts_white_list =KAL_TRUE; means that MS support AMR_WB in 3G rat of the selected PLMN*/         

    /*check UMTS white_list plmn [byte2:mcc1,mcc2; byte1:mcc3,mnc1; byte0:mnc2,mnc3]*/

    switch(plmn_id)          

    {

    /*Please add white plmn list as specified below:      

        case 0x0046000f:

        case 0x0046002f:

            *is_umts_white_list =KAL_TRUE;

            break;

    */            

        default:

                      *is_umts_white_list =KAL_FALSE;

                      break;

    }

#else

  #ifdef __SP_RIL_SUPPORT__

    *is_umts_white_list =KAL_FALSE;

  #else

    *is_umts_white_list =KAL_TRUE;    /*这是表示3G支持AMRWB*/

  #endif 

#endif   

    return ;

}

#endif

4. 在该项目的makefile文件中添加:CUSTOM_OPTION += __AMR_WB_GSM__ 

 

Note:改过之后要replace modem load并且format MD NVRAM。

 

Replace Modem load:

         把modem 的bin file重命名为img并放在adb.exe路径下   Using the following command     adb remount    adb push modem.img /system/etc/firmware/modem.img    adb shell sync     adb shell reboot

format MD NVRAM方法:

   Using the following command     adb shell    cd data/nvram    rm –r md    reboot

 

(2) 如果有NVRAM_EF_SBP_MODEM_CONFIG_LID且包含AMR_WB_GSM(以下两种方法均可,实际改动的效果相同)

a. 通过meta tool读出NVRAM_EF_SBP_MODEM_CONFIG_LID,并将AMR_WB_GSM改成enable

b. 或通过SBP找到nvram_data_items.c中的VRAM_EF_SBP_MODEM_CONFIG_DEFAULT[]函数,里面有AMR_WB_GSM这一项,将其enable(这个实际上是修改了NVRAM_EF_SBP_MODEM_CONFIG_LID)。具体可以参考以下FAQ:

FAQ12660 [SBP]Modem如何修改一个SBP feature的值?

尤其是以下部分:

[2]这个feature是定义在除NVRAM_EF_SBP_MODEM_CONFIG_LID/NVRAM_EF_SBP_MODEM_DATA_CONFIG_LID;

 

修改后需要在该项目的makefile文件中添加:CUSTOM_OPTION += __AMR_WB_GSM__ 

 

转载请注明原文地址: https://www.6miu.com/read-2623543.html

最新回复(0)