Index: ModuleDemo/25_OTA/bt_demo/BT/patch/patch.prog
===================================================================
--- /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/BT/patch/patch.prog	(revision 4611)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/BT/patch/patch.prog	(working copy)
@@ -2589,6 +2589,14 @@
 	//rtn blank
 	fetch 1,mem_sp_state
 	nrtn blank			// avoid re-entry
+	
+	call context_search_plap
+	nrtn zero
+
+	// check if is master or slave 
+	add rega,coffset_mode,contr
+	ifetch 1,contr
+	rtnbit0 mode_master
 	call p_hci_send_io_cap_req_event
 	jam 0x01,mem_io_cap_flag //io cap req
 	rtn
Index: ModuleDemo/25_OTA/bt_demo/BT/sched/user.dat
===================================================================
--- /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/BT/sched/user.dat	(revision 4611)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/BT/sched/user.dat	(working copy)
@@ -188,7 +188,7 @@
 
 # debug log define
 #mem_param_debug_log_mem_block_start_addr
-mem_param_debug_log_func_enable:00
+mem_param_debug_log_func_enable:01
 
 mem_param_debug_log_initial_flag_addr:10 db 01
 mem_param_debug_log_lock_flag_cm0_addr:11 db 01
Index: ModuleDemo/25_OTA/bt_demo/CM0/respin/ramcode.rom
===================================================================
--- /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/respin/ramcode.rom	(revision 4611)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/respin/ramcode.rom	(working copy)
@@ -75,56 +75,56 @@
 c01d0168
 c01f0216
 c02081e6
-c02206b9
-c02a06b5
-c02c061f
-c02e063b
-c02e8641
-c03506bb
-c03586bd
+c02206c7
+c02a06c3
+c02c062d
+c02e0649
+c02e864f
+c03506c9
+c03586cb
 c03601dd
 c04080eb
 c0428109
 c04300ce
 c04f00d2
 c050014b
-c052069e
-c0540690
-c05c86bf
+c05206ac
+c054069e
+c05c86cd
 c05d05b1
 c0700142
 20202baf
-c00386c1
+c00386cf
 c006023e
-c00906c3
+c00906d1
 c0098558
 c00a0537
 c011854b
-c0128643
-c0130647
-c0138649
-c014064b
-c014864c
-c0150651
+c0128651
+c0130655
+c0138657
+c0140659
+c014865a
+c015065f
 c01d83b1
 c01f03ba
 c01f8363
 c02084c0
-c0210687
+c0210695
 c0240467
 c02584c4
 c0278443
 c02905d0
-c02c06c5
+c02c06d3
 c02d85e9
-c02e86c7
+c02e86d5
 c03005f3
 c03205ef
-c0370667
-c03806c9
-c03886cb
+c0370675
+c03806d7
+c03886d9
 c03a014d
-c0490652
+c0490660
 c0528602
 c0530602
 c1590000
@@ -145,7 +145,7 @@
 20407148
 7d3a001c
 243a209e
-202006cd
+202006db
 6fe24133
 c4008000
 6fe20030
@@ -335,8 +335,8 @@
 204052b0
 6fe20048
 207a0000
-202006cf
-204006d1
+202006dd
+204006df
 2020022d
 6fe2004b
 79207e03
@@ -380,21 +380,21 @@
 207a0000
 6fe2007c
 247a0000
-202006d3
+202006e1
 704c9b02
 704c8a00
 20200184
 704c9b00
 704ca100
 704c9f00
-202006d5
+202006e3
 6fe24c9a
-203a06d7
+203a06e5
 6fe24c99
-203a06cd
+203a06db
 1fe0ffff
 67e24c99
-202006d7
+202006e5
 6fe20018
 1ff18400
 184f840a
@@ -494,7 +494,7 @@
 20600000
 2040248f
 704c8a00
-202006d9
+202006e7
 204021ec
 24740000
 78547c00
@@ -510,7 +510,7 @@
 67e84169
 78387c00
 7834fc00
-202006db
+202006e9
 20402b6f
 d8200010
 20402321
@@ -531,7 +531,7 @@
 20402940
 78347c00
 704c8a01
