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 5098)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/BT/patch/patch.prog	(working copy)
@@ -934,7 +934,7 @@
 
 	/*	check if we initiated the encryption 	*/
 	fetch 1,mem_initiate_enc_master
-	branch p_hci_send_auth_complete,blank
+	beq 1,p_hci_send_auth_complete
 	rtn
 	
 p_linkkey_ready:
Index: ModuleDemo/25_OTA/bt_demo/BT/patch/z.prog
===================================================================
--- /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/BT/patch/z.prog	(revision 5098)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/BT/patch/z.prog	(working copy)
@@ -275,6 +275,8 @@
 	jam PUBLIC_ADDR,mem_le_adv_own_addr_type
 	rtn
 z_hci_set_random_addr:
+	fetcht 6,mem_mesh_le_random_address
+	storet 6,mem_le_lap
  	jam RANDOM_ADDR,mem_le_adv_own_addr_type
 	rtn
 
@@ -583,7 +585,9 @@
 	call z_hci_pin_code_reply
 	call p_sp_check_ssp_available
 	fetch 1,mem_simple_pairing_mode
-	branch p_hci_send_pincode_req_event,blank
+	nrtn blank
+	fetch 1,mem_initiate_enc_master
+	beq 1,p_hci_send_pincode_req_event
 	//force 0x01,pdata
 	//store 1,mem_io_cap_flag
 	//fetch 1,mem_simple_pairing_mode
@@ -619,6 +623,7 @@
 	call p_ipc_rx_hci_data_two_byte
 	store 1,mem_hci_conn_handle
 	jam hci_cmd_auth,mem_hci_cmd
+	jam 1,mem_initiate_enc_master
 	branch p_hci_send_event_command_status
 
 z_hci_parse_packet_cmd_ogf_link_control_set_connection_encryption:	//13
@@ -2721,7 +2726,7 @@
 	call check_localsm
 	branch z_send_lmp_sres_master,true
 	
-	jam 1,mem_initiate_enc_master	// encryption slave, do not send authentication complete event
+//	jam 1,mem_initiate_enc_master	// encryption slave, do not send authentication complete event
 	
 	jam DONE_ENCRYP,mem_wait_encryption
 	
@@ -2944,12 +2949,12 @@
 	istore 1,contw
 	call send_lmp_follow
 	fetch 1,mem_lmi_opcode
-	beq LMP_ENCRYPTION_MODE_REQ,z_send_lmp_accepted_enc_mode
+//	beq LMP_ENCRYPTION_MODE_REQ,z_send_lmp_accepted_enc_mode
 	branch send_lmp_accepted+6
 
-z_send_lmp_accepted_enc_mode:
-	jam 1,mem_initiate_enc_master
-	branch send_lmp_accepted_enc_mode
+//z_send_lmp_accepted_enc_mode:
+//	jam 1,mem_initiate_enc_master
+//	branch send_lmp_accepted_enc_mode
 
 
 org z
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 5098)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/respin/ramcode.rom	(working copy)
@@ -636,7 +636,7 @@
 20404d8e
 c6108000
 6fe24ff0
-203a028c
+c000828c
 20600000
 6fe20030
 c283a1e1
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 5098)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/respin/zcode.rom	(working copy)
@@ -69,10 +69,10 @@
 e7e20005
 2040529b
 6fe20049
-c0078009
 20204ff1
-704ff001
-20205032
+00000000
+00000000
+00000000
 00000000
 00000000
 00000000
@@ -329,18 +329,17 @@
 204052d0
 20406142
 204052e7
-20208012
-704ff001
+20208011
 7006b101
-c5108018
+c5108017
 6fe20b9c
 207a0000
 70007c0b
-c5108018
+c5108017
 6fe24293
 207a0000
 204052e7
-24208018
+24208017
 20600000
 c6908000
 793f8021
@@ -382,6 +381,7 @@
 00000000
 00000000
 00000000
+00000000
 20200040
 da201001
 68420048
@@ -2881,12 +2881,12 @@
 20200040
 6fe24c18
 c001800a
-c01b8015
-c029001e
-c02a8024
-c02b0029
-c036002d
-c0368032
+c01b8017
+c0290020
+c02a8026
+c02b002b
+c036002f
+c0368034
 202007dd
 204002ff
 5800003f
@@ -2894,6 +2894,8 @@
 5fffffff
 67f04c1c
 58000000
+589e8b33
+67e64147
 67ec4c7a
 67e244de
 67e244d9
@@ -2940,8 +2942,6 @@
 00000000
 00000000
 00000000
-00000000
-00000000
 20200040
 6fe24c18
 c0158005
@@ -3074,10 +3074,10 @@
 6fe24c18
 c0058009
 c0060011
-c0068019
-c0070022
-c008802a
-c009802e
+c006801b
+c0070024
+c008802c
+c0098031
 202007d9
 204002b4
 67ec42a9
@@ -3086,14 +3086,16 @@
 204002ab
 70429301
 7042a70b
-20200025
+20200027
 204002b4
 67ec42a9
 7042a70c
-20400025
+20400027
 20400674
 6fe24c97
-203a029a
+247a0000
+6fe24ff0
+c000829a
 20600000
 204002b4
 67ec42a9
@@ -3103,7 +3105,7 @@
 d8a047f2
 204002ab
 7042a709
-20200025
+20200027
 204002b4
 67ec42a9
 7042a70a
@@ -3115,6 +3117,7 @@
 204002ae
 67e242a8
 7042a70d
+704ff001
 2020030f
 204002ae
 67e242a8
@@ -3131,9 +3134,6 @@
 00000000
 00000000
 00000000
-00000000
-00000000
-00000000
 20200040
 6fe24c18
 c0030006
@@ -3447,13 +3447,13 @@
 604c4639
 70461c00
 20600000
+684c4c7a
+604c4639
 70461c01
 20600000
 00000000
 00000000
 00000000
-00000000
-00000000
 20200040
 6fe24c18
 c0008009
