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

Reply
  • 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

Children
  • @aryan In my case the HW version check is useful because I use the same BLE application on the nRF51 and 52. Is there any another way to read IC information ? I currently use the ic_info module. I need to reed the IC version and the SoftDevice used.

    These functions read registers that contain Nordic proprietary chip-specific information and configuration that is subject to change without notice.

    Informations available in the FICR will always be available for the user, no ? Could you elaborate a bit more please ?

  • Hi metch,

    You can still read the register directly but you cannot depend that this value will be same for the given revision of the chip. The main purpose of the value inside that registers is to aid and make production easier. There has been some confusion that when Nordic changes the value inside this register for any reason, others interpret is as a new version of chip even though that might not be the case. You can still read the registers, probably the values will have a pattern differentiating nrf51 and nrf52 that will be useful in your case. Like I said this is factory information along with other calibration data in those registers, you can still use them, but the values could change for the same revision of the chip. Hopefully I did not confuse you more.

  • 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.

Related