Tool/software: TI-RTOS
Hi TI experts,
I found an interesting Current Spike issue on LAUNCHXL-CC2640R2, and below is the steps to reproduce it on LAUNCHXL-CC2640R2.
1. Import the project simple_peripheral_cc2640r2lp_oad_offchip_app to CCS with bim and stack from the latest SDK cc2640r2_sdk_1_50_00_58
2. Apply the diff (add external page erase every 5 min) to simple_peripheral_oad_offchip.c
3. Build and load it to LAUNCHXL-CC2640R2 with a multiple-meter to measure the Current and Voltage
4. After a few hours, I got the Current and Voltage results as showing in the attached picture.
My question is how I can solve the Current Spike issue? Since it will damage the battery and cause cc264or2f reset.
Current spike screenshot,
the diff file added to run external flash page erase every 5 minutes.
diff --git a/simple_peripheral_oad_offchip.c b/simple_peripheral_oad_offchip.c
index de123d0..5cc6a2d 100644
--- a/simple_peripheral_oad_offchip.c
+++ b/simple_peripheral_oad_offchip.c
@@ -651,6 +651,24 @@ static void SimpleBLEPeripheral_init(void)
   }
 }
 
+
+#include "flash_interface.h"
+static uint32_t global_timer = 0;
+static uint32_t current_page = 0;
+void current_spike_page_erase(void)
+{
+    if( global_timer % 60 == 0 )
+    {
+        if ( flash_open() )
+        {
+            current_page = current_page % 256;
+            eraseFlash(current_page);
+            current_page ++;
+        }
+    }
+    global_timer ++;
+}
+
 /*********************************************************************
  * @fn      SimpleBLEPeripheral_taskFxn
  *
@@ -797,6 +815,7 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1)
       if (events & SBP_PERIODIC_EVT)
       {
         Util_startClock(&periodicClock);
+        current_spike_page_erase();
 
         // Perform periodic application task
         SimpleBLEPeripheral_performPeriodicTask();
@@ -1265,7 +1284,7 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
       break;
 
     case GAPROLE_WAITING:
-      Util_stopClock(&periodicClock);
+//      Util_stopClock(&periodicClock);
       SimpleBLEPeripheral_freeAttRsp(bleNotConnected);
 
       Display_print0(dispHandle, SBP_ROW_CONN_STATUS, 0, "Disconnected");
I know there is a power consumption bible available at  but it doesn't help to resolve the current spike issue.
 but it doesn't help to resolve the current spike issue.
Thank you,
David
 
				 
		 
					 
                          
 
				 
				
 
				