RTL8722 BLE config

Hi:
我想要測 Ble wificonfig 根據manual 設定
#define CONFIG_BT_EN 1
#define CONFIG_BT 1
#define CONFIG_BT_CONFIG 1
and
#define FTL_MEM_CUSTEM 1
接著 download image ,輸入 ATBB=1 出現以下log

#ATBB=1
[ATBB]:AT_BT_CONFIG[ON]

trace_uart_init: TRACE OPEN

[BT Config Wif
i] bt_configthis_app_task_in is BT NORMit
AL DRIVER
****,
this cut is AmebaD C CUT

BT BUILD Date: 2022/06/20-21:55:31

==logic_efuse:==

b8:
4d:
43:
46:
d1:
3:
a:
3:
ff:
ff:
ff:
ff:
23:
23:
ff:
ff:
48:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
==bt phy_efuse 0x120~0x12F:==

0:
9e:
fe:
eb:
0:
fb:
3:
13:
19:
0:
f0:
f:
21:
20:
ff:
ff:
==bt phy_efuse 0x1FD~0x1FF:==

ff:
ff:
BT FW LOG OPEN
BT Reset…
physical efuse: has data hci_tp_phy_efuse[1]= 9e

hci_tp_phy_efuse[0]=0,
bt_iqk_dump: DUMP,
the IQK_xx data is 0xeb,
the IQK_yy data is 0x3fb,
the QDAC data is 0x21,
the IDAC data is 0x20,
hci_read_rom_check: rom_version 0x0002, bt_hci_chip_id 0x0003

We use DEBUG VAL:0xbd106008

We use BT ROM OTA2 PATCH ADDRESS:0x81f8000

Wrong patch head ff ff ff ff

hci_read_rom_check: error operate

Any advice?
謝謝

有点像芯片内部设置出了问题。
用的是 8722DM 芯片吗?是开发板还是模组?从哪里买的?

HI:
從這裡買的
https://shopee.tw/iCshop-Ameba-RTL8722DM-mini-Board-(AMB-23)●368030501635●IOT-i.15050169.14578709472?sp_atk=9c3bb010-883c-4e56-ac56-1ec0289b70f9&xptdk=9c3bb010-883c-4e56-ac56-1ec0289b70f9

使用的是 latest github.
Compile tool :IAR
請問修改這個需要所有project 重 build 嗎?我只有重build km4 application 然後就download 到板子上,會有影響嗎?

应该不需要全部重新 build,km0_bootloader, km0_application, km4_bootloader 应该只需要上次 build 过就行

刚下载用 IAR compile 了没问题。或许你可以试试我compile 的 bin:
ATBB Binaries.7z.xml (431.7 KB)
下载文件后把 .xml extension 删掉再解压

Ok , I will try it later .thanks

still got same problem
#ATBB=1
[ATBB]:AT_BT_CONFIG[ON]

trace_uart_init: TRACE OPEN

[
***BT **thConfig Wifi]is is BT NO bt_config_aRMAL DRIVERpp_task_init *,

this cut is AmebaD C CUT

BT BUILD Date: Wed 22/06/-14:03:57

==logic_efuse:==

b8:
4d:
43:
46:
d1:
3:
a:
3:
ff:
ff:
ff:
ff:
23:
23:
ff:
ff:
48:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
ff:
==bt phy_efuse 0x120~0x12F:==

0:
9e:
fe:
eb:
0:
fb:
3:
13:
19:
0:
f0:
f:
21:
20:
ff:
ff:
==bt phy_efuse 0x1FD~0x1FF:==

ff:
ff:
BT FW LOG OPEN
BT Reset…
physical efuse: has data hci_tp_phy_efuse[1]= 9e

hci_tp_phy_efuse[0]=0,
bt_iqk_dump: DUMP,
the IQK_xx data is 0xeb,
the IQK_yy data is 0x3fb,
the QDAC data is 0x21,
the IDAC data is 0x20,
hci_read_rom_check: rom_version 0x0002, bt_hci_chip_id 0x0003

We use DEBUG VAL:0xbd106008

We use BT ROM OTA2 PATCH ADDRESS:0x81f8000

Wrong patch head ff ff ff ff

hci_read_rom_check: error operate
我稍微trace 了一下似乎會在下列 function 中進入 ota_get_cur_index() == OTA_INDEX_1
這個case,然後check MERGE_PATCH_ADDRESS_OTA2(0x81f8000),是否有合法的 “patched” code,很顯然在我的platform是沒有的,這個行為看起來應該不正常.

uint8_t *hci_find_patch_address(void)
{
if(!CHECK_SW(EFUSE_SW_DRIVER_DEBUG_LOG))
{
hci_board_debug(“\nWe use DEBUG VAL:0x%x\n”, HAL_READ32(0x08000000, 0x3028));
}

if(CHECK_SW(EFUSE_SW_USE_FLASH_PATCH))
{
    //1
    return (uint8_t *)rltk_bt_get_patch_code();
}
else if (ota_get_cur_index() == OTA_INDEX_1)
{
    hci_board_debug("\nWe use BT ROM OTA2 PATCH ADDRESS:0x%x\n", MERGE_PATCH_ADDRESS_OTA2);
    HCI_PRINT_INFO1("\nWe use BT ROM OTA2 PATCH ADDRESS:0x%x\n", MERGE_PATCH_ADDRESS_OTA2);
    return (uint8_t *)MERGE_PATCH_ADDRESS_OTA2;
}
else
{
    hci_board_debug("\nWe use BT ROM OTA1 PATCH ADDRESS:0x%x\n", MERGE_PATCH_ADDRESS_OTA1);
    HCI_PRINT_INFO1("\nWe use BT ROM OTA1 PATCH ADDRESS:0x%x\n", MERGE_PATCH_ADDRESS_OTA1);
    return (uint8_t *)MERGE_PATCH_ADDRESS_OTA1;
}

}

这是全新的开发板吗?以前有没有上传过 OTA 的 code?
可以尝试一下把 flash 全部删空,然后再上传 image.

我找到問題了 system.bin 要打勾
CHECK_SW(EFUSE_SW_USE_FLASH_PATCH) 會去尋找system.bin (0x8003000) 的內容
如果true 就會從rltk_bt_get_patch_code() 拿到 patched code.目前你給的binary是可以work了.
if(CHECK_SW(EFUSE_SW_USE_FLASH_PATCH))
{
//1
return (uint8_t *)rltk_bt_get_patch_code();
}

1 Like

我的build也ok了