Index: Librarier/device/yc11xx.h
===================================================================
--- /YC1121E/SoftCode/1121EB/branch/HciDongle/Librarier/device/yc11xx.h	(revision 5445)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/Librarier/device/yc11xx.h	(working copy)
@@ -7,8 +7,10 @@
 #endif
 
 #ifndef  OS_ENTER_CRITICAL
-#define OS_ENTER_CRITICAL __disable_irq
-#define OS_EXIT_CRITICAL __enable_irq
+extern uint16_t gOsEnterCriticalCnt;
+#define OS_INITIAL_CRITICAL() {gOsEnterCriticalCnt = 0;}
+#define OS_ENTER_CRITICAL() {__disable_irq ; gOsEnterCriticalCnt++;}
+#define OS_EXIT_CRITICAL() {if((--gOsEnterCriticalCnt) == 0) { __enable_irq;}}
 #endif
 
 #define BIG_MEMORY_LPM_NOT_PROTECT_ATTRIBUTES  __attribute__ ((section("big_memory_lpm_not_protect_att")))
Index: Librarier/device/yc11xx.c
===================================================================
--- /YC1121E/SoftCode/1121EB/branch/HciDongle/Librarier/device/yc11xx.c	(revision 5445)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/Librarier/device/yc11xx.c	(working copy)
@@ -9,6 +9,8 @@
 #include <stdarg.h>
 #include "yc11xx.h"
 
+uint16_t gOsEnterCriticalCnt;
+
 byte HREAD(int reg)
 {
 	byte val = 0;
Index: Librarier/drivers/bt/yc11xx_bt.c
===================================================================
--- /YC1121E/SoftCode/1121EB/branch/HciDongle/Librarier/drivers/bt/yc11xx_bt.c	(revision 5445)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/Librarier/drivers/bt/yc11xx_bt.c	(working copy)
@@ -53,8 +53,9 @@
 		if(++RxPtr >= IPC_RX_END) 
 			RxPtr = IPC_RX_HEAD;
 	}
-	
+	OS_ENTER_CRITICAL();
 	HWRITE24BIT(IPC_RX_READ_PTR, RxPtr);
+	OS_EXIT_CRITICAL();
 }
 
 static void ipcTx(uint8_t* Src, uint8_t Len)
@@ -68,7 +69,9 @@
 		me=100;
 		while(me--);
 	}
+	OS_ENTER_CRITICAL();
 	HWRITE24BIT(IPC_TX_WRITE_PTR, TxPtr);
+	OS_EXIT_CRITICAL();
 }
 
 unsigned char IPC_TxBufferIsEnough(uint8_t Len)
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 5445)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/BT/patch/patch.prog	(working copy)
@@ -978,10 +978,12 @@
 
 	
 p_ipc_rx_process_loop:
-	fetch 1,mem_ipc_enable
-	rtn blank
+//	fetch 1,mem_ipc_enable
+//	rtn blank
 	call ipc_rx_items_inquire
 	rtn zero // no data
+	call ipc_rx_items_inquire
+	rtn zero // no data	
 	icopy contr
 	call ipc_rx_byte_read
 
Index: ModuleDemo/25_OTA/bt_demo/CM0/User/main.c
===================================================================
--- /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/User/main.c	(revision 5445)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/User/main.c	(working copy)
@@ -50,6 +50,8 @@
 
 int main(void)
 {
+	OS_INITIAL_CRITICAL();
+	
 	*(volatile byte*)(reg_map_m0(0x1f000)) = 0x1c;//Enable cm0 debug
 	SYS_TimerInit(CLOCK_48M_multiple);
 	IPC_init(&gTIPCHandleCb);
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 5445)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/respin/ramcode.rom	(working copy)
@@ -635,8 +635,8 @@
 20403e9d
 20628000
 20200277
-6fe243de
-207a0000
+20403e9d
+20628000
 20403e9d
 20628000
 1fe20c00
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 5445)
+++ /YC1121E/SoftCode/1121EB/branch/HciDongle/ModuleDemo/25_OTA/bt_demo/CM0/respin/zcode.rom	(working copy)
@@ -2354,7 +2354,7 @@
 d8a04efc
 18007210
 20400285
-00000000
+20600000
 00000000
 00000000
 00000000
@@ -3779,7 +3779,7 @@
 c0008007
 c0010017
 c0028019
-c0048025
+c004802a
 202007c2
 7920001c
 2040028b
@@ -3808,9 +3808,14 @@
 20400288
 20400297
 67e24ad0
+245a0026
 704c9b01
 7042a705
 202002e9
+6fe44deb
+79207e00
+67e44deb
+20600000
 6fe24ca1
 c00002ed
 c00102eb
@@ -3833,8 +3838,3 @@
 00000000
 00000000
 00000000
-00000000
-00000000
-00000000
-00000000
-00000000
