Index: bt_rom/format/app_module.format
===================================================================
--- /YC3121_demo/Librarier/bt_rom/format/app_module.format	(revision 815)
+++ /YC3121_demo/Librarier/bt_rom/format/app_module.format	(working copy)
@@ -1,44 +1,5 @@
 memalloc(
 )
-omemalloc(	
-	2 mem_soft_version_num
-
-	2 mem_current_packet_length
-	1 mem_module_state
-	
-	1 mem_module_spp_lpm_mult
-	1 mem_module_le_lpm_mult	
-	1 mem_module_bluetooth_stauts_by_command
-
-	//ble
-	1 mem_module_le_rx_data_len
-	2 mem_module_le_rx_data_address
-	2 mem_module_le_rx_data_handle
-	//ble write handle
-	2 mem_module_data_write_handle
-	2 mem_module_data_write_handle2
-	//flag
-	1 mem_module_flag
-
-	1 mem_module_hci_notify_len
-	2 mem_module_hci_notify_handle
-	2 mem_module_hci_nofiy_addr
-
-	4 mem_last_transmite_clock
-	
-	300 mem_module_uuid_list
-	0 mem_module_uuid_list_end
-	600 mem_module_le_att_list
-	0 mem_module_le_att_list_end
-	0 mem_module_nv_data
-	34 mem_module_nv_data0
-	34 mem_module_nv_data1
-	34 mem_module_nv_data2
-	34 mem_module_nv_data3
-	34 mem_module_nv_data4
-	3 mem_rf_init
-)
-
 
 (
 0x4FEF 	IPC_HOLD_BT
@@ -82,9 +43,7 @@
 	110  DM_REFCOM_BUFF_LEN
 	230 NL_RFCOMM_BUFF_LEN
 )
-(
-	0x200 UART_AIR_CONTROL_THRESHOLD
-)
+
 
 (
 0x01 HCI_DISCARD_PACKET
Index: bt_rom/format/utility.format
===================================================================
--- /YC3121_demo/Librarier/bt_rom/format/utility.format	(revision 815)
+++ /YC3121_demo/Librarier/bt_rom/format/utility.format	(working copy)
@@ -64,89 +64,6 @@
 1 mem_key_value_temp5
 1 mem_key_value_temp6
 6 mem_temp_block6
-
-
-1 mem_usb_status
-1 mem_usb_fifo_empty
-1 mem_usb_read_len
-64 mem_usb_rxbuf
-2 mem_bufptr
-1 mem_remain
-20 mem_devicedesc
-2 mem_hidreportdesc_kb
-2 mem_hidreportdesc_m
-100 mem_confdesc
-5 mem_string0
-30 mem_string1
-64 mem_string2
-30 mem_string3
-2 mem_usb_zero_packet
-2 mem_usb_ones_packet
-2 mem_usb_two_packet
-1 mem_usb0_state
-
-1 mem_usb_offline_check_gpio
-1 mem_usb_tx_interval
-
-0 mem_usb_clear_mem_start
-0 mem_usb_setup
-1 mem_usb_setup_bmRequestType
-1 mem_usb_setup_bRequest
-1 mem_usb_setup_bValue
-1 mem_usb_setup_bValueH
-2 mem_usb_setup_wIndex
-1 mem_usb_setup_bLength
-1 mem_usb_setup_bLengthH
-64 mem_usb0_setup
-64 mem_usb0_set_report_data
-64 mem_usb0_get_report_data
-1 mem_usb_state
-1 mem_usb_tx_wait
-1 mem_usb_tx_enable
-1 mem_usb_remote_wakeup
-1 mem_usb_clear_remote_wakeup
-1 mem_usb_ep0_stall_status
-1 mem_usb_ep1_stall_status
-1 mem_usb_ep2_stall_status
-1 mem_usb_ep3_stall_status
-2 mem_dsc_info_data_pointer
-1 mem_dsc_info_len
-1 mem_usb0_data_ready_report
-1 mem_usb_tx_win_enable
-1 mem_usb_tx_mac_enable
-1 mem_usb_device_enumeration_endflag
-1 mem_usb_wakestate_onetime_flag
-1 mem_usb_mac_wakeup_trig
-1 mem_usb_set_high_addr_flag
-1 mem_usb_set_protocol_value
-1 mem_usb_set_protocol_status
-1 mem_usb_get_protocol_flag
-1 mem_usb_idle_flag
-1 mem_usb_idle_rate
-2 mem_usb_setup_bValue_temp
-1 mem_usb0_get_set_report
-1 mem_usb_ep1_data
-1 mem_usb_ep2_data
-1 mem_usb_clear_halt
-16 mem_usb_mouse_data
-16 mem_usb_kb_data
-16 mem_usb_kb_multikey
-8 mem_usb_kb_data_sta_data
-8 mem_usb_kb_data_last_data
-3 mem_usb_kb_multikey_sta_data
-3 mem_usb_kb_multikey_last_data
-1 mem_usb_kb_blank_data_enable
-1 mem_usb_kb_mul_blank_data_enable
-1 mem_usb_test_cnt
-0 mem_usb_clear_mem_end
-1 mem_usb_test_kb
-
-256 mem_rssi_noise_buffer
-256 mem_rssi_noise_dg_buffer
-256 mem_rssi_noise_ms_buffer
-256 mem_rssi_noise_kb_buffer
-32 mem_24g_common_temp
-
 )
 
 
