Snap for 7216111 from 7a455aebf3eba8cd48614b0f5ba6d30b804de2ca to sc-release

Change-Id: I56efe3ef7614f6b6993b85e5322b44d4dbb597dc
diff --git a/ese-spi-driver/SpiLayerComm.cc b/ese-spi-driver/SpiLayerComm.cc
index 3139e80..a922234 100644
--- a/ese-spi-driver/SpiLayerComm.cc
+++ b/ese-spi-driver/SpiLayerComm.cc
@@ -271,7 +271,7 @@
       unsigned int elapsedTimeInMs =
           Utils_getElapsedTimeInMs(startTime, currentTime);
       if (elapsedTimeInMs > maxWaitingTime) {
-        STLOG_HAL_D("BWT timed out after %d ms before receiving a valid NAD",
+        STLOG_HAL_E("BWT timed out after %d ms before receiving a valid NAD",
                     elapsedTimeInMs);
         return -2;
       }
diff --git a/ese-spi-driver/StEseApi.cc b/ese-spi-driver/StEseApi.cc
index 894c190..e7c25d9 100644
--- a/ese-spi-driver/StEseApi.cc
+++ b/ese-spi-driver/StEseApi.cc
@@ -182,8 +182,8 @@
 
     if ((rc == -2) && (retry_count < 3)) {
       retry_count++;
-      STLOG_HAL_E(" %s ESE - resync was needed, resend the whole frame\n",
-                  __FUNCTION__);
+      STLOG_HAL_E(" %s ESE - resync was needed, resend the whole frame retry"
+                  " = %d\n", __FUNCTION__, retry_count);
       pCmdlen = pCmd->len;
       CmdPart = pCmd->p_data;
       goto retry;
@@ -206,7 +206,8 @@
                                          (StEse_data*)pRsp, I_block);
   if ((rc == -2) && (retry_count < 3)) {
     retry_count++;
-    STLOG_HAL_E(" %s ESE - resync was needed, resend\n", __FUNCTION__);
+    STLOG_HAL_E(" %s ESE - resync was needed, resend retry = %d\n",
+                __FUNCTION__, retry_count);
     pCmdlen = pCmd->len;
     CmdPart = pCmd->p_data;
     goto retry;
diff --git a/ese-spi-driver/T1protocol.cc b/ese-spi-driver/T1protocol.cc
index 551f2a2..c955a37 100644
--- a/ese-spi-driver/T1protocol.cc
+++ b/ese-spi-driver/T1protocol.cc
@@ -477,7 +477,7 @@
     // retransmission of the original IBlock, otherwise do resend request.
     if (T1protocol_isSequenceNumberOk(originalCmdTpdu, lastRespTpduReceived) ==
         true) {
-      STLOG_HAL_D("%s : Need retransmissiom :", __func__);
+      STLOG_HAL_E("%s : Need retransmissiom :", __func__);
       if (gOriginalCmd == S_IFS_REQ) {
         gNextCmd = S_IFS_REQ;
       } else {
@@ -695,22 +695,22 @@
 void T1protocol_updateRecoveryStatus() {
   switch (recoveryStatus) {
     case RECOVERY_STATUS_OK:
-      STLOG_HAL_D("recoveryStatus: OK -> RESEND 1");
+      STLOG_HAL_E("recoveryStatus: OK -> RESEND 1");
       recoveryStatus = RECOVERY_STATUS_RESEND_1;
       break;
 
     case RECOVERY_STATUS_RESEND_1:
-      STLOG_HAL_D("recoveryStatus: RESEND 1 -> RESYNC 1");
+      STLOG_HAL_E("recoveryStatus: RESEND 1 -> RESYNC 1");
       recoveryStatus = RECOVERY_STATUS_RESYNC_1;
       break;
 
     case RECOVERY_STATUS_RESYNC_1:
-      STLOG_HAL_D("recoveryStatus: RESYNC 1 -> WARM RESET");
+      STLOG_HAL_E("recoveryStatus: RESYNC 1 -> WARM RESET");
       recoveryStatus = RECOVERY_STATUS_WARM_RESET;
       break;
 
     case RECOVERY_STATUS_WARM_RESET:
-      STLOG_HAL_D("recoveryStatus: WARM_RESET (recovery completed)");
+      STLOG_HAL_E("recoveryStatus: WARM_RESET (recovery completed)");
       recoveryStatus = RECOVERY_STATUS_KO;
       break;
   }
@@ -969,7 +969,7 @@
   // If the last transmission ends without response from the slave, do
   // recovery mechanism.
   if (*bytesRead == 0) {
-    STLOG_HAL_D("bytesRead = 0 -> Going into recovery.");
+    STLOG_HAL_E("bytesRead = 0 -> Going into recovery.");
     rc = T1protocol_doRecovery();
     return rc;
   }
@@ -977,7 +977,7 @@
   // Check the consistency of the last received tpdu
   rc = T1protocol_checkTpduConsistency(lastCmdTpduSent, lastRespTpduReceived);
   if (rc < 0) {
-    STLOG_HAL_D("%s : TPDU consistency check failed -> Going into recovery.",
+    STLOG_HAL_E("%s : TPDU consistency check failed -> Going into recovery.",
                 __func__);
     rc = T1protocol_doRecovery();
     return rc;
@@ -1135,7 +1135,7 @@
   StEse_data pRes;
 
   memset(&pRes, 0x00, sizeof(StEse_data));
-  STLOG_HAL_D("%s : Enter", __func__);
+  STLOG_HAL_E("%s : Enter cmdLength = 0x%02X", __func__, cmdLength);
 
   // Form the cmdTpdu according to the cmdApduPart, cmdLength and isLast
   // fields.