This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF5 SDK v11.0.0 nrf_ic_info_get missing nRF52 support

nRF52 series compatibility matrix says that you can get the IC revision using nrf_ic_info_get but it is only implemented for nRF51. Does the following patch add support?

diff --git a/components/libraries/ic_info/nrf_ic_info.c b/components/libraries/ic_info/nrf_ic_info.c
index 1572053..ff315ad 100644
--- a/components/libraries/ic_info/nrf_ic_info.c
+++ b/components/libraries/ic_info/nrf_ic_info.c
@@ -57,6 +57,45 @@ void nrf_ic_info_get(nrf_ic_info_t * p_ic_info)
             }
             break;
         }
+#elif defined(NRF52)
+        case PART_NO_NRF52:
+        {
+            p_ic_info->ram_size   = (uint16_t) NRF_FICR->INFO.RAM;
+            p_ic_info->flash_size = (uint16_t) NRF_FICR->INFO.FLASH;
+
+            switch (ic_data)
+            {
+                /** IC revision A */
+                case 1:
+                case 2:
+                    p_ic_info->ic_revision = IC_REVISION_NRF52_REVA;
+                    break;
+
+                /** IC revision B */
+                case 3:
+                case 4:
+                    p_ic_info->ic_revision = IC_REVISION_NRF52_REVB;
+                    break;
+
+                /** IC revision C */
+                case 5:
+                case 6:
+                    p_ic_info->ic_revision = IC_REVISION_NRF52_REVC;
+                    break;
+
+                /** IC revision 1 */
+                case 7:
+                case 8:
+                case 9:
+                	p_ic_info->ic_revision = IC_REVISION_NRF52_REV1;
+                	break;
+
+                default:
+                    p_ic_info->ic_revision = IC_REVISION_NRF52_UNKNOWN;
+                    break;
+            }
+            break;
+        }
 #endif
         default:
             p_ic_info->ic_revision = IC_PART_UNKNOWN;
diff --git a/components/libraries/ic_info/nrf_ic_info.h b/components/libraries/ic_info/nrf_ic_info.h
index 9c01be0..f13487b 100644
--- a/components/libraries/ic_info/nrf_ic_info.h
+++ b/components/libraries/ic_info/nrf_ic_info.h
@@ -29,10 +29,18 @@
 typedef enum
 {
     IC_PART_UNKNOWN = 0,        /**< IC Revision unknown. */
+#if defined(NRF51)
     IC_REVISION_NRF51_REV1,     /**< IC Revision 1. */
     IC_REVISION_NRF51_REV2,     /**< IC Revision 2. */
     IC_REVISION_NRF51_REV3,     /**< IC Revision 3. */
     IC_REVISION_NRF51_UNKNOWN   /**< IC Revision unknown. */
+#elif defined(NRF52)
+    IC_REVISION_NRF52_REVA,     /**< IC Revision A. */
+    IC_REVISION_NRF52_REVB,     /**< IC Revision B. */
+    IC_REVISION_NRF52_REVC,     /**< IC Revision C. */
+    IC_REVISION_NRF52_REV1,     /**< IC Revision 1. */
+    IC_REVISION_NRF52_UNKNOWN   /**< IC Revision unknown. */
+#endif
 } nrf_ic_revision_t;
 
  /**@brief IC information struct containing the IC revision, RAM size, and FLASH size. */
Parents
  • Hi,

    As of today, there is only one production version of nRF52832, hence firmware should not need to do a HW version check. The functions nrf_ic_info_get and ic_info, found in previous versions of nRF5 SDK, shall no longer be used. These functions read registers that contain Nordic proprietary chip-specific information and configuration that is subject to change without notice.

    /Susheel

  • the values could change for the same revision of the chip

    This means the IC information will not give an accurate information ?

    IMO, if the value can change for the same IC revision, you should simply remove the IC information module from the SDK and not document this at all.

    I should maybe open a new question about this. I need a way to read information about the nRF5X IC (nRF51, 52, RAM/FLASH size) and the SoftDevice used. This would be great if I can get these information programmatically.

Reply
  • the values could change for the same revision of the chip

    This means the IC information will not give an accurate information ?

    IMO, if the value can change for the same IC revision, you should simply remove the IC information module from the SDK and not document this at all.

    I should maybe open a new question about this. I need a way to read information about the nRF5X IC (nRF51, 52, RAM/FLASH size) and the SoftDevice used. This would be great if I can get these information programmatically.

Children
No Data
Related