-202006d9
+202006e7
 70011600
 70015000
 204024d2
@@ -554,7 +554,7 @@
 67e2004b
 204021e1
 c6108000
-202006d1
+202006df
 704c8803
 704c8706
 204002fa
@@ -635,7 +635,7 @@
 18007e06
 67e243e2
 20203f1a
-204006dd
+204006eb
 6a464dd8
 2020026a
 6a464dd8
@@ -689,14 +689,14 @@
 c4020000
 6fe20639
 67e24e18
-202006df
+202006ed
 6fe20046
 67e24e18
 793f8021
 70004600
 704ca100
 704c9b00
-202006df
+202006ed
 6fe20624
 d8400000
 c1018000
@@ -899,7 +899,7 @@
 6fe40643
 e7e40005
 2040041a
-202006e1
+202006ef
 6fec0633
 684c4627
 98467c00
@@ -911,7 +911,7 @@
 7042a700
 70065b00
 204047d2
-202006e3
+202006f1
 204005a5
 67e64e15
 58000000
@@ -1026,7 +1026,7 @@
 20600000
 7834fc00
 204048fd
-2021068d
+2021069b
 204003cd
 20400314
 204045fc
@@ -1081,7 +1081,7 @@
 c2818411
 6fe24e17
 1fe67c06
-2421068d
+2421069b
 1fe0fe01
 67e24e17
 20200411
@@ -1116,7 +1116,7 @@
 67e40124
 24610000
 2040473e
-202006e1
+202006ef
 6a280f1e
 6a480f22
 6a660f26
@@ -1465,7 +1465,7 @@
 20203168
 704c8c00
 704c1700
-204006e5
+204006f3
 204002af
 202031c3
 6842063a
@@ -1483,7 +1483,7 @@
 6fe245b5
 c0014794
 6fe21002
-c001068d
+c001069b
 c002c790
 20600000
 20404906
@@ -1516,7 +1516,7 @@
 d8e00001
 20407148
 247a0000
-202006e7
+202006f5
 204005ff
 18227e00
 c1018000
@@ -1537,19 +1537,33 @@
 20403fa5
 20200578
 6fe20b97
-243a06e9
+243a06f7
 6fe20b98
-243a06e9
+243a06f7
 20600000
+6fe2004b
+79207e02
+67e2004b
 20404f51
 7006ae01
 2040023b
-20204d60
+204052de
+2420cf59
+2434cd67
+20600000
 6fe24c97
 207a0000
 6fe20b95
 247a0000
-20400612
+20402287
+24628000
+1a208c01
+efe20006
+c4008000
+6fe24ff0
+1fe0fe01
+67e24ff0
+20400620
 704c9f01
 20600000
 704c8806
@@ -1567,11 +1581,11 @@
 2020268a
 1f227e00
 67e4012c
-203a0618
+203a0626
 9ea67c00
 20212729
 18017e01
-243a062a
+243a0638
 6fe20151
 1fe17e03
 c001a649
@@ -1616,7 +1630,7 @@
 da204d34
 20200548
 20202baf
-2040064f
+2040065d
 207a0000
 6fe2004b
 c3830000
@@ -1629,7 +1643,7 @@
 18c27e00
 67e4013c
 6fe4442c
-203a0661
+203a066f
 20205b2e
 6fe40099
 203a2baf
@@ -1640,7 +1654,7 @@
 70429300
 20204b77
 67e40fb7
-2020066b
+20200679
 68440fb7
 18518400
 6fe44881
@@ -1659,7 +1673,7 @@
 67e40241
 58004e34
 67e4023f
-204006ae
+204006bc
 204057e8
 6fe280a0
 67e20124
@@ -1675,28 +1689,28 @@
 2040682b
 700f0d15
 20206b2e
-20400688
+20400696
 7854fc00
 20600000
 6fe24040
 c3800000
 c3818000
 6fe247cd
-203a0697
+203a06a5
 6fe24724
 207a0000
 20202d53
 6fe206ab
 67e24bef
-202006eb
+202006f9
 7043dd01
 20403f41
-202006eb
+202006f9
 6fe20fd6
-c05506ad
+c05506bb
 6fe24131
 207a0000
