@@ -82,24 +82,10 @@ void get_unique_chip_id_3(uint8_t * uid)
82
82
uint32_t const samd_uid = *(volatile uint32_t *)(0x0080A048 );
83
83
memcpy (uid, &samd_uid, 3 );
84
84
}
85
- #elif defined(ARDUINO_MINIMA) || defined(ARDUINO_UNOWIFIR4)
85
+ #elif defined(ARDUINO_MINIMA) || defined(ARDUINO_UNOWIFIR4) || defined(ARDUINO_PORTENTA_C33)
86
86
{
87
- #define BSP_FEATURE_BSP_MCU_INFO_POINTER_LOCATION (0x407FB19C )
88
- #define BSP_FEATURE_BSP_UNIQUE_ID_OFFSET (0x14 )
89
- #define BSP_FEATURE_BSP_UNIQUE_ID_POINTER ((*(uint32_t *) BSP_FEATURE_BSP_MCU_INFO_POINTER_LOCATION) \
90
- + \
91
- BSP_FEATURE_BSP_UNIQUE_ID_OFFSET)
92
- typedef struct st_bsp_unique_id
93
- {
94
- union
95
- {
96
- uint32_t unique_id_words[4 ];
97
- uint8_t unique_id_bytes[16 ];
98
- };
99
- } bsp_unique_id_t ;
100
-
101
- bsp_unique_id_t const * renesas_unique_id = (bsp_unique_id_t *) BSP_FEATURE_BSP_UNIQUE_ID_POINTER;
102
- memcpy (uid, renesas_unique_id->unique_id_bytes , 3 );
87
+ const bsp_unique_id_t * t = R_BSP_UniqueIdGet ();
88
+ memcpy (uid, t->unique_id_bytes , 3 );
103
89
}
104
90
#elif defined(ARDUINO_GIGA) || defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_PORTENTA_H7_M4)
105
91
{
@@ -113,4 +99,10 @@ void get_unique_chip_id_3(uint8_t * uid)
113
99
#else
114
100
# error "Retrieving a unique chip ID for MAC generation is not supported on this platform."
115
101
#endif
116
- }
102
+ }
103
+
104
+ #if defined(ARDUINO_PORTENTA_C33)
105
+ extern " C" int LWIP_RAND () {
106
+ return rand ();
107
+ }
108
+ #endif
0 commit comments