You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/13 14:34:59 UTC

[GitHub] [incubator-nuttx] jarivanewijk opened a new pull request #5220: S32K1XX: implement uniqueid

jarivanewijk opened a new pull request #5220:
URL: https://github.com/apache/incubator-nuttx/pull/5220


   ## Summary
   Adds s32k1xx_get_uniqueid which can be used to read the MCU unique ID. Also provides a board_uniqueid implementation for S32K144EVB, which allows the MCU/board unique ID to be retrieved through the boardctl interface (after enabling CONFIG_BOARDCTL_UNIQUEID).
   
   ## Impact
   
   ## Testing
   Tested on S32K144EVB.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] davids5 merged pull request #5220: S32K1XX: implement uniqueid

Posted by GitBox <gi...@apache.org>.
davids5 merged pull request #5220:
URL: https://github.com/apache/incubator-nuttx/pull/5220


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5220: S32K1XX: implement uniqueid

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5220:
URL: https://github.com/apache/incubator-nuttx/pull/5220#discussion_r784184885



##########
File path: arch/arm/src/s32k1xx/s32k1xx_uid.c
##########
@@ -0,0 +1,79 @@
+/****************************************************************************
+ * arch/arm/src/s32k1xx/s32k1xx_uid.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <stddef.h>
+#include <stdint.h>
+#include <assert.h>
+
+#include "arm_arch.h"
+
+#include "hardware/s32k1xx_sim.h"
+#include "s32k1xx_uid.h"
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: s32k1xx_get_uniqueid
+ ****************************************************************************/
+
+void s32k1xx_get_uniqueid(uint8_t *uniqueid)
+{
+  uint32_t regval;
+
+  DEBUGASSERT(uniqueid != NULL);
+
+  /* Retrieve all 16 bytes (128 bits) of the unique identifier and store the
+   * individual bytes in order from lowest byte first to highest byte last.
+   */
+
+  regval = getreg32(S32K1XX_SIM_UIDL);
+
+  uniqueid[0]  = (uint8_t)((regval & 0x000000ff) >>  0);

Review comment:
       Probably can just `memcpy` instead




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org