-2040064f
+2040065d
 247a0000
 da204d5c
 20400548
@@ -1714,108 +1728,108 @@
 207a0000
 6fe24f64
 c1a98000
-202006b0
+202006be
 18227e00
 c003a739
 c0032739
 202025df
 580002e0
-20200669
+20200677
 580002a0
-20200669
+20200677
 580002b0
-20200669
+20200677
 58000240
-20200669
+20200677
 58000250
-20200669
+20200677
 580000f0
-20200669
+20200677
 58000320
-20200669
+20200677
 580002f0
-20200669
+20200677
 58000200
-20200669
+20200677
 580001c0
-20200669
+20200677
 58000230
-20200669
+20200677
 58000300
-20200669
+20200677
 58000190
-20200669
+20200677
 58000290
-20200669
+20200677
 58000120
-20200669
+20200677
 58000170
-20200669
+20200677
 580002c0
-20200669
+20200677
 580002d0
-20200669
+20200677
 580001e0
-20200669
+20200677
 58000140
-20200669
+20200677
 580001b0
-20200669
+20200677
 580001a0
-20200669
+20200677
 580001f0
-20200669
+20200677
 58000260
-20200669
+20200677
 58000270
-20200669
+20200677
 58000280
-20200669
+20200677
 58000080
-20200669
+20200677
 58000070
-20200669
+20200677
 580000d0
-20200669
+20200677
 58000060
-20200669
+20200677
 580000c0
-20200669
+20200677
 58000090
-20200669
+20200677
 580000a0
-20200669
+20200677
 580000b0
-20200669
+20200677
 580000e0
-20200669
+20200677
 58000160
-20200669
+20200677
 58000100
-20200669
+20200677
 58000010
-20200669
+20200677
 58000020
-20200669
+20200677
 58000030
-20200669
+20200677
 58000040
-20200669
+20200677
 58000050
-20200669
+20200677
 58000110
-20200669
+20200677
 58000210
-20200669
+20200677
 58000220
-20200669
+20200677
 580001d0
-20200669
+20200677
 58000150
-20200669
+20200677
 58000180
-20200669
+20200677
 58000310
-20200669
+20200677
 58000330
-20200669
+20200677
Index: ModuleDemo/25_OTA/bt_demo/CM0/respin/sched.rom
===================================================================
--- /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/respin/sched.rom	(revision 4611)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/respin/sched.rom	(working copy)
@@ -230,7 +230,7 @@
 # mem_tws_rf_packet_rx_window_size - (mem_tws_rf_rcv_window_size + 72us + hardware_delay(18us) + mem_tws_rf_slave_send_full_packet_sleep_time/2)
 mem_tws_rf_master_check_raw_id_time:db 04
 
-mem_rf_debug_enable: 01
+mem_rf_debug_enable: 00
 mem_rf_debug_rf_rx_debug_gpio: 0c
 mem_rf_debug_rf_tx_debug_gpio: 0e
 mem_rf_debug_rf_sync_detect_debug_gpio: 13
@@ -255,7 +255,7 @@
 
 # debug log define
 #mem_param_debug_log_mem_block_start_addr
-mem_param_debug_log_func_enable:00
+mem_param_debug_log_func_enable:01
 
 mem_param_debug_log_initial_flag_addr:10 db 01
 mem_param_debug_log_lock_flag_cm0_addr:11 db 01
Index: ModuleDemo/25_OTA/bt_demo/CM0/respin/zcode.rom
===================================================================
--- /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/respin/zcode.rom	(revision 4611)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/respin/zcode.rom	(working copy)
@@ -69,7 +69,7 @@
 c006002b
 c0008008
 c0004880
-2020071b
+20200729
 efea0006
 67ea4528
 efe40006
@@ -195,9 +195,9 @@
 68420048
 20407a08
 6fe20048
-c2838717
+c2838725
 c0188021
-c0060719
+c0060727
 c0038030
 c005800b
 20204f6c
@@ -264,7 +264,7 @@
 98467c00
 24628000
 2040493a
-202006e3
+202006f1
 00000000
 00000000
 00000000
@@ -519,7 +519,7 @@
 67e4003e
 7855fc00
 704c8a00
