Snap for 11865526 from a1c120dca76e3ab078de35218c5c603fc65d0e54 to 24Q3-release

Change-Id: I3e8dd492c32c27329d04a9caa3634f2a3fc1deb2
diff --git a/st21nfc/hal/hal_fwlog.cc b/st21nfc/hal/hal_fwlog.cc
index eaddb9d..8704639 100644
--- a/st21nfc/hal/hal_fwlog.cc
+++ b/st21nfc/hal/hal_fwlog.cc
@@ -26,6 +26,7 @@
 #include <string.h>
 #include "android_logmsg.h"
 #include "halcore.h"
+#include "hal_fd.h"
 
 extern void DispHal(const char* title, const void* data, size_t length);
 
@@ -69,10 +70,20 @@
     case T_CERxError:
     case T_CERx: {
       STLOG_HAL_D("%s - T_CERx", __func__);
-      int tlv_size = tlvBuffer[1]-2;
+      int tlv_size = tlvBuffer[1] - 2;
       if (tlv_size < 9) {
-      tlv_size = 8;
+        tlv_size = 8;
       }
+
+      // work-around type-A short frame notification bug
+      if (hal_fd_getFwInfo()->chipHwVersion == HW_ST54J &&
+          (tlvBuffer[2] & 0xF) == 0x01 && // short frame
+          tlvBuffer[5] == 0x00 && // no error
+          tlvBuffer[6] == 0x0F // incorrect real size
+          ) {
+        tlv_size = 9;
+      }
+
       value_len = tlv_size- 3;
       *NewTlv = (uint8_t*)malloc(tlv_size * sizeof(uint8_t));
       uint8_t gain;