Index: bt_rom/program/le.prog
===================================================================
--- /YC3121_demo/Librarier/bt_rom/program/le.prog	(revision 815)
+++ /YC3121_demo/Librarier/bt_rom/program/le.prog	(working copy)
@@ -1702,7 +1702,7 @@
 
 //rega:len regb:cid
 le_fifo_malloc_tx_l2cap:
-	force LLID_L2CAP_START,type
+	force LLID_START,type
 	increase 4,rega
 	call le_fifo_malloc_tx
 	increase -4,rega
Index: bt_rom/util/memalloc.pl
===================================================================
--- /YC3121_demo/Librarier/bt_rom/util/memalloc.pl	(revision 815)
+++ /YC3121_demo/Librarier/bt_rom/util/memalloc.pl	(working copy)
@@ -1,21 +1,24 @@
-$path="output/bt_format.meta";
+$path=$ARGV[0];
 open file, $path;
 @f = <file>;
 close file;
 open file, ">$path";
 $path =~ s/\/.*//;
-open file1, ">output/memmap.format";
+open file1, ">$path/memmap.format";
 $xaddr = 0x4000;
 $addr = 0;
-if($#ARGV == 1) {
-	$addr = hex($ARGV[0]);
-	$xaddr = hex($ARGV[1]);
-}
+#if($#ARGV == 1) {
+#	$addr = hex($ARGV[0]);
+#	$xaddr = hex($ARGV[1]);
+#}
+for($i = 0;$i < @f;$i++) { $cmalloc[$i] = (); }
 for($i = 0;$i < @f;$i++) { 
 	$_ = $f[$i];
 	$start = 1 if(/^\s*memalloc\s*\(\s*$/);
 	$start = 2 if(/^\s*xmemalloc\s*\(\s*$/);
 	$start = 3 if(/^\s*omemalloc\s*\(\s*$/);
+	$start = 4 if(/^\s*bmemalloc\s*\(\s*$/);
+	$start = 10 + $1 if(/^\s*cmemalloc\s+([0-9])\s*\(\s*$/);
 	if($start) {
 		if(/^\s*([0-9]+)\s+([a-zA-Z0-9_]+)\s*(.*)$/) {
 			if($start == 1) {
@@ -32,14 +35,28 @@
 			}
 		}
 		if(/^\s*\)\s*$/) {
+			if(@ostr > 0) {
+				if($start == 3) {
+					push @omalloc,[@ostr];
+				} elsif($start == 4) {
+					push @bmalloc,[@ostr];
+				} elsif($start > 9) {
+					$j = $start - 10;
+					push @{$cmalloc[$j]},@ostr;
+				} 
+			}
 			$start = 0;
-			push @omalloc,[@ostr] if(@ostr > 0);
 			@ostr = ();
 		}
 	} else {
 		$sstr .= $_;
 	}
 }
+for($i = 0;$i <= $#cmalloc;$i++) {
+	push @omalloc,$cmalloc[$i];
+#	for($j = 0;$j <= $#{$cmalloc[$i]};$j++) {		print $cmalloc[$i][$j];	}
+}
+
 $xend = $xaddr;
 for($i = 0;$i <= $#omalloc;$i++) {
 	for($j = 0, $oaddr = $xaddr;$j <= $#{$omalloc[$i]};$j++) {
@@ -49,11 +66,25 @@
 			$xstr .= $str;
 		}
 	}
+	$xend = $oaddr if($oaddr > $xend);
+}
+
+$bend = $addr;
+for($i = 0;$i <= $#bmalloc;$i++) {
+	for($j = 0, $baddr = $addr;$j <= $#{$bmalloc[$i]};$j++) {
+		if($bmalloc[$i][$j] =~ /^\s*([0-9]+)\s+([a-zA-Z0-9_]+)\s*(.*)$/) {
+			$str = sprintf "0x%04x %s%s\n", $baddr, $2, $3;
+			$baddr += $1;
+			$xstr .= $str;
+		}
+	}
+	$bend = $baddr if($baddr > $bend);
 }
-$xend = $oaddr if($oaddr > $xend);
+
+
 print file $xstr, $sstr;
 print file1 $bstr, $xstr;
 close file;
 close file1;
-printf "\nLast allocated address is %04x\n", $addr;
+printf "\nLast allocated address is %04x\n", $bend;
 printf "\nLast allocated xmem address is %04x\n", $xend;