-20200715
+20200723
 00000000
 00000000
 00000000
@@ -610,7 +610,7 @@
 24348023
 18808fff
 704c8a02
-20200715
+20200723
 00000000
 00000000
 00000000
@@ -976,9 +976,9 @@
 67e4431f
 58000141
 67e4431b
-58000698
+580006a6
 67e44315
-5800069b
+580006a9
 67e44313
 2055802e
 24358020
@@ -1000,7 +1000,7 @@
 20403f28
 58001171
 67e44f5d
-20200713
+20200721
 20400143
 700f0d6a
 20203f28
@@ -1155,7 +1155,7 @@
 c0060009
 c00b8010
 c0058013
-c0198711
+c019871f
 c017001d
 c0208025
 20204ba4
@@ -1227,7 +1227,7 @@
 c0038037
 c0040607
 c00101b1
-2020070f
+2020071d
 6fe20739
 67e206a3
 c0088012
@@ -1261,7 +1261,7 @@
 c1830000
 60420055
 700b9b01
-2040060b
+20400611
 6fe24c97
 203a023b
 20600000
@@ -1359,7 +1359,7 @@
 67e24c1a
 20400258
 67e24c1b
-2020070d
+2020071b
 20400249
 67e242a8
 20400034
@@ -1488,7 +1488,7 @@
 2020000a
 20404c78
 20400019
-20200612
+20200620
 20400019
 20404c78
 20404c7c
@@ -2185,11 +2185,11 @@
 c004000e
 c01f8012
 2020028e
-20200703
-20200705
-20200707
-20200709
-2020070b
+20200711
+20200713
+20200715
+20200717
+20200719
 2020028e
 2020028e
 6fe24c18
@@ -2304,7 +2304,7 @@
 00000000
 20200040
 6fe24f34
-243a0701
+243a070f
 704f3401
 20400023
 6f224cd2
@@ -2380,7 +2380,7 @@
 c0078020
 c0080025
 c0088029
-202006ff
+2020070d
 20400249
 204002a2
 da200009
@@ -2437,7 +2437,7 @@
 c0058012
 c0060025
 c0068029
-202006fd
+2020070b
 20400258
 67e244df
 1fe27200
@@ -2628,7 +2628,7 @@
 c00e0018
 c00e8020
 c00d802b
-202006fb
+20200709
 704fa601
 2040024f
 67ec42a9
@@ -2690,11 +2690,11 @@
 6fe24c18
 c0058009
 c0060011
-c0068018
-c0070021
-c0088029
-c009802d
-202006f9
+c0068019
+c0070022
+c008802a
+c009802e
+20200707
 2040024f
 67ec42a9
 d8a04297
@@ -2702,11 +2702,12 @@
 20400246
 70429301
 7042a70b
-20200024
+20200025
 2040024f
 67ec42a9
 7042a70c
-20400024
+20400025
+20400611
 6fe24c97
 203a023b
 20600000
@@ -2718,7 +2719,7 @@
 d8a047f2
 20400246
 7042a709
-20200024
+20200025
 2040024f
 67ec42a9
 7042a70a
@@ -2749,13 +2750,12 @@
 00000000
 00000000
 00000000
-00000000
 20200040
 6fe24c18
 c0030006
 c004001c
 c005002f
-202006f7
+20200705
 20400249
 67e242a8
 20400258
@@ -2828,7 +2828,7 @@
 c0230033
 c0238034
 c0288036
-202006f5
+20200703
 20400249
 67e44153
 20400249
@@ -2949,7 +2949,7 @@
 c0058022
 c006002d
 c0068035
-202006f3
+20200701
 6fe44deb
 c30102a4
 6fe44de9
@@ -3013,7 +3013,7 @@
 c0018010
 c0028015
 c003001a
-202006f1
+202006ff
 20400255
 67f04c6c
 20200292
@@ -3144,7 +3144,7 @@
 c00c8028
 c00d002d
 c00d8030
-202006ef
+202006fd
 20400255
 67f04c1c
 20200292
@@ -3204,7 +3204,7 @@
 c0010017
 c0028019
 c0048025
-202006ed
+202006fb
 7920001c
 2040024c
 67e64147
